Add optimistic sync so the node can sync faster#1395
Closed
alok-108 wants to merge 1 commit into
Closed
Conversation
alok-108
marked this pull request as ready for review
May 24, 2026 11:03
alok-108
requested review from
Kayden-ML,
KolbyML and
shariqnaiyer
as code owners
May 24, 2026 11:03
alok-108
marked this pull request as draft
May 24, 2026 11:05
- Add skip_execution_validation parameter to on_block - Introduce OptimisticRootsTable for tracking optimistic blocks - Implement process_block_optimistic and handle_invalid_payload - Add is_optimistic_candidate_block helper (SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY = 128) - Extend BlockRangeSyncer with optimistic_mode and new_optimistic constructor - Wire --optimistic-sync CLI flag (default true) into ManagerConfig and service - Hook PayloadStatus::Invalid to handle_invalid_payload for chain backtracking
alok-108
force-pushed
the
feature/optimistic-sync
branch
from
May 24, 2026 11:13
dce8861 to
3f4d7f8
Compare
alok-108
marked this pull request as ready for review
May 28, 2026 07:23
alok-108
marked this pull request as draft
May 28, 2026 07:24
alok-108
marked this pull request as ready for review
June 11, 2026 09:25
Collaborator
|
Closing this as it is stale. Please feel free to rebase and let me know if you're still interested in taking this up. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong?
Before, the node had to fully verify every block’s execution payload before moving to the next one. This made syncing slow because it waited for the execution engine every time.
How was it fixed?
I added optimistic sync, following the Ethereum spec. Now the node can quickly import blocks by checking only basic things like signatures and slots. The full execution check happens later in the background. If a block turns out to be invalid later, the node automatically removes it and the blocks that came after it, then goes back to the last valid one.
This is all behind a --optimistic-sync flag which is turned on by default.
Closes #395