Check minimal push encoding only when executed - #20
Open
adrienlacombe wants to merge 1 commit into
Open
adrienlacombe wants to merge 1 commit into
adrienlacombe wants to merge 1 commit into
Conversation
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.
require_minimal=truecurrently rejects nonminimal pushes while constructing the executor, including pushes in skipped branches. For example,OP_0 OP_IF <nonminimal push of 1> OP_ENDIF OP_TRUEshould succeed with minimal-data policy enabled, but returnsInvalidScript(NonMinimalPush).Parse script syntax independently of policy, then check minimal push encoding only when the push executes. Executed nonminimal pushes now return
ExecError::MinimalDatabefore changing the stack. The check reuses rust-bitcoin's instruction decoder; numeric minimality, tapscript MINIMALIF, default options, and the preceding 520-byte push check remain intact. This follows Bitcoin Core v30.3's executed-push check.Validation: seven grouped regressions cover executed and skipped pushes (including nested conditionals and ELSE), minimal encoding boundaries, malformed syntax, numeric minimality, tapscript MINIMALIF, and oversized-push error precedence. Applicable cases run in Legacy, SegwitV0, and Tapscript contexts with both
require_minimalvalues. Againstba96bc2, 3 groups passed and 4 failed; after the fix,cargo test --locked --all-features -- --skip fields::passes all 19 tests (11 existing unit, 7 regression, 1 documentation). Cargo.lock was retained locally for reproducibility, following the repository's existing ignore rule.Independent of related resource-limit #18 and stack-index #19.