Skip to content

peer: Add per-peer stall detection (WIP) - #32

Draft
pzafonte wants to merge 2 commits into
kernel-node:masterfrom
pzafonte:multi-peer-ibd-v4
Draft

peer: Add per-peer stall detection (WIP)#32
pzafonte wants to merge 2 commits into
kernel-node:masterfrom
pzafonte:multi-peer-ibd-v4

Conversation

@pzafonte

@pzafonte pzafonte commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Depends on #31.

Detects a peer that keeps its connection open but stops delivering the blocks it was asked for, and drops it so the work can go to another peer. Full description and rationale once the approach settles. Not ready for review.

@rustaceanrob

Copy link
Copy Markdown
Contributor

Converting to draft because this depends on 65bf637

@rustaceanrob
rustaceanrob marked this pull request as draft March 5, 2026 14:24
@pzafonte
pzafonte force-pushed the multi-peer-ibd-v4 branch 2 times, most recently from 0038c8a to e1ee32b Compare April 17, 2026 18:52
Syncing from one peer is only as fast as that peer. Connect to several
at once and share the work of downloading blocks between them, so a slow
or unresponsive peer no longer holds up the whole sync.

A shared queue and an in-flight set coordinate the peers: each block is
fetched by exactly one peer, and any block left behind when a peer drops
returns to the queue for another to fetch, so none is stranded.

Peers fetch blocks out of order, but the kernel must connect them in
chain order. A shared buffer holds each arriving block until its parent
has been handed off, then releases the unbroken run that now extends the
tip. Without it the sync stalls the moment one peer holds a block whose
parent another peer has not yet delivered.
A peer connection can stay alive while never delivering the blocks
it was requested, leaving the sync partially stuck behind a peer that
is effectively idle. Detect a peer that has gone too long without making
progress and drop it, letting the pool replace it with another one.
@pzafonte pzafonte changed the title feat: add PeerManager with multi-peer IBD and per-peer stall detection peer: Add per-peer stall detection (WIP) Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants