-
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
eth/downloader: remove stale beacon headers as backfilling progresses #24670
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
e2706ca
eth/downloader: remove stale beacon headers as backfilling progresses
karalabe 3d6d443
eth/downloader: remove leftover from a previous design
karalabe d78d849
eth/downloader: do partial beacon cleanups if chain is large
karalabe d1903bd
eth/downloader: linter != heart
karalabe 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
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
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
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.
It's unclear to me..
So we have the lastchain whose head is equal to tail(it means we haven't fetched any skeleton header yet in this cycle) and we get a lower point announcement but the corresponding skeleton is already existent.
Any particular reason for specialize this scenario?
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.
It's a different scenario:
At this point we in theory should delete all the headers, but the invariant is that there's at least 1 beacon subchain with at least 1 header (there's no special casing for empty subchains or no subchains). This means that if we say synced to block 1000, we'll have deleted headesr 0-999, but still keep the 1000th, even though we already backfilled it.
Now, it can happen that at this point, the beacon client sends us a forkchoice update to this exact header. (e.g. we received newPayload with header 1000, processed it via sync and then get the forckchoice update later).
Without this special casing, the sync would "error out" with a beacon chain reorg. It would spin back up and download a lot o headers uselessly. This check just ensures that if we want to sethead to the current head, there's no sync failure.
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, I get it. So you want to specialize the case: the newly announced header is the head of lastchain and the hash is same.
It makes sense.
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.
Btw, yesterday I still managed to hit the reorg warnings somehow, so it might not be completely correct. But couldn't repro it with higher logs the second time around.