1 minor finding · 4 suggestions
Earlier concerns neither republished nor resolved: 5 minor findings · 16 suggestions. See the Run archive for their assessments.
Findings
[minor] · The future-leaf Taproot vector duplicates the preceding Tapscript spend
The future-leaf case in bip54_legacy_sigops repeats the 0xc0 witness, leaving 0xc2 untested and producing a mislabeled duplicate if JSON vectors are exported.
Location: src/test/bip54_tests.cpp:1104 (head).
Details and suggested fix
The preceding successful SignSignature call leaves sigdata.complete set. Changing the keystore and assigning tr_spenddata does not reset it, so ProduceSignature returns immediately and UpdateInput writes back the preceding witness. VerifyTxin consequently verifies the same Tapscript spend, and CheckWithinBIP54Limits records it again. Clearing complete alone is insufficient because SignTaprootScript only supports TAPROOT_LEAF_TAPSCRIPT. Instead, construct scriptWitness.stack = {script, control} directly from the leaf_script_future and future_leaf_version entry in builder.GetSpendData().scripts. Assert (control[0] & TAPROOT_LEAF_MASK) == future_leaf_version before verification. The mandatory flags used here accept a correctly committed unknown leaf without executing its script. BIP54 ignores witness data, so the expected sigops result stays unchanged, but this supplies the advertised coverage and distinct exported vector. Whether the same correction is needed upstream remains unconfirmed because the original-source mapping is unavailable.
Optional improvements
[suggestion] · Release notes omit BIP54 compatibility changes outside Testnet5
The release notes omit BIP54's regtest, getblocktemplate, and mempool compatibility changes; default mainnet mempool acceptance is unchanged.
Location: src/kernel/chainparams.cpp:745 (head).
Details and suggested fix
doc/release-notes-testnet5.md announces only the new network. Regtest now enables consensuscleanup by default, requiring coinbase nLockTime = height - 1 and non-final nSequence above height zero. On regtest and Testnet5, getblocktemplate also requires consensuscleanup in rules, so existing {"rules": ["segwit"]} requests, including the documented example, are insufficient. Mempool admission now enforces the sigops limit even with -acceptnonstdtxn=1. Its rejection changes from bad-txns-nonstandard-inputs to bad-txns-legacy-sigops, and exactly-64-byte witness-stripped transactions change from tx-size-small to txn-size-64.
Add a 32.x compatibility entry covering these changes, and update the GBT example and applicable error guidance. If documenting -vbparams=consensuscleanup:0:0 for legacy fixtures, do not describe it as a permanent off switch: the deployment enters STARTED and can still lock in when the signalling threshold is reached before the timeout check.
[suggestion] · BIP54 sigops rejections lose witness-independent txid caching
Changing the BIP54 sigops failure from TX_INPUTS_NOT_STANDARD to TX_CONSENSUS can cause redundant parent downloads and retained orphans for witness transactions instead of immediately rejecting their children.
Location: src/consensus/tx_verify.cpp:205 (head).
Details and suggested fix
With standardness enabled, the base reported this failure as TX_INPUTS_NOT_STANDARD, causing MempoolRejectedTx to cache both the wtxid and txid. The new result caches only the wtxid, although the BIP54 count still depends exclusively on non-witness data and the referenced outputs. A later child therefore misses the rejected-parent check, can enter the orphanage, and triggers a parent request by txid. The existing wtxid filter drops an identical redownload without revalidation; a different witness can still reach validation, and orphan/request limits bound the extra work. Preserve txid insertion specifically for bad-txns-legacy-sigops in MempoolRejectedTx, rather than extending it to all TX_CONSENSUS failures, whose validity may depend on the witness.
[suggestion] · doc/bips.md omits the 32.x backport versions for BIP54 and BIP95
Both new doc/bips.md entries list only v33.0, omitting availability in the intended 32.x backport release, whose exact patch version still needs confirmation.
Location: doc/bips.md:35 (head).
Details and suggested fix
The BIP54 entry says the rules are implemented as of v33.0, and BIP95 says Testnet5 is supported as of v33.0. However, CMakeLists.txt identifies this target as 32.1.0 and doc/release-notes.md contains the v32.1 notes. Confirm the patch release that will ship these changes and record it in both entries, following the existing BIP65 backport wording. The current metadata does not establish that shipping version; v33.0 can remain as the upstream introduction.
[suggestion] · BIP54 reorg reinsertion and descendant cleanup lack coverage
Although reinsertion currently looks correct, tests do not verify that disconnecting a valid pre-activation block rejects its over-limit transaction from the mempool and removes descendants under the now-unconditional BIP54 sigops policy.
Location: src/validation.cpp:894 (head).
Details and suggested fix
ConnectBlock gates the limit on activation, whereas PreChecks enforces it even for bypass_limits=true. feature_bip54.py already accepts an over-limit transaction in the last locked-in block, but never disconnects it. Extend the fixture with -checkmempool=1: confirm an over-limit parent, admit a child and an unrelated transaction, invalidate the parent's block, and assert that the parent and child are absent while the unrelated entry remains. Keep the parent's inputs confirmed and arrange that the BIP54 limit is the only reason reinsertion fails, so another policy rejection cannot mask a skipped check. This exercises both the rejection and MaybeUpdateMempoolForReorg's removeRecursive cleanup.
Backport verdict: Needs clarification
I could not establish that this backport matches the upstream originals. It also has target-branch problems that need fixing or justifying. The packet bundles 29 commits that look like two upstream PRs: the BIP 54 implementation (#35793, 22 commits) and Testnet 5 (#35861, 7 commits). None of the commits has a resolved upstream original, so I could not check fidelity, adaptations or omitted dependencies commit by commit. The head is the 32.x release branch (CMakeLists.txt: version 32.1.0, CLIENT_VERSION_IS_RELEASE true). The PR's stated goal is a patched v32 release, but some user-visible changes are not adapted or documented for a point release. Regtest now always enforces BIP 54. As a result, getblocktemplate rejects any client that does not list the 'consensuscleanup' rule, and blocks whose coinbase lacks the nLockTime/nSequence pattern are rejected. Mempool reject reasons change, the BIP 54 sigops limit can no longer be bypassed with -acceptnonstdtxn, and doc/bips.md says 'v33.0' on a 32.x branch. Nothing I read in the code shows a consensus defect for mainnet, testnet3/4 or signet, where the deployment is NEVER_ACTIVE.
Evidence:
- Provenance: the packet reports 'No resolved Rebased-From provenance', and every commit from 187f50f0 to f57b52ae is listed as untagged. wreck_read_upstream_commit rejects head SHAs such as 5f5fcf3e. Because no upstream original was resolved, I cannot report any individual original commit as missing, intentionally omitted or adapted. The PR description itself says only the top commits belong to #35861 and the rest come from #35793.
- Target branch: CMakeLists.txt sets CLIENT_VERSION_MAJOR 32, MINOR 1, IS_RELEASE true, and doc/release-notes.md is the v32.1 notes. This is a stable-branch backport, not master.
- Testnet 5 parameters at head (src/kernel/chainparams.cpp, CTestNet5Params): powLimit is compact 0x1a0fffff; fPowAllowMinDifficultyBlocks=false; enforce_BIP94=false; CONSENSUSCLEANUP is ALWAYS_ACTIVE on bit 3 with period 2016 and threshold 1512; magic is 0x46495645 ('FIVE'); nDefaultPort is 18353, with chainparamsbase RPC port 18352 and Tor port 18354. A mined genesis is asserted as 00000000000008c1…d497. This matches BIP 95 on removing the exception, the minimum difficulty, BIP 54 from block 1, and the magic.
- Port mismatch: the BIP 95 draft I could read says the default P2P port is 18335, while the code (and the fixed seeds in contrib/seeds/nodes_testnet5.txt) use 18353. That draft is explicitly an earlier version with a placeholder genesis, so this may reflect a later BIP revision, but I could not confirm it.
- Activation tests: src/test/versionbits_tests.cpp has a testnet5_consensuscleanup_activation test asserting BIP 54 is active after genesis only on TESTNET5. src/test/pow_tests.cpp tests the absent minimum-difficulty exception and the 0x1a0fffff limit, and adds ChainParams_TESTNET5_sanity.
- Validation hooks at head (src/validation.cpp): ConnectBlock passes enforce_bip54 from DeploymentActiveAt. ContextualCheckBlockHeader applies the 2h timewarp grace and the Murch-Zawy rule when the deployment is active after pindexPrev. ContextualCheckBlock adds 'bad-txns-size' and 'bad-cb-locktime'/'bad-cb-sequence'. Mempool PreChecks always passes enforce_bip54=true and rejects 64-byte transactions as TX_CONSENSUS 'txn-size-64'.
- Dependencies already on the branch: miner.cpp line 211 sets coinbase nLockTime=nHeight-1, blocktools.create_coinbase sets nLockTime=height-1 with MAX_SEQUENCE_NONFINAL, and GetMinimumTime already accounts for the Murch-Zawy rule. These base search hits mean the earlier BIP 54 preparation is present, consistent with the 29.1/30.0 release-note mentions.
- Regtest breaking change: 187f50f0 makes CONSENSUSCLEANUP ALWAYS_ACTIVE on regtest with gbt_optional_rule=false. In rpc/mining.cpp lines 1016-1021, an active non-optional rule the client did not request throws 'Support for 'consensuscleanup' rule requires explicit client support'. The PR had to change NORMAL_GBT_REQUEST_PARAMS to include 'consensuscleanup', and had to add -vbparams=consensuscleanup:0:0 to feature_block, rpc_getblockstats, wallet_migration and wallet_ancient_migration because externally built blocks are now rejected. External regtest tooling upgrading within 32.x will hit the same failures.
- Policy and RPC changes on all networks: 6622bfae replaces 'bad-txns-nonstandard-inputs' with 'bad-txns-legacy-sigops' (TX_CONSENSUS), and the check can no longer be bypassed with -acceptnonstdtxn. b415126c changes 'tx-size-small' to 'txn-size-64' for 64-byte transactions. mempool_sigoplimit.py and mempool_accept.py were updated to match.
- Release notes and docs: doc/release-notes-testnet5.md covers only the new testnet5 network (#35861). It does not mention BIP 54 being always active on regtest, the getblocktemplate rule requirement, or the mempool reject-reason and policy changes. doc/bips.md says BIP 54 and BIP 95 are supported 'as of v33.0', which is wrong for a 32.x backport. The fragment file follows master's convention; the 32.x release-notes.md has not been updated.
- Leftover TODO: CTestNet5Params contains 'TODO: regenerate, assumes GENESIS_TIME 2026-12-01 …' for m_headers_sync_params, but the actual genesis nTime is 1794632593 (about 2026-11-14). This is low impact on a test network but is an unresolved TODO on a release branch.
- Minor cleanup: SizeSub64 in invalid_txs.py sets expect_disconnect=False. BadTxTemplate no longer has that attribute on this branch, so it does nothing.
- Docs not updated for testnet5: doc/files.md, doc/bitcoin-conf.md, doc/REST-interface.md, share/examples/bitcoin.conf, the man pages and the share/setup.nsi.in shortcuts still list only the older networks. Man pages and the example conf are normally regenerated during release preparation.
Required fixes:
- Provide the resolved upstream commit mapping (Rebased-From) for all 29 commits, covering both #35793 and #35861. Explain each divergence, omission, squash or reordering, so fidelity and completeness can be checked commit by commit.
- Justify, or adapt for 32.x, making BIP 54 ALWAYS_ACTIVE on regtest in a point release. It makes getblocktemplate fail for clients that do not request 'consensuscleanup', and rejects coinbases that do not follow the nLockTime/nSequence pattern. If this is kept, document it explicitly in the 32.x release notes.
- Add release notes for the 32.x release covering: BIP 54 enforcement on regtest (the coinbase nLockTime/nSequence rule, invalid 64-byte transactions, the timewarp and Murch-Zawy rules, and the getblocktemplate 'consensuscleanup' requirement); the mempool reject-reason changes ('bad-txns-legacy-sigops', 'txn-size-64'); and the BIP 54 sigops limit no longer being bypassable with -acceptnonstdtxn. Fold the fragment into doc/release-notes.md following release-branch practice.
- Change the doc/bips.md entries for BIP 54 and BIP 95 so they state the 32.x version that will actually ship these changes, instead of 'v33.0'.
- Confirm that the final BIP 95 specifies P2P port 18353 (the BIP 95 draft I could read says 18335). Then either resolve or explicitly accept the headers-sync-params TODO, which assumes a genesis time of 2026-12-01.
Limitations:
- The packet has no resolved upstream originals, and the upstream tools reject the target SHAs, so I could not do a commit-by-commit fidelity comparison or identify missing or adapted upstream commits.
- Several commit patches in the packet were truncated (6622bfae, 31f89e5a, 1d6b2f6c, 6479f7b0, f99c168c, ef12208c), and the last commits' patches were omitted. I inspected the head-tree diffs instead, but not every line of the large test and data files (bip54_tests.cpp, bip54_timestamps.json, feature_bip54.py).
- The BIP 95 document available was an earlier draft with placeholder genesis parameters, and the BIP 54 document was truncated. I could not verify the final network parameters (port, genesis construction, nVersion 0x2230c000, OP_RETURN genesis output) against the final specification.
- I did not build or run anything, and no runner records were supplied. Nothing here shows that the unit, functional or fuzz tests pass on the target branch.
- I did not fully check whether moving consensus/tx_verify.cpp from bitcoin_node to bitcoin_common causes link-time problems for binaries that link only bitcoin_common.
- Truncated Git evidence: show --format=fuller --no-ext-diff
- Evidence byte budget exhausted
- No resolved Rebased-From provenance
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: Avoid the default RPC and onion-port collision
- [minor]: Gate mempool BIP54 enforcement on activation
- [minor]: The socket cap shortens unlimited CLI receive waits to 24.8 days (earlier report)
- [suggestion]: Chainparams sanity checks miss the placeholder genesis proof of work (earlier report)
- [suggestion]: The Testnet5 release note omits mandatory mining requirements (earlier report)
- [suggestion]: BIP54 enforcement probes skip the activation boundary (earlier report)
- [suggestion]: Per-network documentation and coverage still omit Testnet5 (earlier report)
- [suggestion]: BIP54 sigops fuzzing does not check acceptance results (earlier report)
- [suggestion]: The Tor backoff assertion can reject a correctly timed reconnect (earlier report)
- [suggestion]: An unused tx_verify.h include remains after the BIP54 move (earlier report)
- [minor]: Future-leaf Taproot test repeats the Tapscript spend (earlier report)
- [suggestion]: Testnet5's BIP95 definition is split across introduction and activation (earlier report)
- [suggestion]: Chain-selector tests never enable
-testnet5(earlier report) - [suggestion]: Release note incorrectly says minimum-difficulty blocks are disallowed (earlier report)
- [suggestion]: BIP54 sigops vectors misidentify inputs and boundary totals (earlier report)
- [minor]: Regtest activation changes existing mining clients without a compatibility note (earlier report)
- [minor]: BIP support versions omit the 32.x backport (earlier report)
- [suggestion]: Mempool compatibility changes are absent from release notes (earlier report)
- [suggestion]: Inactive-deployment mempool enforcement lacks coverage (earlier report)
- [suggestion]: BIP54-sigops rejects lose txid caching (earlier report)
- [suggestion]: Mandatory cleanup-rule rejection is not tested (earlier report)