Skip to content

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

Merged
merged 2 commits into from
Mar 17, 2022
Merged

Conversation

sanket1729
Copy link
Member

Support for multi_a interpreter. Required for interpreter check finalizer.

Support for multi_a descriptor. Upcoming integration test PR will add
tests for these
Copy link
Contributor

@dr-orlovsky dr-orlovsky left a 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])
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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

Copy link
Member Author

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

dr-orlovsky
dr-orlovsky previously approved these changes Mar 14, 2022
Copy link
Contributor

@dr-orlovsky dr-orlovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK d30d8c6

Copy link
Contributor

@dr-orlovsky dr-orlovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 251921e

Copy link
Member

@apoelstra apoelstra left a 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.

@sanket1729 sanket1729 merged commit bc2d097 into rust-bitcoin:master Mar 17, 2022
sanket1729 added a commit that referenced this pull request Mar 21, 2022
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
sanket1729 added a commit to sanket1729/elements-miniscript that referenced this pull request May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants