Conversation
…fallback (ReamLabs#1550) - Extend range syncer beyond finalized slot to network canonical head slot - Group peers by canonical (finalized_root, finalized_epoch) and resolve majority head slot - Add fetch_idle_peer_for_slot for slot-aware peer download scheduling - Implement 5-minute ban cooldown to unban temporary failed peers - Restore pre-Fulu blob sidecar availability check in store.is_data_available
|
Thanks for working on this. @vuonghuuhung is already working on the same issue in ream-collective/ream#19 as part of our EPF Cohort 7 project and plans to open a PR here soon. On the PR as well, there’s still a problem with head sync here. Two peers can agree on the finalized checkpoint but have different heads. Since the completion check only looks at the slot, we could end up on a non-canonical branch and still report “synced.” So just changing the target from finalized to head isn’t enough, we also need to handle those competing branches. We’ve discussed this before, and Hans is already working on it. @shariqnaiyer, I tagged you to help coordinate the overlap with our EPF work. |
@perfogic so you guys are going to make a PR for this? |
Yes, I'm working on this topic and the PR will be open on Ream soon. I opened ream-collective/ream#19 for this. I'm testing and in the last steps as well |
Thanks for the review. I understand the concern about competing unfinalized branches — just switching the target from finalized to head isn’t enough if we’re still fetching from any eligible peer without checking which unfinalized chain they’re serving. @vuonghuuhung — I saw your PR ream-collective#19 and the review discussion with @perfogic. I don’t want to duplicate work, happy to collaborate instead. I can help with one or both of the open items:
I can either open a PR against your branch or push a branch based on yours — which do you prefer? In the meantime, on my side, I’ll update this PR to:
Should I close #1577 or keep it as reference? Happy to coordinate with @perfogic and @shariqnaiyer as well. |
Resolves #1550
Overview
Extends
BlockRangeSyncerbeyond thefinalized_slotup to the network's canonicalhead_slot, ensuring that restarted or lagging nodes sync unfinalized blocks seamlessly before switching to live gossip propagation.Changes
(finalized_root, finalized_epoch)rather than just scalar slots, preventing splits across competing forks.canonical_checkpoint,finalized_slot, andhead_slotfrom canonical peers.sync_target_slot(local_slot)targetsfinalized_slotduring Phase 1 (FinalizedSync) and transitions tohead_slotin Phase 2 (HeadSync).fetch_idle_peer_for_slot(min_slot)to avoid requesting block ranges from lagging peers whose advertised head slot is lower than the requested range start.BAN_DURATION) with automatic unbanning during periodic peer set updates.Store::is_data_availablefor pre-Fulu blocks to retrieve and verify blobs fromblobs_and_proofs_provider.Verification
cargo test -p ream-syncer --features devnet5(5/5 tests passed)cargo clippy -p ream-syncer -p ream-network-manager --features devnet5 --no-deps -- --deny warnings(0 warnings)cargo check -p ream-network-manager --features devnet5(0 errors)