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

netsync: require block-serving services on regtest/simnet sync peers

Public commit record

What the developer wrote

Authored by Oli

95/100 · Strong
netsync: require block-serving services on regtest/simnet sync peers

Commit 26124d275 made every peer a sync candidate on regtest and
simnet so that nodes on non-localhost networks (e.g. Docker bridge
networks) can be synced from. Dropping the address requirement was
the intent, but the change also dropped the service-flag requirement,
so light clients became eligible sync peers.

A light client (e.g. neutrino) advertises a recent best height but
can serve neither headers nor blocks. Electing one as the sync peer
stalls the sync until the stall handler disconnects it, and with
other light client connections present the next one is elected and
stalls again, livelocking the sync indefinitely. This surfaced in
neutrino's sync tests, where a btcd simnet node connected to both a
neutrino instance and other btcd nodes never synced.

Keep accepting any peer address on regtest/simnet, but require the
peer to signal SFNodeNetwork or SFNodeNetworkLimited like on any
other network.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a bug in btcd's test-network synchronization logic. A previous change accidentally allowed light clients (such as Neutrino wallets) to be chosen as sync peers on regtest/simnet. Because light clients advertise a recent block height but cannot actually serve blocks, a node could pick one as its sync peer, stall, disconnect it, then pick another light client and stall again—potentially livelocking synchronization. The fix restores the requirement that sync peers must signal they can serve full blocks, while still allowing any network address on these test networks.

Recommended action

Review and merge the patch; verify that regtest/simnet nodes still sync correctly from Docker/non-localhost peers that advertise the required service flags, and that neutrino or other light clients are no longer selected as sync candidates.

Security signals we found

01

Denial-of-service via sync livelock on regtest/simnet

02

Light client eligible as sync peer due to missing service-flag check

03

Peer service flags not validated before sync election on test networks

Risk score

Why this scored 35/100

Our methodology →
Potential impact 8/30
Exploitability 4/25
Stealth signal 6/15
Affected reach 5/15
Confidence 8/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.