Review report

core: PR #36466

1 minor finding · 2 suggestions

Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.

Findings

Link

[minor] · Signature-less Taproot annexes permit third-party inflation

For opted-in transactions spending a signature-less tapscript leaf, a relayer can race a larger, lower-feerate, same-txid variant into mempools, subject to admission limits.

Location: src/policy/policy.cpp:338 (head).

Details and suggested fix

An opted-in transaction must carry an annex on every non-P2A input, including a signature-less tapscript leaf such as OP_TRUE. The interpreter removes the annex before script execution, and other inputs' signatures do not commit to it. A relayer can therefore substitute 0x50 0x00 || payload without changing the txid, annex count, fee or existing signatures. Unlike base policy, head accepts this variant when it stays within the transaction-weight, minimum-feerate, cluster and applicable TRUC limits. A node that accepts it first rejects the smaller original as txn-same-nonwitness-data-in-mempool while that entry remains; honest-first nodes reject the inflated variant instead. The extra weight lowers the feerate and can raise the CPFP fee needed to reach a target package feerate.

Restrict annex relay to inputs that validate at least one Schnorr signature, enforced with a policy-only check. This deliberately excludes signature-less script paths while retaining signed script paths and key paths. Update the participant-only threat description and add a valid mixed-input mutation test. No current producer of opted-in transactions spending signature-less leaves was found; the in-tree signer supports only annex-less signing, so production impact remains unconfirmed.


Optional improvements

Link

[suggestion] · Annex relay-policy change has no release note

This PR changes default annex relay policy but includes no release note for the accepted encodings and transaction-wide opt-in rule.

Location: src/policy/policy.cpp:333 (head).

Details and suggested fix

IsWitnessStandard now permits marker-only 0x50 and 0x50 0x00 ... annexes, and MemPoolAccept::PreChecks applies this to default mempool admission. Add a PR-specific doc/release-notes-<PR number>.md, as requested by doc/developer-notes.md:1294-1303. Cover the accepted encodings, the all-non-P2A opt-in rule, native P2A's empty-witness requirement, and the absence of a per-annex cap under the existing transaction weight limit. State that consensus and witness replacement remain unchanged, opted-in participants can still inflate annexes, and older nodes enforcing the previous standardness rules will not relay these transactions.


Link

[suggestion] · Anchor-stuffing test initializes the same witness twice

The pre-loop assignment to input 0's witness is overwritten before any assertion, so it adds redundant setup to the unit test.

Location: src/test/transaction_tests.cpp:1364 (head).

Details and suggested fix

Input 1's intervening assignment does not read input 0, and the {false, true} loop sets input 0's witness to {signature} before every check. Delete the pre-loop assignment at this line. Keep the separate reset after the loop, which prepares the subsequent weight-boundary cases.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.