Review report

core: PR #36496

3 suggestions

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

Optional improvements

Link

[suggestion] · Txid cleanup is serialized ahead of prefetch submission

For successful nonempty fetches, clearing the reusable txid set before Submit() removes the previous opportunity to overlap node cleanup with the first prevout reads.

Location: src/coins.cpp:394 (head).

Details and suggested fix

clear() still destroys and frees the classification nodes even though it retains the buckets. In base, the local set went out of scope after Submit() queued the tasks and notified workers, so cleanup could overlap fetching. Here it finishes before submission. Move m_earlier_txids.clear() after the success/failure handling, still inside this branch. ProcessInput() never accesses the set, and failure cleanup does not depend on it, so this preserves serial fallback and the next call's empty-set assertion. Any performance benefit is unmeasured and depends on the allocator and worker scheduling; freeing early can instead reduce peak live memory.


Link

[suggestion] · Task-count cap and successful empty submissions lack unit assertions

The overlay fixtures cannot distinguish the new task cap from workers_count, and thread-pool tests never assert successful submission of an empty range.

Location: src/coins.cpp:395 (head).

Details and suggested fix

CreateBlock() supplies roughly 95 external prevouts, exceeding the eight workers. fetch_no_inputs uses that same block against an empty backend, so it still queues inputs; the coinbase-only case skips this branch. The existing overlay assertions therefore do not distinguish the cap from workers_count. Empty-range thread-pool tests only check rejection. Add deterministic cases using the BlockWorkers latch/semaphore pattern: with every worker blocked, assert WorkQueueSize() is one for a block with one external input and zero for a multi-transaction block containing only in-block spends or no inputs. Reuse the overlay and release blockers before lookups or teardown, since those can wait for fetches. Also assert directly that an active pool accepts an empty range and returns an empty future vector.


Link

[suggestion] · Fuzz RNG seeds outlive their hasher dependency

The per-input RNG seeds in coins_view_overlay, coins_view_stacked and coinscache_sim appear obsolete now that overlays honor deterministic hashing, and they mask future global-RNG dependencies from CheckGlobals.

Location: src/coins.h:766 (head).

Details and suggested fix

Previously, StartFetching() default-constructed its classification hasher, which drew random salts even for deterministic overlays. The new constructor removes that dependency. These fuzz targets pass deterministic=true to their caches, including the block-building seed cache, and ReallocateCache() preserves that choice. The // for SaltedCoinsCacheHasher comments are therefore stale, while the seed calls continue to permit global-PRNG use for each input. Remove the three per-input SeedRandomStateForTest calls and their stale comments, then run the targets with the existing CheckGlobals guard to confirm that no indirect dependency remains.


Coverage details

Earlier concerns

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