Uh oh!
There was an error while loading. Please reload this page.
fix(compile): compile only for the requested script context - #317
Open
vadim-anfv wants to merge 1 commit into
Open
fix(compile): compile only for the requested script context#317vadim-anfv wants to merge 1 commit into
vadim-anfv wants to merge 1 commit into
Conversation
Compiling for all three contexts let the narrowest one reject a policy that is valid for the requested type: a 9-of-16 multisig, fine as taproot multi_a, failed even for --type tr because legacy hit the 520-byte consensus limit on script elements.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## master #317 +/- ##
==========================================
+ Coverage 57.45% 57.75% +0.30%
==========================================
Files 22 22 Lines 3695 3686 -9 ==========================================
+ Hits 2123 2129 +6 + Misses 1572 1557 -15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 freeto 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 policy is compiled for all three script contexts one after another, before
--typeis looked at, and any of those failing aborts the command. So a policy that is valid for the type you asked for is rejected because it is invalid for one of the other two.Here a 9-of-16 multisig is compiled with
--type trand fails on the legacy context:CHECKMULTISIGtakes at most 15 keys, and what the compiler falls back to goes pastMAX_SCRIPT_ELEMENT_SIZE, the 520-byte consensus limit. Taproot has no such limit.The fix moves the compilation into the matching branch, so only the requested context is compiled.
Changelog notice
compilerejecting policies that are valid for the requested script typeChecklists
All Submissions:
cargo fmtandcargo clippybefore committingBugfixes: