reth icon indicating copy to clipboard operation
reth copied to clipboard

Move post-execution block validation from `EthBlockExecutor` to `Consensus` trait

Open shekhirin opened this issue 1 year ago • 1 comments

Describe the feature

Currently, we do post-execution block validations such as receipts root inside the EthBlockExecutor::execute_and_verify https://github.com/paradigmxyz/reth/blob/4b2d5eb83b7732ea61ad2f96a2a4fbf940a8126f/crates/ethereum/evm/src/execute.rs#L283-L296 while pre-execution is done inside the Consensus::validate_block https://github.com/paradigmxyz/reth/blob/4b2d5eb83b7732ea61ad2f96a2a4fbf940a8126f/crates/consensus/consensus/src/lib.rs#L77-L86


We should move the post-execution block validation inside the Consensus trait. It includes the validation against the header of:

  1. Receipts root
  2. Gas usage
  3. EIP-7865 requests root

Additional context

No response

shekhirin avatar May 19 '24 12:05 shekhirin

supportive, I like the separation, we could still integrate these validation in a separate trait fn, but execute should really just execute and leave validation up to the caller

mattsse avatar May 19 '24 12:05 mattsse