the only thing that's really different is how system transactions are executed.
we assume block execution follows this pattern:
configure environment
apply pre system txs
execute block txs
apply post system txs
Ideally all of those are composable.
if we can make this composable like have something that can execute system txs https://github.com/paradigmxyz/reth/issues/10955 then we can make the executor generic over something that only focuses on these things and we can remove a ton of boilerplate.
one idea
trait E {
fn apply_pre
fn execute_txs
fn apply_post
}
we could then create one general purpose executor that implements the Executor trait and wraps this new one. so that implementers only need to implement the raw execution functions.
perhaps we can also make some simplifications to the Executor trait itself
Currently we have a lot of semi duplicated code in both the OP and Eth (Batch)Executor
https://github.com/paradigmxyz/reth/blob/da6b1e7c64417f346b3d9e0d36d2ccee2f13425e/crates/ethereum/evm/src/execute.rs#L352-L352
https://github.com/paradigmxyz/reth/blob/da6b1e7c64417f346b3d9e0d36d2ccee2f13425e/crates/optimism/evm/src/execute.rs#L332-L332
the only thing that's really different is how system transactions are executed.
we assume block execution follows this pattern:
Ideally all of those are composable. if we can make this composable like have something that can execute system txs https://github.com/paradigmxyz/reth/issues/10955 then we can make the executor generic over something that only focuses on these things and we can remove a ton of boilerplate.
one idea
we could then create one general purpose executor that implements the
Executor
trait and wraps this new one. so that implementers only need to implement the raw execution functions.perhaps we can also make some simplifications to the
Executor
trait itself