-
Notifications
You must be signed in to change notification settings - Fork 42
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
feat: Reorg Support (WIP) #296
base: main
Are you sure you want to change the base?
Conversation
61a00a8
to
75309b7
Compare
As of 1d5184d, I think the Bonsai tries are properly reverted (for a simple case, anyway). There are a number of DB operations that I will need to perform, however, and it's not clear exactly what that is. Any pointer here would be appreciated. It looks like contract storage changes will need to be explicitly reverted as well. The docs here discuss the rocksdb iterator which could be used to clear out items from block N onward, but we would still want a list of modified keys to avoid touching every storage item in the db. Are other items (such as |
75309b7
to
11f96cc
Compare
This PR adds basic support for reverting state during a reorg.
Originally, the goal was to detect reorgs and handle them, but the block import pipeline does not seem like the appropriate place for this detection. So the PR currently adds a
fn reorg()
which does the logic of reverting the databases to a desired block along with tests around this.Pull Request type
Feature
What is the current behavior?
I expect reorgs would be dropped currently because a block's parent_header is checked against the tip of the chain and an error is produced if the two don't match.
Resolves: #202 #416
What is the new behavior?
TODO:
Does this introduce a breaking change?
TODO: