#36128 test: add script_tests cases covering more interpreter mutants

full analysis

https://github.com/bitcoin/bitcoin/pull/36128 · ViniciusCestarii · +34/-0 in 2 files, 3 commits · labels: Tests

Goal

  • Pin consensus script interpreter edge cases uncovered by mutation testing
  • Prevents undetected regressions in Tapscript and P2WSH execution

Adds three test cases to script_tests.json and registers the SCRIPT_ERR_TAPSCRIPT_MINIMALIF error string in script_tests.cpp. These test cases cover consensus edge cases in the script interpreter identified via mutation testing: Tapscript minimal-IF with a 1-byte vector of 0x00, P2WSH trailing byte mismatches, and the MAX_OPS_PER_SCRIPT limit in P2WSH witness scripts.

Problem: Mutation testing against src/script/interpreter.cpp revealed subtle consensus branches that were not pinned by existing script unit test vectors, allowing specific logic alterations to pass testing undetected.

Category: Test infrastructure (#17 of 45)

P3 · test coverage

  • P3 because it hardens consensus-critical script interpreter code against regressions
  • Pins three surviving mutants, though routine and deferrable

It improves unit test coverage on consensus-critical script interpreter code by killing three surviving mutants. Adding regression tests for specific consensus code paths is worthwhile maintenance, though reasonably deferrable.

Membership: Adds unit test cases to script_tests.json and updates test harness error mappings in script_tests.cpp

Factors: security/stability 1, bug 0, performance 0, user value 0, leverage 1

Reviewability: Ready

  • Ready to review
  • Small and self-contained test addition with passing CI

The PR is small, self-contained, passes CI, and has no pending reviewer questions or blocking feedback.

Author status: active

Agreement: Positive

  • Smooth review with no objections raised
  • Approval with no concerns noted (sedited)

Positive: ACK from sedited with no objections raised

The PR has received an approval from a contributor without any pushback or unresolved concerns.

  • sedited approved the PR (ACK 44a7083d43)

Review verdicts (DrahtBot): 1

Files

34 lines under test/bench/ci.

  • src/test/data/script_tests.json +33/-0
  • src/test/script_tests.cpp +1/-0

Card

Adds three script_tests cases covering consensus edge cases in the interpreter identified via mutation testing. The tests exercise Tapscript minimal-IF handling with a 0x00 byte, P2WSH hash comparison boundaries, and witness v0 opcode limits. It improves regression safety on critical consensus code without altering production behavior. The PR has an ACK from sedited with no objections.

Data

dossier JSON · extract JSON · model openrouter/google/gemini-3.8-flash, generated 2026-09-17T15:57, confidence high, input hash 2e3ef838b38a41f1