4 minor findings · 5 suggestions
Earlier concerns neither republished nor resolved: 2 suggestions. See the Run archive for their assessments.
Findings
[minor] · Stale-tip availability bypasses per-peer serving restrictions
With -staletips=headers, pruned nodes can disclose retained stale blocks beyond the 290-block serving boundary and disconnect requesters; no in-tree requester for these deep tips was found.
Location: src/net_processing.cpp:6019 (head).
Details and suggested fix
MaybeSendStaleTips() sets have_block using only BLOCK_HAVE_DATA and BlockRequestAllowed(). A pruned node can retain a script-valid stale tip 291–1000 blocks below its active tip that satisfies both the tracker window and the stale-block age limits. Announcing it to a negotiated peer exposes retention beyond the privacy boundary. ProcessGetBlockData() instead disconnects peers without NoBan when only NODE_NETWORK_LIMITED was advertised and depth exceeds 288 + 2, before consulting storage. The callback also omits the historical-upload restriction for peers without Download, so it can offer data already barred by that policy.
Share the non-mutating, permission-aware serving checks between this callback and ProcessGetBlockData(), setting have_block=false when serving is currently barred. Add a regression test with a retained, script-valid stale block between 291 and 1000 blocks deep.
[minor] · Higher-work stale-tip announcements are not reconsidered after catch-up
A have_block=false announcement received one block behind can remain untracked after catch-up because admission is never retried; the frequency of this race on real networks is unmeasured.
Location: src/node/staletiprelayman.cpp:101 (head).
Details and suggested fix
A sender can know two competing blocks at height H+1 and announce the losing header while the receiver is still at H. ReceivedStaleTip() remembers that announcement, but tracker admission rejects its greater chainwork and MaybeNotifyAcceptedStaleTip() skips it too. With have_block=false, this path does not fetch its block. Once the receiver catches up on the winning branch, neither BlockConnected() nor UpdatedBlockTip() retries the remembered header. It remains absent from getchaintips(staletips_only=true) and onward relay unless another announcement, block-data arrival, or startup seeding repairs it. The sender suppresses repeat announcements while the tip remains tracked. Retry the bounded remembered announcements when the active tip advances, and test catch-up without resending.
[minor] · staletip bypasses the block-import guard
With -staletips=headers, a higher-work have_block=true announcement during import can start a download whose reply is discarded and request times out; no production occurrence was identified.
Location: src/net_processing.cpp:6029 (head).
Details and suggested fix
During -loadblock with a recent persisted tip, a negotiated peer can announce a higher-work tip with have_block=true. Unlike the HEADERS and BLOCK handlers, ProcessStaleTip() does not check LoadingBlocks(). HeadersDirectFetchBlocks() can therefore send getdata because CanDirectFetch() checks tip recency, not import state. If the full-block reply arrives before import ends, the BLOCK handler returns before RemoveBlockRequest(). The pending request suppresses other direct-fetch attempts and can end in a block-download timeout disconnect despite the peer having replied. The missing guard also permits otherwise accepted headers into the block index during import. Ignore staletip messages while LoadingBlocks() is true, matching the existing handlers.
[minor] · Announcement eviction removes an outstanding block's punishment exemption
Twenty intervening distinct staletip announcements can remove a pending download's exemption and cause punishment for a connect-time failure; no honest peer producing this sequence within the download window was identified.
Location: src/node/staletiprelayman.cpp:98 (head).
Details and suggested fix
If a peer offers branch B with have_block=true and sends 20 other distinct, non-covering announcements before delivering its requested full block, ReceivedStaleTip() evicts B from m_staletips_from_peer, even when the tracker rejects the other tips. Already-known valid headers can take this path. BlockChecked() recomputes the exemption from that deque rather than the request or block-source attribution. A stored block failing only in ConnectBlock() then reaches Misbehaving(); a cached-invalid descendant also does so for an outbound peer. Preserve the offer on the outstanding request through BlockChecked(), and extend the existing no-punishment test with intervening announcements.
Optional improvements
[suggestion] · headers mode has limited signet stale-tip propagation
On signet, -staletips=headers advertises prefers_blocks=true but cannot track an unknown equal- or lower-work stale tip without separately obtaining its block; announcing a stale tip also requires prior script validation.
Location: src/net_processing.cpp:6111 (head).
Details and suggested fix
Signet's tracker requires BLOCK_VALID_TRANSACTIONS, but HandleStaleTip() fetches blocks only for higher-work announcements. An unknown, genuinely stale tip therefore remains headers-only even with have_block=true, so this path neither lists it in staletips_only nor forwards it. Sending is narrower still: signet requires have_block=true, and production BlockRequestAllowed() requires BLOCK_VALID_SCRIPTS for stale blocks, excluding stored blocks that were never connected. Document this limitation explicitly for signet in headers mode and cover the supported exchange with an end-to-end signet test. Broader discovery requires bounded block acquisition that retains signature validation. The manager-level test injects can_serve=true and does not exercise these production constraints.
[suggestion] · Release note overstates fetching and the invalid-block exemption
The release note omits have_block from fetching and exemption conditions and incorrectly implies that all invalid stale-branch blocks avoid punishment.
Location: doc/release-notes-36920.md:8 (head).
Details and suggested fix
HandleStaleTip() enters block downloading only when the peer offers block data. The exemption also requires a remembered have_block=true announcement covering the branch and either stored data or BLOCK_CACHED_INVALID. For example, test_early_invalid_stale_branch_block_punished still expects disconnection for duplicate transaction inputs after such an offer. Qualify the note: offered higher-work tips use normal block downloading, and the exemption covers connection-time failures or cached invalidity after an ancestor fails, not failures detected before storage.
[suggestion] · P2P fuzz harnesses leave stale-tip processing disabled
process_message and process_messages leave stale-tip relay disabled, so their staletip inputs cannot exercise the receive, tracking, relay, or punishment-exemption logic.
Location: src/test/fuzz/staletip_message.cpp:12 (head).
Details and suggested fix
Both harnesses construct PeerManager::Options without setting stale_tip_relay_mode, whose default is NONE; NegotiatedStaleTip() therefore rejects every staletip that reaches dispatch. The new staletip_message target covers decoding, decompression and round-tripping, not PeerManager. Enable StaleTipRelayMode::HEADERS in the message harnesses, at least in process_messages, so inputs can leave verack pending, advertise BIP332, complete verack, and then send staletip. Simply enabling the option in the single-message harness does not by itself negotiate the remote feature.
[suggestion] · Higher-work test misses the peer header-state update
Removing UpdatePeerStateForReceivedHeaders() would still satisfy this test's getdata assertion because direct fetch does not depend on the peer's best-known header.
Location: test/functional/p2p_staletip.py:457 (head).
Details and suggested fix
test_higher_work_staletip_requests_block disconnects immediately after seeing getdata. HeadersDirectFetchBlocks() walks the supplied last_header and does not need pindexBestKnownBlock, so removing UpdatePeerStateForReceivedHeaders() would leave these assertions passing. That state is separately required by parallel download and is exposed as getpeerinfo's synced_headers. Before disconnecting block_peer, assert that synced_headers equals the height of the announced block.
[suggestion] · Signet variant rationale names a consensus-constrained field
The comment attributes valid signet variants to changing nBits, although contextual validation fixes the required difficulty; changing the unsigned nNonce and redoing proof of work explains the deduplication.
Location: src/node/staletiptracker.cpp:27 (head).
Details and suggested fix
On an otherwise unchanged signet block, ContextualCheckBlockHeader() requires nBits to match GetNextWorkRequired(), so changing it does not produce another valid header. The signet signature omits nNonce, which can instead be re-mined without changing the signature, previous hash or merkle root. Use nNonce in this explanation so the deduplication policy is tied to the actual source of valid variants; no logic change is needed.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: A peer's
prefers_blocksnever affects announcements (earlier report) - [suggestion]:
have_blockfetching is separated from its punishment exemption (earlier report)