Repository navigation
Conversation
dimka90
requested review from
Kayden-ML,
KolbyML and
shariqnaiyer
as code owners
October 27, 2026 06:16
Contributor
Author
|
@KolbyML can you look into this? |
This branch has not been deployed
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?
Bug: while a node is backfill syncing,
handle_syncing_process_block(crates/common/chain/lean/src/service.rs) stores every gossiped block in the pending-blocks table with no check on its slot. A block whose slot is far past the wall clock is stored like any other.Problem: one such block keeps the node in Syncing for good.
SyncStatus::Syncing. Until it isSynced, the chain service doesn't tick the fork-choice store and ignores every gossiped attestation and aggregated attestation.should_switch_to_syncedrefuses the handoff while the pending-blocks table is non-empty.prune_stale_pending_blocksremoves a pending block only once it is imported or finalization passes its slot. Finalization never reaches a slot like 2^40, and the forward-sync wall-clock purge only covers roots in a backfill queue. So the block is never removed.Any peer can send this while a node is starting up or catching up. The block needs no valid parent, proposer, or signature. The node then never switches to Synced, so its fork choice stops following the network's votes for good.
How was it fixed?
handle_syncing_process_blockignores a gossiped block whose slot is more than one past the wall-clock slot, before storing it. This is the horizon block import already applies (Block too far in future,fork_choice/lean/src/store.rs) and the forward syncer uses (BlockAheadOfWallClock). It is leanSpec'sBLOCK_TOO_FAR_IN_FUTURErule. A legitimate block is never more than one slot ahead, so nothing real is dropped.New test
test_far_future_gossip_block_does_not_block_synced_handoff: it builds a syncing service, gossips a block at slot 2^40 with a made-up parent, runsprune_stale_pending_blocks, and checks thatshould_switch_to_syncedcan pass. The test is its own commit and fails on currentmaster:Checks run:
cargo test -p ream-chain-lean --no-default-features --features devnet5: 35 passed.cargo clippy -p ream-chain-lean --all-targets --no-default-features --features devnet5 -- --deny warnings: passes.cargo +nightly fmt --all -- --check: passes.Only
ream-chain-leanchanged, so I did not run the full workspacemake test.To-Do