-
Notifications
You must be signed in to change notification settings - Fork 155
MultiA interpreter #308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MultiA interpreter #308
Conversation
Support for multi_a descriptor. Upcoming integration test PR will add tests for these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question
// push 1 on satisfied sigs and push 0 on empty sigs | ||
match self | ||
.stack | ||
.evaluate_pk(&mut self.verify_sig, &subs[node_state.n_evaluated]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't subs[node_state.n_evaluated]
panic if the number of the provided signatures is less than k?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
n_evaluated
denotes the numbers of sub-expressions evaluated, not the number of sigs. The number of expressions evaluated must be less than subs.len() because we add +1 whenever we evaluate one sub-expression.
Inside evalute_pk
, there is a check that checks if we have one sig for a given pk. This will correctly error if given sigs is less than the number of keys.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some distant future a test for that will be nice to have :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add in this one. Should be a couple mins of work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK d30d8c6
d30d8c6
to
3114ec4
Compare
3114ec4
to
251921e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 251921e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 251921e
Sorry for the delay -- I assumed this PR would be much bigger than it was.
13c4746 Update CI to test on 22.0 instead of 0.21 (sanket1729) 51126d3 Add taproot tests (sanket1729) c25fc05 Add descriptor integration tests (sanket1729) ae3c98e Move only: Rework Integration Test and makes things more modular (sanket1729) Pull request description: This is the final PR testing of many of the new features in the taproot miniscript release. This defines a new template language for checking all the Psbt APIs (and thereby all the miniscript ones). ```rust // K : Compressed key available // K!: Compressed key with corresponding secret key unknown // X: X-only key available // X!: X-only key with corresponding secret key unknown // Test 1: Simple spend with internal key let wit = test_desc::test_desc_satisfy(cl, testdata, "tr(X)"); assert!(wit.len() == 1); ``` Right now, it does not test error cases, but I plan to update this framework so that we can also test those. Based on #308 and #310 ACKs for top commit: apoelstra: ACK 13c4746 Tree-SHA512: ce39c9b0242460e70f79c57843c69be36de045da6bcc686306a324c7fe58b70a5fe45e858c266a1f816f4e7f8aaf570fb42f64e543de86e2d786e1fa3fa0beb4
bc2d097 Merge rust-bitcoin/rust-miniscript#308: MultiA interpreter
Support for multi_a interpreter. Required for interpreter check finalizer.