1 minor finding
Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.
Findings
[minor] · Template rebuilds cause false crashes in rpc fuzzing
Source inspection shows that rpc fuzz inputs reaching getblocktemplate cache rebuilding will abort; no execution was recorded, and immediate CI impact is unconfirmed.
Location: src/node/block_template_manager.cpp:74 (head).
Details and suggested fix
FUZZ_TARGET(rpc) permits getblocktemplate and installs only FakeNodeClock. Its regtest setup lets a request with {"rules":["segwit"]} reach the initially empty cache without peers or an IBD check. CheckGlobals clears the steady mock before each input, so the new MockableSteadyClock::now() read sets g_used_system_time, causing the guard to call std::abort() afterward. The read happens before template assembly, so even a failed build triggers it. Later mempool-change age checks can also trigger the abort. The previous GetTime() reads were covered by FakeNodeClock. Add a FakeSteadyClock alongside it in FUZZ_TARGET(rpc) to prevent this valid RPC path from producing a false crash.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: Longpoll tests discard the returned template (earlier report)
Background
Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.
Ralph's inferences
The cache policy is consistent with amortizing block-assembly work under frequent requests and mempool changes, while treating a new chain tip as immediately requiring fresh work. Five seconds is a mempool-driven rebuild throttle, not a periodic expiry: an unchanged mempool permits indefinite reuse, and a changed tip bypasses the age gate.
The base implementation rebuilds on a tip change or on a mempool change when the cached template is more than five seconds old. The head preserves those conditions while measuring age with a steady clock. This supports a resource-management interpretation, but does not establish why five seconds, rather than another interval, was originally chosen.
Longpoll waiting and cache rebuilding are separate policies. The base longpoll path wakes on a changed tip, but checks for mempool changes only after one minute and then every ten seconds. Its comments explicitly say BIP22 does not require those particular intervals and recommends a long request timeout.
Compatibility should distinguish notification timing from template-cache age. The longpoll identifier tracks the tip and a mempool update counter; it does not encode cache age. A tip change bypasses the cache throttle. Although an initial minute-long wait normally exceeds five seconds, the shared cache can have been rebuilt by another caller during that wait, so longpoll completion is not itself an unconditional instruction to rebuild.
There was an intentional in-tree test use of mocktime advancement around cache refresh, but the inspected evidence does not establish a supported production contract for clock-driven invalidation. The prioritisetransaction test requested a template, changed transaction priority, advanced mocktime by ten seconds, and requested another template under a comment expecting an eventual new block.
This identifies a concrete test caller affected by changing the age clock. Its assertion compared whole responses, so the code alone does not prove that it specifically verified transaction-set rebuilding: the base RPC also updates the returned header time on cached-template reuse. The head's steady-clock age measurement removes mocktime as a way to advance this cache interval, without implying that all template timestamp behavior becomes steady-clock-based.