Skip to content

Conversation

darosior
Copy link
Member

@darosior darosior commented Jul 4, 2022

No description provided.

@maflcko
Copy link
Contributor

maflcko commented Jul 4, 2022

There is already basic coverage: https://github.com/bitcoin-core/qa-assets/tree/main/fuzz_seed_corpus/descriptor_parse

So I presume you are extending it?

@darosior
Copy link
Member Author

darosior commented Jul 4, 2022

Hmm, i'm not so good at english. What i meant here was to add initial coverage for miniscript descriptors, but yeah, it is extending the descriptors coverage with new inputs (those that contain miniscripts inside).

@darosior darosior changed the title descriptor_parse: base miniscript coverage descriptor_parse: extend coverage with Miniscript Descriptors inputs Jul 4, 2022
@maflcko
Copy link
Contributor

maflcko commented Jul 4, 2022

Oh, I see. So this is exclusively adding inputs with miniscript coverage after bitcoin/bitcoin#24148 is merged?

@darosior
Copy link
Member Author

darosior commented Jul 4, 2022

Yes. I initially seeded a folder with Miniscript descriptors and ran the fuzzer on it for a while. This is the minified version of the resulted folder.

achow101 added a commit to bitcoin-core/gui that referenced this pull request Jul 14, 2022
ffc79b8 qa: functional test Miniscript watchonly support (Antoine Poinsot)
bfb0367 Miniscript support in output descriptors (Antoine Poinsot)
4a08288 qa: better error reporting on descriptor parsing error (Antoine Poinsot)
d25d58b miniscript: add a helper to find the first insane sub with no child (Antoine Poinsot)
c38c7c5 miniscript: don't check for top level validity at parsing time (Antoine Poinsot)

Pull request description:

  This adds Miniscript support for Output Descriptors without any signing logic (yet). See the OP of #24147 for a description of Miniscript and a rationale of having it in Bitcoin Core.
  On its own, this PR adds "watchonly" support for Miniscript descriptors in the descriptor wallet. A follow-up adds signing support.

  A minified corpus of Miniscript Descriptors for the `descriptor_parse` fuzz target is available at bitcoin-core/qa-assets#92.
  The Miniscript descriptors used in the unit tests here and in #24149 were cross-tested against the Rust implementation at https://github.com/rust-bitcoin/rust-miniscript.

  This PR contains code and insights from Pieter Wuille.

ACKs for top commit:
  Sjors:
    re-utACK ffc79b8
  achow101:
    ACK ffc79b8
  w0xlt:
    reACK bitcoin/bitcoin@ffc79b8

Tree-SHA512: 02d919d38bb626d3c557eca3680ce71117739fa161b7a92cfdb6c9c432ed88870b1ed127ba24248574c40c7428217d7e9bdd986fd8cd7c51fae8c776e1271fb9
@darosior
Copy link
Member Author

Added some more seeds i've been generating in the background the past week(s). As a commit since it's not specific to Miniscript descriptors, it's extending the whole descriptor_parse corpus.

Marking as ready now that bitcoin/bitcoin#24148 is merged (:tada:).

@darosior darosior marked this pull request as ready for review July 15, 2022 12:00
@darosior
Copy link
Member Author

(I used a rebased bitcoin/bitcoin#25540 to generate and merge those.)

@maflcko
Copy link
Contributor

maflcko commented Jul 15, 2022

pubkey.cpp:368:18: runtime error: implicit conversion from type 'int' of value 256 (32-bit, signed) to type 'unsigned char' changed the value to 0 (8-bit, unsigned)

@darosior
Copy link
Member Author

How did you trigger this? I couldn't reproduce with --with-sanitizers=fuzzer,undefined running

FUZZ=descriptor_parse ./src/test/fuzz/fuzz ../qa-assets/fuzz_seed_corpus/descriptor_parse -runs=0

on 088e5b0b9317bd1d7c9755fb839b7326d99bc910 (bitcoin/bitcoin#25540 tip).

sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jul 18, 2022
ffc79b8 qa: functional test Miniscript watchonly support (Antoine Poinsot)
bfb0367 Miniscript support in output descriptors (Antoine Poinsot)
4a08288 qa: better error reporting on descriptor parsing error (Antoine Poinsot)
d25d58b miniscript: add a helper to find the first insane sub with no child (Antoine Poinsot)
c38c7c5 miniscript: don't check for top level validity at parsing time (Antoine Poinsot)

Pull request description:

  This adds Miniscript support for Output Descriptors without any signing logic (yet). See the OP of bitcoin#24147 for a description of Miniscript and a rationale of having it in Bitcoin Core.
  On its own, this PR adds "watchonly" support for Miniscript descriptors in the descriptor wallet. A follow-up adds signing support.

  A minified corpus of Miniscript Descriptors for the `descriptor_parse` fuzz target is available at bitcoin-core/qa-assets#92.
  The Miniscript descriptors used in the unit tests here and in bitcoin#24149 were cross-tested against the Rust implementation at https://github.com/rust-bitcoin/rust-miniscript.

  This PR contains code and insights from Pieter Wuille.

ACKs for top commit:
  Sjors:
    re-utACK ffc79b8
  achow101:
    ACK ffc79b8
  w0xlt:
    reACK bitcoin@ffc79b8

Tree-SHA512: 02d919d38bb626d3c557eca3680ce71117739fa161b7a92cfdb6c9c432ed88870b1ed127ba24248574c40c7428217d7e9bdd986fd8cd7c51fae8c776e1271fb9
@maflcko
Copy link
Contributor

maflcko commented Jul 19, 2022

It needs the integer sanitizer, which is not the UB sanitizer. 😅

The input that triggers this is ./4a30defd5a644721859db1781153d0fb34decd94.

@darosior
Copy link
Member Author

Err, right.. 😅
I've opened a PR fixing the wrap-around: bitcoin/bitcoin#25642.

@maflcko
Copy link
Contributor

maflcko commented Aug 11, 2022

Now it times out due to the timeout issue

@darosior
Copy link
Member Author

Yes, we need bitcoin/bitcoin#25540 in first

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