Open mattsse opened 3 weeks ago
Context: Currently for op-reth the evm is configured in ConfigureEvmEnv
for general execution, which internally uses revm_spec
(defined in reth-evm-optimism
under src/config.rs
) to determine the spec ID for the EVM.
However, the payload builder configures this in PayloadBuilderAttributes::cfg_and_block_env
implemented on OptimismPayloadBuilderAttributes
which internally uses a separate function called revm_spec_by_timestamp_after_bedrock
(similarly defined in reth-evm-optimism
), making it hard to override supported forks in custom op setups (e.g. Alphanet).
Hey @mattsse I can pick this one up, feel free to assign this to me
we currently have the cfg and block env setup as part of the payloadattributes types
https://github.com/paradigmxyz/reth/blob/a942467656620836da037fc27cb8057dabf1f98a/crates/payload/primitives/src/traits.rs#L73-L86
this makes it impossible to modify while reusing
OptimismPayloadBuilderAttributes
for example.most of this functionality is already provided by the
ConfigureEvmEnv
trait anyway, so creating cfg and block env should be moved down to the payload builder itself which has access to thisTODO
remove
PayloadBuilderAttributes::cfg_and_block_env
remove fields from https://github.com/paradigmxyz/reth/blob/a942467656620836da037fc27cb8057dabf1f98a/crates/payload/basic/src/lib.rs#L676-L679
port
cfg_and_block_env
into: https://github.com/paradigmxyz/reth/blob/a942467656620836da037fc27cb8057dabf1f98a/crates/optimism/payload/src/builder.rs#L32-L32 and https://github.com/paradigmxyz/reth/blob/a942467656620836da037fc27cb8057dabf1f98a/crates/ethereum/payload/src/lib.rs#L67-L73