feat(eth-wire): fuzzing wire encoding roundtrip (#350)

* move hello to separate file

* cargo fmt

* wip: actual fuzz test

 * should probably also take advantage of test-fuzz to generate
   benchmarks like impl_fuzzer_with_input

* impl generic roundtrip method

* generate test with macro

* change testname to fuzzname

* add reth-eth-wire to fuzz in ci

* add other message types to fuzz

* remove unused_crate_dependencies

 * was causing test issues, may want to revisit whether or not we can
   include this warning and still use test_fuzz

* more afl debugging ci

* use more explicit imports in fuzz_rlp

* impl Default for types and fuzz ping/pong

 * Default is necessary for test-fuzz to auto generate a corpus for each
   type we are fuzz testing

* enable AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES

 * not sure if we should do this in the workflow instead:
   echo core >/proc/sys/kernel/core_pattern

   we may miss crashes if we keep this enabled?

* remove reth-interfaces from fuzzing

* add secp256k1 to reth-db dev deps
This commit is contained in:
Dan Cline
2022-12-13 12:10:52 -05:00
committed by GitHub
parent dff3936b29
commit 1e38ffa5ad
18 changed files with 402 additions and 141 deletions

View File

@ -8,6 +8,7 @@ env:
RUSTFLAGS: -D warnings
CARGO_TERM_COLOR: always
GETH_BUILD: 1.10.26-e5eb32ac
AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES: 1
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@ -70,11 +71,16 @@ jobs:
command: install
args: cargo-test-fuzz afl
- name: check for cargo afl
run: |
cargo install --force afl
cargo afl --version
- name: Run fuzz tests
run: |
./.github/scripts/fuzz.sh reth-primitives
./.github/scripts/fuzz.sh reth-db
./.github/scripts/fuzz.sh reth-interfaces
./.github/scripts/fuzz.sh reth-eth-wire
./.github/scripts/fuzz.sh reth-codecs
lint: