4 suggestions
Earlier concerns neither republished nor resolved: 3 suggestions. See the Run archive for their assessments.
Optional improvements
[suggestion] · Null-coinbase approval does not reserve coinbase headroom
makeTemplate() without a supplied coinbase can approve a set that exceeds weight or sigop limits with the intended coinbase; no current JDS caller producing this input was found in this checkout.
Location: src/interfaces/mining.h:167 (head).
Details and suggested fix
MakeTemplate() calls only CreateCoinbaseTx(..., /*fees=*/0) before validation. It does not apply the block_reserved_weight or coinbase sigop reservation used by resetBlock() during node assembly. A set near a consensus limit can therefore fit beside the small OP_TRUE dummy but fail with a larger coinbase. If the caller starts mining on that approval, submitSolution() can reject the solved block after substituting the real coinbase. Document on makeTemplate() that omitting the coinbase checks neither the intended payout nor its weight and sigop cost, and direct callers needing those checks to supply their intended coinbase before mining. This preserves acceptance of consensus-valid external templates without imposing assembly-policy reservations.
[suggestion] · A collection can retain many blocks' worth of transaction data
An IPC client with RPC-level authority can retain many blocks' worth of transactions after template rejection; impact through untrusted miners depends on downstream JDS budgets that were not established here.
Location: src/node/tx_collection.cpp:97 (head).
Details and suggested fix
collectTxs() caps identities at 16,666, not their aggregate weight. Both constructor mempool matches and distinct matching transactions supplied across AddMissingTxs() calls are retained without a total-weight check. MakeTemplate() only copies references, so validation failure leaves the entries owned by the collection until destruction or disconnect. Mempool eviction does not release its references either. Track retained transaction weight, including constructor matches, and reject a batch atomically if newly filled entries would take it above MAX_BLOCK_WEIGHT; count resubmitted entries only once. Every consensus-valid block's non-coinbase transactions fit within that bound. This limits persistent collection state, not the temporary memory used to deserialize an IPC request.
[suggestion] · External-template tests do not distinguish script-invalid spends
The new external-template tests would not detect a script-verification bypass confined to MakeTemplate(), despite accepting transactions that never passed mempool admission.
Location: src/test/tx_collection_tests.cpp:175 (head).
Details and suggested fix
template_transactions supplies a correctly signed parent with submit=false and an OP_TRUE child. Its negative cases and the coinbase tests require failures for completeness, input availability, tip, BIP30, reward or commitment checks, not script execution. Scripts currently run through TestBlockValidity() and ConnectBlock(), and miner_tests.cpp covers script rejection through createNewBlock(), but neither tests that rejection through AddMissingTxs(). Add a case in TestChain100Setup spending a mature coinbase with a corrupted signature. Request that variant's wtxid in a fresh collection, supply it through AddMissingTxs(), and call MakeTemplate() with a null coinbase so the generated witness commitment is correct. Assert that the returned reason starts with block-script-verify-flag-failed.
[suggestion] · The template-validation contract omits the signet exception
The new makeTemplate() contract lists only proof-of-work and merkle-root checks as disabled, although it also skips the signet challenge even with a supplied coinbase.
Location: src/interfaces/mining.h:155 (head).
Details and suggested fix
MakeTemplate() passes check_pow=false, and CheckBlock() gates CheckSignetBlockSolution() on that flag. A coinbase can therefore pass template validation without a valid signet solution, provided the other checks pass. Submission still verifies the final solution, which commits to nVersion and nTime, fields that submitSolution() can replace. Add the existing checkBlock() signet note to this method so callers do not interpret success as challenge verification.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: Bound transaction payload bytes before IPC deserialization
- [suggestion]: Add a release note for the new mining IPC API
- [suggestion]: Remove the unused Python transaction-weight constant