3 suggestions
Earlier concerns neither republished nor resolved: 1 minor finding · 2 suggestions. See the Run archive for their assessments.
Optional improvements
[suggestion] · A transaction collection can retain more data than a block can contain
The wtxid-count cap does not limit the total weight of supplied transactions, so a collection can retain many blocks’ worth of data until it is destroyed.
Location: src/node/tx_collection.cpp:97 (head).
Details and suggested fix
The constructor caps the number of requested wtxids, but AddMissingTxs() stores any deserializable transaction whose wtxid was requested without checking its weight or the collection’s running total. Across one or more calls, the stored transactions can exceed MAX_BLOCK_WEIGHT by many times. MakeTemplate() eventually rejects the set with bad-blk-weight, but leaves m_transactions unchanged, retaining the transaction references until the collection is destroyed.
Track the cumulative weight of filled entries, including constructor matches, and reject a batch atomically if its new entries would push the total above MAX_BLOCK_WEIGHT. Such a set cannot form a valid block, so this preserves useful resubmissions while bounding per-collection memory. It does not limit peak memory while IPC deserializes a request. The IPC client already has RPC-level access, so practical impact depends on whether a JDS forwards miner-supplied transactions without its own size budget.
[suggestion] · A null-coinbase template can approve transactions that do not fit with the real coinbase
The dummy coinbase is minimal, so a successful check does not guarantee that the caller’s coinbase will fit within the block’s weight or sigops limits.
Location: src/interfaces/mining.h:167 (head).
Details and suggested fix
When coinbase is null, MakeTemplate() inserts a node-generated coinbase with a default OP_TRUE output, subsidy-only value, and witness commitment, then passes the block to TestBlockValidity(). Unlike createNewBlock(), this does not reserve weight or sigops for the caller’s real coinbase. A transaction set that fits with the dummy can therefore fail with bad-blk-weight or bad-blk-sigops after the pool substitutes its coinbase, with the failure appearing only at submitSolution().
Document in interfaces/mining.h that a null-coinbase result does not check the real coinbase’s reward, weight, or sigop cost, and that callers needing a mineability guarantee should pass their coinbase. Whether current JDS callers always pass one was not established from this checkout.
[suggestion] · The new test-framework constant and helper parameter are unused
Neither addition is exercised by a caller, so both can drift without affecting functional-test coverage.
Location: test/functional/test_framework/messages.py:40 (head).
Details and suggested fix
No functional test references MIN_TRANSACTION_WEIGHT, and the “too many wtxids” limit is checked only in tx_collection_tests.cpp, not through IPC. Likewise, no caller of tx_collection_make_template() passes its debug argument. Either use these additions or remove them. For example, a functional test could call collectTxs() with MAX_BLOCK_WEIGHT // MIN_TRANSACTION_WEIGHT + 1 wtxids and check for the “too many wtxids” remote exception.
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
- [minor]: Validate supplied signet solutions during template creation
- [suggestion]: Add a release note for the new mining IPC API