Skip to content

Commit 00e7e0d

Browse files
authored
Fuzzing enhancements: clean up README and add CI job (#1322)
2 parents 1356c91 + e7b11cc commit 00e7e0d

2 files changed

Lines changed: 20 additions & 11 deletions

File tree

.github/workflows/rust.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,16 @@ jobs:
144144
with:
145145
name: mutants-incremental-cargo.out
146146
path: mutants.out
147+
148+
Fuzz:
149+
name: Fuzz build
150+
runs-on: ubuntu-latest
151+
steps:
152+
- name: "Checkout repo"
153+
uses: actions/checkout@v4
154+
- name: "Install nightly toolchain"
155+
uses: dtolnay/rust-toolchain@nightly
156+
- name: "Use cache"
157+
uses: Swatinem/rust-cache@v2
158+
- name: "Build fuzz targets"
159+
run: cd fuzz && cargo build

fuzz/README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44
Payjoin-fuzz
55
</h1>
66

7-
Fuzz tests work by generating a ton of random noise that is morhped into parameter arguments for tests to run and validate that none of it causes it to have unhandled crashes.
7+
Fuzz tests work by generating a ton of random noise that is morphed into parameter arguments for tests to run and validate that none of it causes unhandled crashes.
88

99
### Bootstrapping
1010

11-
#### cargo-fuzz / libFuzzer
12-
13-
To use simply start a nix dev shell
11+
This fuzzer uses [cargo-fuzz](https://github.com/rust-fuzz/cargo-fuzz) (libFuzzer). To get started, enter the nix dev shell and run the fuzzer:
1412

1513
```shell
1614
nix develop
@@ -20,21 +18,19 @@ cd fuzz/
2018

2119
### Running fuzzers
2220

23-
Note for some users the fuzz engine optionality is limited as there may not be any active maintenance for a fuzzer on that system. Namely MacOS and NixOS users should prefer `libfuzzer` as `honggfuzz` is not actively maintained for those systems.
24-
25-
The `fuzz.sh` and `cycle.sh` shell scripts allow for single pass fuzzing and continuous long term fuzzing resepctively.
21+
The `fuzz.sh` and `cycle.sh` shell scripts allow for single pass fuzzing and continuous long term fuzzing respectively.
2622

2723
#### Using `fuzz.sh`
2824

29-
This scripts accepts an optional fuzz target. It run all available targets when this option is omitted.
25+
This script accepts an optional fuzz target. It runs all available targets when this option is omitted.
3026

31-
`./fuzz.sh <fuzz-target>`
27+
`./fuzz.sh [fuzz-target]`
3228

33-
for example the command `.fuzz.sh afl uri_deserialize_pjuri` selects the afl engine and runs only the `uri_deserialize_pjuri` for 30 seconds.
29+
For example, `./fuzz.sh uri_deserialize_pjuri` runs only the `uri_deserialize_pjuri` target for 30 seconds.
3430

3531
#### Using `cycle.sh`
3632

37-
This command will run over all targets continuously changing targets every hour.
33+
This command will run over all targets continuously, changing targets every hour.
3834

3935
`./cycle.sh`
4036

0 commit comments

Comments
 (0)