#33973 test: Improve STRICTENC/DERSIG unit tests in script_tests.json
https://github.com/bitcoin/bitcoin/pull/33973 · · +48/-9 in 1 files, 1 commits · labels: Tests · draft
Goal
- Verify consensus-enforced signature encoding rules independently from standardness policy rules
- Add negative test cases and clearer documentation for script verification test vectors
This PR modifies `src/test/data/script_tests.json` to verify signature encoding against the `DERSIG` flag rather than solely relying on `STRICTENC`. Because `STRICTENC` is a standardness policy flag while `DERSIG` is enforced by consensus, the PR ensures consensus rules are tested independently. It also adds negative test cases and clarifying descriptions to the `CHECKMULTISIG NOT` tests.
Problem: In `script_tests.json`, signature encoding was tested under `STRICTENC`, which enforces rules that are a superset of the consensus-enforced `DERSIG` rules. This made it harder to verify that the consensus flag works as intended on its own, and existing `CHECKMULTISIG NOT` tests lacked clear negative cases and explanatory documentation.
Category: Test infrastructure (#22 of 45)
P3 · test coverage
- P3 because testing consensus rules independently from policy rules improves verification granularity
- Adds useful edge-case coverage to test vectors without fixing an active bug or unblocking broader work
P3 because separating testing of the consensus DERSIG flag from policy flags improves test granularity for script verification, as darosior noted ('Makes sense to test DERSIG separately from STRICTENC since it's the only one enabled by consensus'). The changes add useful edge-case coverage and documentation to test vectors without fixing an active bug or unblocking broader work.
Membership: Touches src/test/data/script_tests.json to update script evaluation unit test cases and carries the Tests label.
Factors: security/stability 0, bug 0, performance 0, user value 0, leverage 0
Reviewability: Stale: Author silent
- Stale because the author has been silent for months with the pull request left in draft status
The author addressed initial review feedback in December 2025 but has been silent for 279 days with the PR left in draft status.
Author status: silent since 2025-12-12 after addressing reviewer feedback
Resolved concerns:
- darosior recommended keeping existing STRICTENC test cases instead of replacing them to preserve coverage, which the author implemented before going silent.
Agreement: Strong
- Concept and approach approval to test consensus rules separately from standardness policy (darosior)
- Retained existing policy tests to preserve coverage per review feedback (darosior)
Strong: darosior Concept/Approach ACKs separating consensus DERSIG testing from STRICTENC
darosior explicitly supported the concept and approach of testing DERSIG independently from STRICTENC. All feedback regarding test coverage retention was addressed by the author.
- darosior: 'Makes sense to test DERSIG separately from STRICTENC since it's the only one enabled by consensus. Concept/Approach ACK.'
- darosior: recommended keeping existing STRICTENC cases rather than removing them; author re-added them in the next push.
Review verdicts (DrahtBot): 0
- Approach ACK: darosior
Files
File list not available for this run.
Uncertainties
- The PR remains marked as draft despite the author addressing feedback and asking for CI.
Card
This PR updates script_tests.json to test the DERSIG signature encoding flag separately from the STRICTENC policy flag and adds negative test cases for CHECKMULTISIG NOT. Separating these tests ensures that consensus encoding rules are tested independently from standardness policy, improving test precision for script evaluation. darosior supported the concept and approach, and the author addressed feedback to retain STRICTENC test coverage alongside the new cases. The PR is technically ready but has been left in draft and inactive for over nine months, making it stale.