reth
reth copied to clipboard
feat(eth-wire): fuzzing wire encoding roundtrip
My plan for this is inspired by @joshieDo's comment:
we have something similar for db codecs. Also has built-in fuzzing support using
trailofbits/test-fuzz. Maybe it's interesting here as well?https://github.com/foundry-rs/reth/blob/c0db65c86fd1c5ddde03a3b7d0a487ed93c178ec/crates/interfaces/src/db/codecs/fuzz/mod.rs#L30-L45
and here:
https://github.com/foundry-rs/reth/blob/c0db65c86fd1c5ddde03a3b7d0a487ed93c178ec/crates/codecs/derive/src/compact/generator.rs#L18-L31
- [x] Create a macro which takes an
Encodable + Decodable + Serializable + Clonetype as input, and creates a fuzz test - [ ] Call macro on all message types
- [ ] Use the roundtrip test code to check known message encodings
- [ ] Iterate and fix bugs