3 minor findings · 3 suggestions
Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.
Findings
[minor] · Signet solution variants bypass the tracker’s merkle-root deduplication
On signet with -staletips=headers, a peer can reuse a signed block and mine solution variants that bypass deduplication, displacing genuine lower-work tips from the ten-entry tracker.
Location: src/node/staletiptracker.cpp:40 (head).
Details and suggested fix
IsVariantOnBranch compares the ordinary hashMerkleRoot, whereas BIP 325 authenticates the solution-stripped signet_merkle. With the default bare-multisig challenge, a peer can prepend extra pushes to the solution’s scriptSig without invalidating its signature because signet verification does not enforce CLEANSTACK. This changes the coinbase txid and header merkle root. Each copy still requires fresh PoW at the required signet target. Copies delivered while they match the active tip’s work pass unsolicited-block admission and reach ReceivedBlockTransactions, so requiring a validated block does not exclude them. They can occupy the tracker’s ten slots, evict lower-work entries and prevent later equal-work admissions. The consequence here is polluted local tracking and getchaintips staletips_only, not a consensus change.
Deduplicate using the BIP 325 signet_merkle or an equivalent normalized identity. Compute and retain it while block data is available, with support for pruning and startup reconstruction rather than reading data only when adding a tip. Add a regression using two valid solution encodings of the same signed block.
[minor] · Ahead-of-tip headers are not reconsidered when they become stale
With -staletips=headers, an eligible competitor can remain untracked after the active chain catches up unless block data is accepted or startup seeding runs; the frequency of this headers-only sequence in production is unknown.
Location: src/validation.cpp:3851 (head).
Details and suggested fix
Consider two otherwise eligible competing headers, A and B, extending the active tip at height H. Both have more work than the tip when accepted, so MaybeNotifyAcceptedStaleTip emits neither notification. After block A becomes active, headers-only B meets the tracker’s work condition but is never offered, even if the tracker is empty. Reannouncing B does not help because ProcessNewBlockHeaders only considers newly inserted headers, and the active-tip callbacks do not reconsider it. If B remains eligible, startup seeding discovers it; accepting its block data can also supply a notification. Keep a bounded set of recent off-chain candidates that were too heavy at acceptance and reconsider them as the active tip advances, without rescanning the whole block index per block. Test both headers arriving before either block connects.
[minor] · Reindex startup seeds the tracker before chain activation
With -staletips=headers, -reindex-chainstate and a fresh unpruned -reindex seed before chain activation, so eligible pre-existing forks can remain missing from getchaintips staletips_only until an ordinary restart.
Location: src/net_processing.cpp:2171 (head).
Details and suggested fix
These options wipe the coins database and skip LoadChainTip, leaving no active tip when the PeerManager constructor calls SeedFromBlockIndex. GetEligibleForkPoint therefore rejects every candidate. ImportBlocks activates the chain later, but connecting stored blocks does not replay acceptance notifications. A valid lower-work fork that never connects or disconnects during reconstruction consequently receives no tracker event. Fresh unpruned -reindex also suppresses imported stale-block notifications because their work exceeds the genesis-only active tip during import. This misses existing forks rather than preventing later runtime events from populating the tracker. Defer or retry the one-shot seed after startup chain activation completes, and add a -reindex-chainstate restart case with a recent lower-work fork.
Optional improvements
[suggestion] · max_depth help overpromises active-tip inclusion
The RPC help promises the active tip unconditionally, but getchaintips excludes it whenever staletips_only=true.
Location: src/rpc/blockchain.cpp:1611 (head).
Details and suggested fix
The stale_tips branch inserts only tracker entries; active_chain.Tip() is inserted only in the ordinary-result branch. This agrees with the existing p2p_staletip.py assertion expecting an empty result for staletips_only=True, max_depth=0 in its reorg scenario. Qualify the max_depth help’s “always returned” statement with “unless staletips_only is set” so the documented option interaction matches the intended behavior.
[suggestion] · Testnet4 difficulty coverage lacks a positive admission case
A too-strict testnet4 threshold would leave the new difficulty-policy assertions passing because successful admission near the boundary is checked only for TESTNET.
Location: src/test/staletiptracker_tests.cpp:345 (head).
Details and suggested fix
testnet4_tips is used only to reject the 0x207fffff candidate. Run the 0x1a100000 rejection and 0x1a0fffff acceptance cases for both ChainType::TESTNET and ChainType::TESTNET4. The current fixture already supports this: BlockTree gives the below-limit candidate the same height and chainwork as the active tip regardless of nBits, so the positive assertion isolates the target policy rather than failing another eligibility guard.
[suggestion] · Tracker wiring is separated from its observable integration tests
The independent getchaintips extension separates the PeerManager wiring from its first functional observation tests, making the series harder to validate commit by commit.
Location: src/net_processing.cpp:2239 at 9cf113f3ccfc (commit) (commit).
Details and suggested fix
9cf113f3ccfc6f26ec5ccc71188ac2371fc97698 adds constructor seeding and the BlockDisconnected/AcceptedStaleTip hooks without adding integration checks; the test introduced by c497ae1291722282f5fe42b03246d89f3989bdba still covers only option validation. The reorg, known-descendant and startup-seeding checks arrive in 4173d9332cc2bb6c77bf9fee183e2dc9fc4ff70c, together with the GetTrackedStaleTips accessor they need. Move 61c349f95a1dfb6c84b1f8525e1bc12cb1c96f4d, which adds tracker-independent max_depth/fork_point support and associated expectations, before c497ae1291722282f5fe42b03246d89f3989bdba. This makes the wiring and its observable tests adjacent while keeping the RPC extension separate and preserving all prerequisites.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: The
max_depthcutoff leaves historical set-building work intact (earlier report)
Background
Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.
Documented decisions
Stale-tip relay is an optional observability feature, not a prerequisite for chain selection. Its benefits are detecting propagation problems, partitions and adversarial mining, with faster potential reorg handling as an additional benefit. The BIP explicitly pairs these nonessential benefits with low performance demands and strict resource limits.
This establishes why the new tracker is a bounded, policy-selected view rather than a complete archive of every competing branch. The pinned tracking-only stage is also distinct from later block-download behavior; tracking a stale header does not itself imply requesting or fully validating its block.