test: cover Taproot standardness rules in mempool_accept #35882

pull jeanpablojp wants to merge 1 commits into bitcoin:master from jeanpablojp:test-taproot-standardness changing 1 files +24 −0
  1. jeanpablojp commented at 2:06 PM on August 4, 2026: contributor

    IsWitnessStandard has three policy rules for Taproot spends: annexes are nonstandard, tapscript stack items are limited to 80 bytes, and an empty control block is rejected. No test ties bad-witness-nonstandard to any of them. Every existing assertion of that reject reason is for another output type. feature_taproot.py does exercise annexes and oversized stack items, but it checks standardness with assert_raises_rpc_error(-26, None, ...), so it never asserts which rule rejected the spend.

    This adds a case per rule to mempool_accept.py. The file already builds a P2TR script-path spend, so each case only mutates its witness stack; the oversized item is one byte over the limit.

    To check that each case hits the rule it claims to cover, I disabled the three branches in policy.cpp one at a time: each case fails with its branch disabled and passes with it restored.

  2. test: cover Taproot standardness rules in mempool_accept 734f5c7442
  3. DrahtBot added the label Tests on Aug 4, 2026
  4. DrahtBot commented at 2:07 PM on August 4, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35882.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-08-31 17:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me