paradigmxyz / reth

Modular, contributor-friendly and blazing-fast implementation of the Ethereum protocol, in Rust
https://reth.rs/
Apache License 2.0
3.94k stars 1.17k forks source link

Add unit tests to protect `ensure_well_formed_payload` #12118

Open tcoratger opened 1 week ago

tcoratger commented 1 week ago

Describe the change

The function that ensures that the payload is well formed is quite tricky with a lot of nested logic:

https://github.com/paradigmxyz/reth/blob/0c516091b8f45f07cf4d76879153d3cd90015363/crates/payload/validator/src/lib.rs#L113-L182

It could be nice to add some simple unit tests in order to test the different scenarios and protect the function for future modifications so that we don't introduce bugs or invalid logic in the future when we modify this.

Additional context

No response

nadtech-hub commented 1 week ago

I can do it. Could you assign it to me?