reth icon indicating copy to clipboard operation
reth copied to clipboard

feat(eth-wire): fuzzing wire encoding roundtrip

Open Rjected opened this issue 2 years ago • 0 comments

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 + Clone type 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

Rjected avatar Dec 07 '22 22:12 Rjected