Skip to content

Conversation

@benalleng
Copy link
Collaborator

@benalleng benalleng commented Oct 7, 2025

This adds fuzzing infrastructure for payjoin with the inclusion
of three engine options, cargo-fuzz (libfuzzer-sys), afl++, and honggfuzz. These
two were chosen as they come with seperate tradeoffs in regards to speed
and error handling.

Because these two fuzzers are setup as mutually exclusive fuzzers within
the same target file fuzzing cannot reasonably be built with
--all-features.

In addition honggfuzz and afl are seemingly broken on nix so I don't think it is reasonably
possible at this time to nixify our fuzzing crate.

The readme for reading pleasure https://github.com/benalleng/rust-payjoin/blob/fuzzing/fuzz/README.md

NB The tests that I have written are not guaranteed as good fuzzing targets and that I my hope for the mob coding session on Wednesday 1/14 next week to shore up before this is merge-able

Pull Request Checklist

Please confirm the following before requesting review:

@coveralls
Copy link
Collaborator

coveralls commented Oct 7, 2025

Pull Request Test Coverage Report for Build 20795939240

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 82.909%

Totals Coverage Status
Change from base Build 20717534858: 0.0%
Covered Lines: 9673
Relevant Lines: 11667

💛 - Coveralls

@benalleng
Copy link
Collaborator Author

Following the summit I thought it would be a good idea to try and follow the way that rust-lightning builds their fuzz infra https://github.com/lightningdevkit/rust-lightning/tree/main/fuzz with multiple fuzz suites, however I cannot get honggfuzz running on my machine for the life of me, maybe a personal nix problem but I also found this comment rust-fuzz/honggfuzz-rs#106 so I am not totally sure if there is a larger issue with hongfuzz at the moment.

@benalleng
Copy link
Collaborator Author

I excluded fuzzing from linting as the crate does not follow --all-features namely looking for a user to choose the fuzzing engine with a specific feature flag

@benalleng benalleng changed the title [WIP] Create POC for fuzzing payjoin [WIP] Introduce fuzzing for payjoin Jan 6, 2026
@benalleng benalleng force-pushed the fuzzing branch 9 times, most recently from 33b9aeb to cfcd3fe Compare January 7, 2026 20:42
This commit adds fuzzing infrastructure for payjoin with the inclusion
of three engine options, cargo-fuzz (libfuzzer-sys), afl++, and honggfuzz.  These
two were chosen as they come with seperate tradeoffs in regards to speed
and error handling.

Because these two fuzzers are setup as mutually exclusive fuzzers within
the same target file fuzzing cannot reasonably be built with
`--all-features`.

In addition honggfuzz and afl are seemingly broken on nix so I don't think it is reasonably
possible at this time to nixify our fuzzing crate.
@benalleng benalleng changed the title [WIP] Introduce fuzzing for payjoin Introduce fuzzing for payjoin Jan 7, 2026
@benalleng benalleng marked this pull request as ready for review January 7, 2026 20:47
@benalleng benalleng requested a review from nothingmuch January 7, 2026 20:48
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