-
Notifications
You must be signed in to change notification settings - Fork 20.3k
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
core: improve chain rewinding mechanism #29196
Merged
karalabe
merged 12 commits into
ethereum:master
from
rjl493456442:improve-chain-rewinding
Mar 13, 2024
Merged
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
2f0f190
core: improve chain rewinding mechanism
rjl493456442 d131a95
core: address comment
rjl493456442 88a6dc8
core: periodically print progress log
rjl493456442 9d7a4db
core: address comments
rjl493456442 470916d
core: fix comment
rjl493456442 c6b0eb7
core: fix rewinding in path
rjl493456442 60fb704
core: fix beyondRoot condition
rjl493456442 b5df29c
core: polish code
rjl493456442 e3884f1
core: polish code
rjl493456442 3784c6c
core: extend code comment
rjl493456442 ad7ac99
core: stop rewinding if chain is gapped or genesis is reached
rjl493456442 48bbb38
core: fix broken tests
rjl493456442 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
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.
Isn't this case the one where the snapshot persistent layer is below 90K? In the current implementation, won't we end up just having a broken snapshot layer that's always stale and the chain moving forward with the trie only? Shouldn't we trigger some snapshot-fixing in this case?
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.
True, the snapshot state is impossible to recover.
In this case, we will not search for the snapshot state, and return the block as the head with "first seen state".
We don't. As in this case,
rootNumber
is returned as 0, the snapshot recovery mechanism is disabled.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.
But in that case, won't we simply leave the snapshot layer forever dangling in that old state?
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.
Ah, in case of a head mismatch, the snapshot gets invalidated and auto-regenerated?
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.
exactly