2 suggestions
Earlier concerns neither republished nor resolved: 2 suggestions. See the Run archive for their assessments.
Optional improvements
[suggestion] · Task-buffer reuse adds an unnecessary API dependency
A lazy sized range can remove the intermediate task vector and std::function layer without depending on Submit retaining the caller's buffer.
Location: src/coins.cpp:398 (head).
Details and suggested fix
The current code is valid because Submit binds the vector by reference and moves individual callables rather than taking its storage. However, the capacity Assume and allocation saving depend on a postcondition that the range overload does not document. This reuse saves the task-vector buffer allocation, while Submit still allocates its futures vector and packaged-task shared states. Prefer a sized prvalue range, for example Submit(std::views::iota(size_t{0}, n) | std::views::transform([this](size_t) { return [this] { while (ProcessInput()) {} }; })), where n = std::min(workers_count, m_inputs.size()). Each yielded closure becomes an owning packaged_task<void()>, so the future type still matches m_futures and no reference to the view escapes. Pool rejection checks, empty-range handling and the existing failure fallback remain unchanged. This removes m_tasks, its capacity assumption and the type erasure, at the cost of a nested lambda and restoring <ranges>. The proposed range is compatible with the templates by inspection but has not been compiled.
[suggestion] · Task-count boundaries lack regression coverage
The overlay unit tests cannot distinguish the new input-count cap from one task per worker, and the pool tests do not assert successful empty submission.
Location: src/coins.cpp:395 (head).
Details and suggested fix
Every overlay unit test reaching submission uses CreateBlock(), which queues 95 external prevouts for eight workers, so reverting the cap would leave their assertions unchanged. fetch_no_inputs has an empty backend rather than an empty queue, and access_non_input_coins is coinbase-only and bypasses submission. Add deterministic boundary tests by retaining the pool handle and adapting the BlockWorkers latch/semaphore pattern from threadpool_tests.cpp to block every worker before StartFetching. Assert WorkQueueSize() == 1 for one external input and 0 for a synthetic multi-transaction block whose inputs are all in-block spends. Release the blockers before any coin lookup or guard teardown, since both can wait for fetches. Reuse the overlay across these cases to exercise the retained task storage with changing counts. Also add a direct pool assertion that an active, uninterrupted pool accepts an empty range and returns an empty futures vector.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: Txid cleanup is serialized ahead of prefetch submission (earlier report)
- [suggestion]: Fuzz RNG seeds outlive their hasher dependency (earlier report)