Repository navigation
Conversation
… expected error The tapscript/disabled_checkmultisig(verify) failure cases run OP_CHECKMULTISIG(VERIFY) on a Schnorr signature. An implementation which does not disable the opcodes in tapscript still fails them, because a Schnorr signature is not a valid DER signature, so these cases cannot tell whether the opcodes are disabled. Add a 0-of-0 variant, which succeeds when the opcode is executed, so that only the tapscript rule can make it fail. Also write the expected script error of a failure case to the JSON dump when the spender declares one, and check it in script_assets_test under exactly the listed flags. The failure cases could so far only be checked for failing, not for failing for the right reason. Consumers which do not know the new field are unaffected.
Contributor
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process. ConflictsReviewers, 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. |
Member
|
cc @instagibbs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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).