-
Notifications
You must be signed in to change notification settings - Fork 111
fix(l1): don't trigger snap sync if fcu head is already canonical #4985
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
base: main
Are you sure you want to change the base?
Conversation
Lines of code reportTotal lines added: Detailed view |
| } | ||
|
|
||
| if context.syncer.sync_mode() == SyncMode::Snap { | ||
| // Don't trigger a sync if the block is already canonical |
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.
In that case, will the sync mode be set as Full somewhere?
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.
The next FCU to an unknown head will trigger a sync, the syncer will detect that the sync_head is only a few blocks away and switch to full sync mode
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.
Update: changed to also disable snap sync so we can process incoming new payloads right away
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.
Please verify that hive --sim ethereum/engine --sim.limit "engine-auth/" passes all tests when on snap sync mode, see https://github.com/ethereum/hive/blob/7709e5892146c793307da072e1593f48039a7e4b/clients/ethrex/ethrex.sh#L79
Motivation
In hive tests we often receive an fcu with either the genesis or last imported block as head to notify the node that it is already synced. As this is not usual in a real-case scenario, we just trigger a snap sync to the advertised head. This PR solves this by first checking if the fcu head is already part of our canonic chain before triggering a sync
Description
Closes #4846