2 minor findings · 4 suggestions
Earlier concerns neither republished nor resolved: 1 minor finding · 1 suggestion. See the Run archive for their assessments.
Findings
[minor] · Future-leaf test vector reuses the Tapscript witness
The test and exported vector labelled as a future-tapleaf spend duplicate the preceding Tapscript spend, leaving the future-leaf case untested.
Location: src/test/bip54_tests.cpp:1060 (head).
Details and suggested fix
The first SignSignature call leaves sigdata.complete set. Clearing the keystore and reassigning tr_spenddata does not reset it, so the second call returns immediately and UpdateInput copies the unchanged Tapscript witness into tx_copy2. The following verification and BIP54 checks therefore record the previous transaction under the future-leaf description. Resetting sigdata alone would not work because SignTaprootScript rejects leaf versions other than TAPROOT_LEAF_TAPSCRIPT. Build the witness by hand with the stack items, leaf_script_future, and its control block from builder.GetSpendData().scripts. Assert that the control block's leaf version is 0xc2 before recording the vector.
[minor] · BIP54 sigops rejections no longer cache the txid
When a witness-carrying parent is rejected for BIP54 sigops, later children are kept as orphans and the parent can be re-fetched by txid; this affects relay efficiency, not consensus.
Location: src/consensus/tx_verify.cpp:205 (head).
Details and suggested fix
Previously, ValidateInputsStandardness reported a BIP54 sigops violation as TX_INPUTS_NOT_STANDARD. CheckTxInputs now reports it as TX_CONSENSUS (bad-txns-legacy-sigops), and PreChecks enables the check on every network. For witness-carrying transactions, MempoolRejectedTx caches the txid and forgets txid requests only for TX_INPUTS_NOT_STANDARD, because that failure cannot depend on the witness. BIP54 counts only scriptSigs and spent scriptPubKeys, so caching the txid would still be correct, but now only the wtxid is cached. A child that arrives later is therefore kept in the orphanage and triggers a request for the parent by txid, rather than being dropped as having a rejected parent. Txid announcements of the parent are also no longer suppressed. The commit message says the result code no longer drives disconnection or RPC errors, but it still drives this reject-filter decision. Cache the txid for this specific failure, by reject reason or with a dedicated result value, and add a txdownload_tests case. Do not extend txid caching to every TX_CONSENSUS result, since script failures can depend on the witness. This requires a peer to relay a witness-carrying transaction that spends real UTXOs and exceeds 2,500 legacy sigops. No in-tree producer was identified, so how often this occurs in practice is unconfirmed.
Optional improvements
[suggestion] · The Taproot annex vector does not contain an annex
The final witness element starts with 0x42 rather than ANNEX_TAG (0x50), so the vector is a malformed script-path spend, not the advertised key-path spend with an annex.
Location: src/test/bip54_tests.cpp:1559 (head).
Details and suggested fix
The interpreter treats the last witness element as an annex only when its first byte is ANNEX_TAG (0x50). Here the stack is [sig, 4242ffab2121], so it is parsed as a script-path spend, and the six-byte element is rejected as a control block of the wrong size. The 64-byte rejection still holds because stripped size ignores the witness, but the vector does not match its comment or exported description. Change the element's first byte to 0x50, for example to 50 followed by the same five bytes. This makes it a key-path spend with an annex while leaving the size assertions unchanged.
[suggestion] · The 2501-sigop P2SH vector has invalid signatures on its first 25 inputs
Unlike the analogous cases, this exported over-limit vector also fails script validation, so it does not isolate the BIP54 sigops rule.
Location: src/test/bip54_tests.cpp:339 (head).
Details and suggested fix
The 25 P2SH inputs are signed with the default SIGHASH_ALL, and then a P2PK input is appended. The legacy SIGHASH_ALL digest commits to every input's outpoint, so appending an input invalidates those 25 signatures. Only the new input is signed and verified before CheckExceedsBIP54Limits records the vector. The CheckSigopsBIP54 expectation remains correct, but a consumer that runs full script validation on the exported vector will find it invalid for unrelated reasons. The bare-script and 16-of-17 cases re-sign their earlier inputs after appending an input, and the 7-of-10 case uses SIGHASH_ANYONECANPAY for this reason. Re-sign and verify the 25 P2SH inputs after appending the P2PK input.
[suggestion] · No release note covers BIP54's regtest and mempool changes
Regtest getblocktemplate clients, existing regtest data directories, and scripts matching mempool reject reasons can break, and no workaround is documented.
Location: src/kernel/chainparams.cpp:639 (head).
Details and suggested fix
On regtest, the deployment is ALWAYS_ACTIVE and registered with gbt_optional_rule = false. getblocktemplate therefore fails with “Support for 'consensuscleanup' rule requires explicit client support” unless the requested rules include consensuscleanup. The test framework had to add it to NORMAL_GBT_REQUEST_PARAMS. Regtest blocks from older releases whose coinbases do not satisfy the new nLockTime/nSequence rule are now invalid, which is why wallet_migration.py needs -vbparams=consensuscleanup:0:0 for its v28.2 node. An existing data directory holding such blocks retains them across a normal restart or -reindex-chainstate, because ConnectBlock does not rerun the contextual checks. A -reindex, or a freshly syncing upgraded peer, rejects them. Mempool reject reasons also change on every network: BIP54 sigops violations now report bad-txns-legacy-sigops instead of bad-txns-nonstandard-inputs, and -acceptnonstdtxn no longer admits them. Transactions with a 64-byte stripped size now report txn-size-64 instead of tx-size-small. The change updates doc/bips.md but adds no release note. Add a doc/release-notes-<PR>.md covering these changes, including resetting old regtest data or running with -vbparams=consensuscleanup:0:0.
[suggestion] · The Taproot vector generator no longer reproduces the published BIP341 wallet vectors
Changing the block-1 coinbase sequence changes every prevout in the key-path scenario, so generated output diverges from the published BIP341 vectors that the docstring says it reproduces.
Location: test/functional/feature_taproot.py:1668 (head).
Details and suggested fix
To satisfy the new coinbase rule, the block-1 coinbase's nSequence changes from SEQUENCE_FINAL to MAX_SEQUENCE_NONFINAL. The crediting chain uses coinbase.txid_int as lasttxid, so every prevout spent by the final transaction changes. This changes its rawUnsignedTx, hashPrevouts, sigmsgs, sighashes, and signatures. The change updates the pinned coinbase txid and fullySignedTx hash to the new values. With GEN_TEST_VECTORS, the keyPathSpending output therefore no longer matches src/test/data/bip341_wallet_vectors.json or the published BIP341 vectors, despite the docstring saying the scenario corresponds to them. Run this test with -vbparams=consensuscleanup:0:0, as wallet_migration.py and rpc_getblockstats.py already do, and restore the original coinbase and hash pins. The tradeoff is that this file's Taproot spender tests then stop running with BIP54 active. End-to-end BIP54 coverage remains in feature_bip54.py.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [minor]: Clarify whether the first post-activation retarget checks the preceding interval
- [suggestion]: Unused tx_verify include and library move remain after the policy check was removed (earlier report)