Repository navigation
Conversation
mukeshsp
force-pushed
the
mukesh/CSHLD-2226-bound-satisfaction
branch
from
November 11, 2026 12:02
413cd64 to
df783f7
Compare
Author
|
CI status after
Happy to split the |
Compute satisfaction and dissatisfaction in post-order and reuse child outcomes, preventing nested branches from consuming exponential CPU. Check context resource limits before satisfaction and template building to reject invalid untrusted descriptors and PSBT scripts early. Cover nested branch complexity, resource boundaries, descriptor plans, and signed PSBT finalization. Document the stricter resource checks. Ticket: CSHLD-2226 Signed-off-by: Mukesh Mahadev Prajapati <mukeshmahadev@bitgo.com>
mukeshsp
force-pushed
the
mukesh/CSHLD-2226-bound-satisfaction
branch
from
November 11, 2026 13:07
df783f7 to
6c068f5
Compare
Author
|
Update after
Full test matrix passed on the previous commit ( |
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.
What
Why
Nested, well-typed scripts can otherwise make descriptor planning or PSBT finalization consume exponential CPU: a ~28-level
or_b(u:t:v:X, s:pk)chain (sane, non-malleable, within Segwitv0 limits) costs ~5e9 allocating helper calls, andwsh()/tr()forms admit 82–100 levels that never return. Independent resource checks reject invalid untrusted scripts before provider queries.Test plan
cargo test -p miniscript --all-features— 158 unit tests, 5 integration tests, 7 doc tests (2 ignored) passed.cargo check -p miniscript --no-default-featurespassed.or_b/or_d/andor/threshnormal and malleable planning regression: one availability query per key occurrence, 0.05–0.07 s combined.Ticket: CSHLD-2226
https://linear.app/bitgo/issue/CSHLD-2226/rust-miniscript-satisfier-recursion-is-exponential-in-nesting-depth-or