Skip to content

eth: switch to full sync before genesis block #31805

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

MonkeyMarcel
Copy link
Contributor

Fix and close #28222

Copy link
Member

@rjl493456442 rjl493456442 left a comment

Choose a reason for hiding this comment

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

Would it always trigger a full sync if the database is empty?

@MonkeyMarcel
Copy link
Contributor Author

Would it always trigger a full sync if the database is empty?

The answer is Yes, when the user start with snap sync and the database is empty, it will use full sync for the genesis block and then switch to snap sync for the reset of the chain.

@MonkeyMarcel MonkeyMarcel requested a review from rjl493456442 May 13, 2025 16:01
@rjl493456442
Copy link
Member

Ah, why do we need to sync the genesis in the first place? Isn't it defined by the local chain config?

@MonkeyMarcel
Copy link
Contributor Author

@rjl493456442 Thanks for your advice. I've reviewed the fix again and realized the previous solution was incorrect.
Now it should be fixed, if the genesis block is in the future, we should switch to full sync. Could you please take a look and confirm if this fix is correct? (PTAL)

@MariusVanDerWijden
Copy link
Member

Why should we switch to full sync if the genesis block is in the future? Is there a problem that you are trying to solve with this?

@MonkeyMarcel
Copy link
Contributor Author

Why should we switch to full sync if the genesis block is in the future? Is there a problem that you are trying to solve with this?

Sorry for the incorrect fix, I took a closer look and I think we only need to check at the moment of node startup to determine if the genesis block is in the future. Then, we can simply configure it as full sync. Please help review this again.

@MariusVanDerWijden
Copy link
Member

WHY do you want to do this?

@MonkeyMarcel
Copy link
Contributor Author

WHY do you want to do this?

Just fix the issue, and there is a tag named ‘help wanted’

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.

Geth should handle genesis block with default syncmode
3 participants