AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 48 Bitcoin

netsync: change fetchHeaderBlocks to be based on the processed block headers

Public commit record

What the developer wrote

Authored by Calvin Kim

73/100 · Adequate
netsync: change fetchHeaderBlocks to be based on the processed block
headers

We introduce buildBlockRequest that'll create a getdata message based
off of the block index instead of the headerList in SyncManager.

The new fetchHeaderBlocks utilizes buildBlockRequest and now will create
fetch requests based on the processed block headers.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a bug in btcd's block-download logic. Previously, when the node asked its sync peer for blocks, it could accidentally request the same blocks twice if a routine refill triggered while those blocks were still in-flight. The duplicate block would then be treated as 'unrequested' and the peer would be disconnected, slowing or stalling synchronization. The fix builds block requests from the processed header chain and skips any blocks already marked as requested.

Recommended action

Treat as a reliability/DoS-hardening fix. Review related header-sync and reorg handling to ensure no other paths re-request in-flight blocks. Consider whether the change merits a security advisory if remote peers could deliberately trigger the stall condition.

Security signals we found

01

Denial-of-service-like symptom: duplicate block requests could disconnect the sync peer and stall IBD

02

Logic change in P2P synchronization request path

03

New guard against re-requesting in-flight inventory

04

Test named explicitly around avoiding duplicate in-flight block requests

Risk score

Why this scored 48/100

Our methodology →
Potential impact 12/30
Exploitability 8/25
Stealth signal 7/15
Affected reach 10/15
Confidence 7/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.