Review report

core: PR #35229

1 suggestion

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

Optional improvements

Link

[suggestion] · A concurrent chain change makes scanblocks report an internal bug

If an authenticated RPC caller shortens the active chain during a scan, CHECK_NONFATAL returns an internal-bug error in release builds and aborts Debug builds; the base revision crashed on the same path.

Location: src/rpc/blockchain.cpp:2719 (head).

Details and suggested fix

scanblocks captures stop_block once but looks up each intermediate end_range against the current active chain under a fresh cs_main lock. Because InvalidateBlock releases that lock between DisconnectTip calls, a concurrent invalidateblock can shorten the chain below the next chunk end while the scan's height check still passes. ActiveChain()[height] then returns nullptr, causing CHECK_NONFATAL(end_range) to fail. In release builds, the RPC caller receives an internal-bug error; Debug builds and fuzz builds configured with ABORT_ON_FAILED_ASSUME abort. This is an improvement over the base revision, which passed the null pointer to LookupRange and dereferenced it. The trigger requires an authenticated RPC caller, and no new attacker-reachable impact is established. Handle the missing range explicitly, for example by returning an RPC error that the active chain changed during the scan.


Coverage details

Earlier concerns

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