reth icon indicating copy to clipboard operation
reth copied to clipboard

evm: use `RethEvmBuilder` for `Optimism` config

Open tcoratger opened this issue 6 months ago • 0 comments

As a follow up to our use of the Evm builder (related https://github.com/paradigmxyz/reth/pull/10210), this PR uses the RethEvmBuilder for the Optimism configuration in order to gradually eliminate the EvmBuilder from the codebase.

  • The unit tests added in https://github.com/paradigmxyz/reth/pull/10280 should cover the entire EVM building for the Optimism cfg. I hope I didn't miss any untested edge cases that would be problematic.
  • Before we used the optimism() function which is part of the EvmBuilder https://github.com/bluealloy/revm/blob/1ad860469755e3cf71383f45d71c3faaf61d3029/crates/revm/src/builder.rs#L162-L169 to modify the handler to apply the spec ID changes needed by Optimism but with the new approach using RethEvmBuilder, it is not practical to do like that. So I opted for another approach which consists of first building a default EVM which is an Ethereum EVM before modifying the handler.

@mattsse Don't hesitate to tell me what you think and if the chosen approach seems correct to you. The goal of this PR is really to extend the usage of our RethEvmBuilder and to no longer have an EvmBuilder in the Optimism implementation.

tcoratger avatar Aug 24 '24 02:08 tcoratger