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

eth/downloader: fix cornercase when clean stale beacon headers #26441

Merged
merged 1 commit into from
Jan 12, 2023

Conversation

rjl493456442
Copy link
Member

@rjl493456442 rjl493456442 commented Jan 6, 2023

This PR fixes a special corner case when cleaning up stale beacon headers.
Though I think it's really hard to happen, just submit the fix anyway.

For example, the scenario could be:

  • The last filled header is 6
  • The beacon skeleton head is 5

In this case, a new skeleton subchain will be created {tail=6, head=6} and all other
subchains will be dropped. The beacon header 6 is also expected to be persisted.

But originally, in this case, beacon header 6 is not persisted for some reasons. This
PR fixes this issue.

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.

I think this change is fine, but I really feel out of my depth here...

@rjl493456442
Copy link
Member Author

Let's wait Peter on it. It's really unlikely to be triggered, priority is not that high.

@holiman holiman added this to the 1.11.0 milestone Jan 12, 2023
@fjl fjl merged commit b748709 into ethereum:master Jan 12, 2023
shekhirin pushed a commit to shekhirin/go-ethereum that referenced this pull request Jun 6, 2023
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.

4 participants