-
Notifications
You must be signed in to change notification settings - Fork 877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/rebuild trie from flat #7969
base: main
Are you sure you want to change the base?
Feature/rebuild trie from flat #7969
Conversation
14437fc
to
2cd2b8f
Compare
This pr is stale because it has been open for 30 days with no activity. |
This pr was closed because it has been inactive for 14 days since being marked as stale. |
reopening |
25ae3ac
to
294f98b
Compare
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
Signed-off-by: garyschulte <[email protected]>
8a3ad52
to
11194a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under what circumstances do we have a "good" flat DB that can be used to rebuild a broken trie? And how do we know that the flat DB is "good"?
In its current incarnation, this is a 'repair' type command. If for example besu ends up with a corrupted worldstate, this will rebuild the state trie from the flat db. I had this happen on a long running node yesterday where trielog, blockchain and worldstate all ended up at different places on restart due to a kill. When Besu started it attempted to "heal" the worldstate it wrote garbage to the trie. Using this PR I was able to salvage an archive node that had been syncing for quite some time. Longer term, this subcommand would be useful to rebuild the trie from a state-trie-less full sync strategy, where we can trust the chain head either via static checkpoints we have in the code or from finalized blocks from the CL. That sync method is still a WIP though. |
PR description
Implement a storage subcommand to rebuild the bonsai state trie from flat db. This subcommand can be used to fix a broken state trie by re-inserting all of the elements from the flat database into the state trie.
usage:
besu --config-file=<config_toml> storage rebuild-bonsai-state-trie
This is a destructive action, but has appropriate safeguards to ensure the state trie reconstruction will be successful.
Fixed Issue(s)
fixes #7934
Thanks for sending a pull request! Have you done the following?
doc-change-required
label to this PR if updates are required.Locally, you can run these tests to catch failures early:
./gradlew build
./gradlew acceptanceTest
./gradlew integrationTest
./gradlew ethereum:referenceTests:referenceTests