-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Describe the feature
The return types of fn executor
and fn batch_executor
hardcode -> BasicBlockExecutor<&Self, DB>
. This prevents custom block executors from being used.
reth/crates/evm/evm/src/lib.rs
Lines 282 to 292 in 3338c5a
/// Returns a new [`BasicBlockExecutor`]. | |
#[auto_impl(keep_default_for(&, Arc))] | |
fn executor<DB: Database>(&self, db: DB) -> BasicBlockExecutor<&Self, DB> { | |
BasicBlockExecutor::new(self, db) | |
} | |
/// Returns a new [`BasicBlockExecutor`]. | |
#[auto_impl(keep_default_for(&, Arc))] | |
fn batch_executor<DB: Database>(&self, db: DB) -> BasicBlockExecutor<&Self, DB> { | |
BasicBlockExecutor::new(self, db) | |
} |
If we need deeper customisations (for example, changing the fn execute_one
or fn execute_one_with_state_hook
, we need to have a CustomBlockExecutor, which cannot be returned from fn executor
, which is used for the block execution.
Instead, fn executor
and fn batch_executor
should return an impl type instead of the concrete BasicBlockExecutor
.
Additional context
For context, I want to modify the block's execution so that before execution I can use the inspector and an evm in order to simulate transactions and flag certain transactions which calls sstores on specific contracts. Restricting the inspector in impl<'db, DB, E, Spec, R> BlockExecutor
doesn't work because the higher level function create_evm
, which is called from evm_for_block
expects a NoOpInspector, and a couple of other issues.
Configuring the fn execute_one
was possible prior to v1.4.3 due to the BlockExecutorFactory, but since that has been removed, we need a different way of customizing it. With this hardcoded return type in ConfigureEvm, reth becomes less configurable.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status