Skip to content

eth/downloader: switch to full sync when progressing past genesis (fixes #28222) - #35567

Open
SakeyJakey wants to merge 1 commit into
ethereum:masterfrom
SakeyJakey:master
Open

eth/downloader: switch to full sync when progressing past genesis (fixes #28222)#35567
SakeyJakey wants to merge 1 commit into
ethereum:masterfrom
SakeyJakey:master

Conversation

@SakeyJakey

@SakeyJakey SakeyJakey commented Aug 22, 2026

Copy link
Copy Markdown

Before when Geth starts on a network at the genesis block using the default sync mode, syncModer.get() returned SnapSync whenever the mode was SnapSync which meant the node would always be stuck in SnapSync mode even after the chain advanced and local state was made for the next blocks.

This fixes the issue by checking if local state is available for blocks past genesis when checking the node's sync mode.

I also made a unit test to make sure this works.

fixes #28222

// If we're in snap sync mode, check if the chain has progressed past genesis
// and has state available. If so, snap sync is complete and we can switch to full sync.
if m.mode == ethconfig.SnapSync {
head := m.chain.CurrentBlock()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This logic has been applied in the syncModer constructor. I don't get why we need to duplicate this logic here.

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

2 participants