Review report

bitcoin/bitcoin: PR #36350

1 minor finding · 1 suggestion

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

Findings

Link

[minor] · The independent headers deadline still overrides progress renewals

With another preferred-download peer available, a progressing initial sync can still time out because the new branch renews only the chain-sync timer.

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

Details and suggested fix

The new branch extends m_chain_sync.m_timeout, but m_headers_sync_timeout remains fixed from the initial getheaders request. SendMessages checks that deadline before ConsiderEviction. If the best stored header remains at least 24 hours old, exactly one peer has started sync, and another preferred-download peer exists, it disconnects the sync peer without NoBan permission regardless of PRESYNC or REDOWNLOAD progress. Ordinary block-serving outbound peers satisfy the preferred-download condition. Consequently, a steadily slow peer whose complete headers download exceeds this deadline still gets disconnected despite the renewals. The change can still help when the sync peer is the sole preferred peer or when redownload finishes before the independent deadline. All four new tests use the single-peer fixture, so they exclude this interaction. To extend the intended protection to this multi-peer case, renew the headers-download deadline using the same bounded progress signal and add a test with a second outbound peer.


Optional improvements

Link

[suggestion] · The renewal-bound test cites a state dependency that cleanup removes

The comment justifies an alternate chain using retained headers, but restore_node1() removes those headers before this functional test runs.

Location: test/functional/p2p_headers_sync_with_minchainwork.py:209 (head).

Details and suggested fix

test_redownload_peer_not_evicted() ends with restore_node1(), which stops node1, recursively deletes its blocks and chainstate directories, and restarts it. The synthetic chain was supplied while node1 was disconnected from the other test nodes, so reconnecting them does not restore it. The bounded-renewal test therefore does not need a different chain for the stated reason. Its eight full messages, totaling 16,000 headers, would also remain in PRESYNC with the default version-4 chain and -minimumchainwork=0x20000. Remove the stale comment and unnecessary version/threshold changes, or document another reason for keeping those parameters.


Coverage details

Earlier concerns

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