#35882 test: cover Taproot standardness rules in mempool_accept
https://github.com/bitcoin/bitcoin/pull/35882 · · +24/-0 in 1 files, 1 commits · labels: Tests
Goal
- Assert exact reject reasons for nonstandard Taproot witness spends in mempool acceptance tests
- Ensures transactions fail specifically with bad witness nonstandardness instead of generic RPC errors
This PR adds test cases to `test/functional/mempool_accept.py` covering three Taproot standardness rules in `IsWitnessStandard`. Specifically, it checks that spends with an annex, tapscript stack items over 80 bytes, and empty control blocks are rejected with the `bad-witness-nonstandard` error string.
Problem: While `IsWitnessStandard` rejects transactions violating Taproot policy rules, existing functional tests did not assert the specific `bad-witness-nonstandard` reject reason for these Taproot cases, making regressions harder to catch.
Category: Mempool and policy (#9 of 10)
P3 · test coverage
- P4 because it narrowly fills an assertion gap for already-enforced Taproot policy rules
- Taproot standardness is already tested elsewhere and this change only pins the exact reject string
Worthwhile test coverage for standardness validation rules. As the author notes, 'Every existing assertion of that reject reason is for another output type', leaving Taproot-specific standardness rejections without explicit rejection-reason coverage.
Membership: Tests standardness and mempool acceptance policy rules in test/functional/mempool_accept.py.
Factors: security/stability 0, bug 0, performance 0, user value 0, leverage 1
Reviewability: Ready
- Ready for review
- Small self-contained test addition with passing CI
The patch is small, cleanly separated, passes CI, and has no open blockers or rebase requirements.
Author status: active
Agreement: Crickets
- No reviews or comments yet
Crickets; no reviews or discussion yet.
No reviewer has commented on the pull request yet.
Objections: none enumerated.
State derived from the lists: no substantive comment either way
Review verdicts (DrahtBot): 0
Files
24 lines under test/bench/ci.
- test/functional/mempool_accept.py +24/-0
Card
Adds functional test cases to test/functional/mempool_accept.py covering three Taproot standardness rules in IsWitnessStandard: spending with an annex, tapscript stack items exceeding 80 bytes, and empty control blocks. These cases specifically verify the bad-witness-nonstandard rejection reason, filling a gap in standardness coverage. The change is small, self-contained, and currently has no reviewer activity.