Review report

bitcoin/bitcoin: PR #36350

1 minor finding

Earlier concerns neither republished nor resolved: 1 minor finding · 1 suggestion. See the Run archive for their assessments.

Findings

Link

[minor] · The initial-headers deadline can still evict a progressing sync peer

With one active headers-sync peer and another preferred-download peer, the unchanged initial-headers deadline can still disconnect an honest slow peer despite the new chain-sync renewals.

Location: src/net_processing.cpp:5550 (head).

Details and suggested fix

This branch renews only m_chain_sync.m_timeout. The separate peer.m_headers_sync_timeout is initialized once from the best-header age, and successful PRESYNC/REDOWNLOAD continuations do not extend it. If a slow initial sync outlasts that deadline while our best header remains at least 24 hours old, nSyncStarted == 1, another preferred-download peer exists, and the sync peer lacks NoBan permission, SendMessages disconnects it with "Timeout downloading headers" before calling ConsiderEviction. This deadline predates the PR, so it limits the proposed liveness fix rather than introducing a regression. connect_headers_server attaches only one outbound peer, which prevents the new tests from exercising this interaction. Apply the same bounded progress-renewal policy to the initial-headers deadline so that it does not override the intended grace period, and add a progressing-sync test with a second outbound peer.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.