Skip to content
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, eth/downloader: fix resetting below freezer threshold #23949

Merged
merged 1 commit into from Nov 22, 2021

Conversation

karalabe
Copy link
Member

This PR fixes two bugs that can be used by a malicious node to try and push a newly joining node into a bad state (with properly mined - thus costly - blocks).

  • The PR fixes a regression in the downloader where reverting to an older common ancestor called SetHead with the ancestor + 1 instead of ancestor, ending up with 1 header too many in the freezer to import on top.
  • The PR in addition fixes an issue in blockchain.SetHead where we had a heuristic that if head == current block then we assumed it's a startup check, not a real "set the damn head" call. This lead to leaving some dangling data in the freezer and the downloader being unable to pile blocks on top.

These issue are only relevant during initial snap sync where the data is pushed directly into the freezer. After initial sync the freezer is delayed by 90K blocks and there's also a cap on the max reorg depth.

@karalabe karalabe added this to the 1.10.13 milestone Nov 22, 2021
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@karalabe karalabe merged commit 17f1c2d into ethereum:master Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants