Skip to content
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

Update from the Bitcoin Core PR #99

Merged
merged 3 commits into from
Feb 18, 2022
Merged

Conversation

darosior
Copy link
Contributor

Based on #90. There are a few invasive refactorings. The rename from NodeType to Fragment can be more easily reviewed with --word-diff.

We are going to add a couple of fuzz target generating random Miniscript
nodes instead.
There are a few invasive changes that were made following review of the
first Bitcoin Core PR:
- Renaming NodeType to Fragment
- Refactoring various switchs for better readability
- Refactoring DecodeScript to use less long lines for parsing of hash
  fragments
@@ -937,6 +974,22 @@ struct Node {
//! Return the expression type.
Type GetType() const { return typ; }

//! Find the deepest insane sub. Null if there is none.
NodeRef<Key> FindInsaneSub() const {
Copy link
Owner

@sipa sipa Feb 18, 2022

Choose a reason for hiding this comment

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

What is this for (no objection to having it, just wondering)

@darosior
Copy link
Contributor Author

darosior commented Feb 18, 2022 via email

@sipa
Copy link
Owner

sipa commented Feb 18, 2022

ACK 55f2ede. I have a few nits, but I'll open a PR to address those afterwards.

@sipa sipa merged commit 948aeec into sipa:master Feb 18, 2022
sipa added a commit that referenced this pull request Feb 18, 2022
… strict binary encoding

6b37a0c qa: add a fuzz target generating random nodes from a binary encoding (Antoine Poinsot)

Pull request description:

  Based on #99 .

  This is the "dumb" version of the Miniscript node generation from fuzzer
  input. It defines a strict binary encoding and will always generate a
  node defined from the encoding without "helping" to create valid nodes.
  It will cut through as soon as it encounters an invalid fragment so
  hopefully the fuzzer can tend to learn the encoding and generate valid
  nodes with a higher probability.

  On a valid generated node a number of invariants are checked, especially
   around the satisfactions and testing them against the Script
   interpreter.

ACKs for top commit:
  sipa:
    ACK 6b37a0c

Tree-SHA512: 90afd2eff241014daab801966dd83496a5dcf634b9c9b314c238f5b517a17a90af0349d5f505dabf82f4718c1ca19753e9de88b834d8e9518a7497d1a5c6d08e
sipa added a commit that referenced this pull request Feb 21, 2022
827ed1b Remove leftover types set (Pieter Wuille)
b18669a More auto types (Pieter Wuille)
328fabd Remove redundent ComputeScriptLen expression (Pieter Wuille)
492fced Simplify FindInsaneSub (Pieter Wuille)
5fc20e9 Rename s/NodeType/Fragment/ in compiler (Pieter Wuille)
a516e1a Improvements for ParseKey / ParseHexStr (Pieter Wuille)

Pull request description:

Top commit has no ACKs.

Tree-SHA512: 41e3a31a2de9df4bb1055c796d6c54a32646b4b7bc54df175a4beaf41298890810fe35d53f645017af11068139d4b6cbf0bee25b67dfbb9d3882f0e4288a1835
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.

2 participants