Skip to content

Conversation

darosior
Copy link
Contributor

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.

darosior and others added 4 commits February 18, 2022 14:48
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
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.

Co-Authored-By: Pieter Wuille <[email protected]>
who made (a previous version of) this non-recursive.
@darosior darosior mentioned this pull request Feb 18, 2022
4 tasks
@darosior
Copy link
Contributor Author

A first review happened there: darosior/bitcoin@f003bba. This fixes most of the comment but the one regarding provider.ConsumeIntegralInRange, about which i left some questions.

@sipa
Copy link
Owner

sipa commented Feb 18, 2022

ACK 6b37a0c

@sipa sipa merged commit 4dd2473 into sipa:master Feb 18, 2022
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
@darosior darosior deleted the miniscript_random branch April 14, 2022 10:27
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