rust-bitcoin / rust-bitcoin/rust-miniscript
`roundtrip_descriptor` test fails with `c:pk_h`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 426
- Forks
- 200
- Avg merge
- 7d 17h
- Merged PRs (30d)
- 8
Description
I get
---- tests::test stdout ----
thread 'tests::test' panicked at 'assertion failed: `(left == right)`
left: `[B/nduesm]c:[K/nduesm]pk_h(DummyKey)`,
right: `pkh(DummyKey)`', fuzz_targets/roundtrip_descriptor.rs:14:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
This fuzz test parses a string as a descriptor, serializes this as a string, then re-parses. What's happening is that we parse c:pk_h as a bare descriptor, re-serialize it as pkh, then parse this as a PkH descriptor.
This may be a bug in our normalization logic, or just a bug in the fuzztest, I can't decide.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with fuzz_targets/roundtrip_descriptor.rs and reproduce the assertion for c:pk_h and pkh(DummyKey). Trace how parsing and serialization handle the two forms, then determine whether normalization or the fuzz-test expectation is wrong and rerun the roundtrip test to verify the chosen behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cryptography, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100