cmd/geth, core/rawdb: add dbDeleteTrieState#2302
Merged
buddh0 merged 2 commits intobnb-chain:developfrom Mar 20, 2024
Merged
Conversation
flywukong
reviewed
Mar 19, 2024
flywukong
reviewed
Mar 19, 2024
77519ac to
a36842f
Compare
fynnss
reviewed
Mar 19, 2024
62129f1 to
6a6de14
Compare
zzzckck
approved these changes
Mar 19, 2024
This was referenced Mar 21, 2024
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a feature to convert full node to fast node by introducing a new CLI tool called
delete-trie-state. The tool will delete all PBSS key-value pairs and ancient state stores from the database.Rationale
This is particularly useful when users want to switch from full node to fast node by deleting the trie state from the database, reducing disk space occupied.
Example
Usage:
./geth --datadir db delete-trie-stateChanges
Also added an additional
NoTrieslogic check inSetupGenesisBlockWithOverrideto prevent committing the genesis block again. For custom networks, this will result in an error because!triedb.Initialized(header.Root)returns true due to an empty trie database, so we need to skip committing if it's a fast node.