mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:26:38 +00:00
test: strengthen the tapscript CHECKMULTISIG asset tests and dump the expected error #36699
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36699
Loading…
Reference in a new issue
No description provided.
Delete branch "taproot-test-disabled-checkmultisig"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
tapscript/disabled_checkmultisigandtapscript/disabled_checkmultisigverifyspenders infeature_taproot.pyrunOP_CHECKMULTISIG(VERIFY)on a Schnorr signature (0 OP_SWAP 1 <pubkey> 1 OP_CHECKMULTISIG). An implementation which forgets to disable these opcodes in tapscript still fails the case, because a 64 byte Schnorr signature is not a valid DER signature. So the asset tests generated from these spenders cannot tell whether the opcodes are disabled. This came up while runningscript_assets_test.jsonagainst a third-party implementation which executedOP_CHECKMULTISIGin tapscript and passed every case.This PR does two things:
Adds a 0-of-0 variant for both opcodes (
OP_DROP 0 0 0 OP_CHECKMULTISIGandOP_DROP 0 0 0 OP_CHECKMULTISIGVERIFY 1). It needs no signature and leaves a single1on the stack, so it succeeds when the opcode is executed and fails only because of the tapscript rule. Checked against the implementation above: it accepts the new failure case while its fixed version rejects it withSCRIPT_ERR_TAPSCRIPT_CHECKMULTISIG.Writes the expected script error of a failure case into the JSON dump (
"error"), taken from theerr_msgthe spender already declares and whichblock_submitalready checks against the node.script_assets_testthen checks the error under exactly the listed flags. Until now a failure case could only be checked for failing, not for failing for the stated reason. A superset of the flags may fail earlier for another reason, so the check is limited to the exact flag set. Consumers which do not know the field are unaffected, and spenders withouterr_msgget no field.Verified by running
feature_taproot.py --dumptestsandtest_bitcoin --run_test=script_assets_testson the regenerated dump (2897 vectors, 2410 of them with anerrorfield).The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
A summary of reviews will appear here.
Conflicts
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
🔵 Suggestion · The asset minimizer can discard the new 0-of-0 CHECKMULTISIG vectors
Because the minimizer distinguishes vectors by interpreter coverage rather than the new
errorfield, pass/fail-only consumers may not receive t37/t38 after regeneration.Location:
test/functional/feature_taproot.py:1056(head).Design and approach
The 0-of-0 vectors close a real gap by detecting when CHECKMULTISIG executes, but the new exact error-text assertion makes Core CI depend on an externally maintained qa-assets file that cannot be updated atomically with Core. Rework the check so ScriptError changes do not block Core CI, or split the error field into a separate change that specifies how such reclassifications will be handled. qa-assets PR #33961
Review coverage was incomplete.
Reviewed:
420decb1701b· Full review report · Previous reportscc @instagibbs