Skip to content

Cleans up the NoPeer error handling in range sync's send_batch#8919

Draft
jimmygchen wants to merge 4 commits into
sigp:unstablefrom
jimmygchen:fix-range-sync-nopeer-cleanup
Draft

Cleans up the NoPeer error handling in range sync's send_batch#8919
jimmygchen wants to merge 4 commits into
sigp:unstablefrom
jimmygchen:fix-range-sync-nopeer-cleanup

Conversation

@jimmygchen
Copy link
Copy Markdown
Member

@jimmygchen jimmygchen commented Mar 2, 2026

Description

Split out from #8039. Cleans up the NoPeer handling in range sync's send_batch so it no longer fake-starts a download and calls download_failed — which incorrectly penalised the batch for something that wasn't a real download failure. NoPeer now logs at debug and leaves the batch in AwaitingDownload, letting it retry when peers become available.

Since AwaitingDownload is now a valid steady-state for batches, this PR also:

  • Counts AwaitingDownload batches in the buffer size check across range sync, backfill sync, and custody backfill sync, so they don't accumulate unbounded.
  • Adds stall detection: if any batch stays in AwaitingDownload for over 10 minutes, the chain is failed and will be recreated when peers re-announce via STATUS.
  • Adds a 15-second periodic retry interval in the sync manager as a safety net, in case UpdatedPeerCgc events are missed.

@jimmygchen jimmygchen changed the title Handle NoPeer in range sync without fake-failing batch Cleans up the NoPeer error handling in range sync's send_batch Mar 2, 2026
Comment thread beacon_node/network/src/sync/manager.rs Outdated
let mut prune_requests = tokio::time::interval(Duration::from_secs(15));

// Periodically retry AwaitingDownload batches and check for stalled chains, as a safety
// net in case UpdatedPeerCgc events are missed.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

what does this have to do with UpdatedPeerCgc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant