You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently kona-executor exposes the revm handler in order to customize block execution. However, larger customizations of the EVM are not possible.
An abstraction to perform these deeper customizations already exists in reth/revm, where:
when reth executes, its BasicBlockExecutor contains a strategy for execution
in order to execute() (link), it calls apply_pre_execution_changes(), execute_transactions(), apply_post_execution_changes(), and finish() on the strategy.
reth includes the OpExecutionStrategy which is a good example of this implementation.
All strategies contain an evm_config which must implement ConfigureEvm.
This evm_config is what allows customization. Specifically for Kona's context, three of the functions it implements replace some of the hardcoded actions in Kona:
I believe the best option to allow Kona more flexibility in execution is to refactor Executor to rely on a struct implementing the ConfigureEvm trait in order to perform the above actions. For "normal" Kona, we can break the existing functions into a new type that implements the ConfigureEvm trait. For other customized chains like Odyssey, we can simply inherit whatever ConfigureEvm struct they are passing to reth for execution.
@clabby You had mentioned implementing the traits in alloy / op-alloy. I assume this accomplishes what you wanted, or was there a reason you prefer it to exist there?
Let's talk through this and make sure it's the right strategy before touching any code. I'm available async or for a live call on Monday if that's easier. Thanks guys.
The text was updated successfully, but these errors were encountered:
I believe the best option to allow Kona more flexibility in execution is to refactor Executor to rely on a struct implementing the ConfigureEvm trait in order to perform the above actions. For "normal" Kona, we can break the existing functions into a new type that implements the ConfigureEvm trait. For other customized chains like Odyssey, we can simply inherit whatever ConfigureEvm struct they are passing to reth for execution.
Yeah, this sounds like a nice minimal diff approach. Though if we have the time / are willing to make the effort, I think it would be great if we could upstream the traits that reth / revm are using for this configurability to alloy and/or op-alloy so that we can all operate on a common set of abstractions. In the medium-longer term, that buys us quite a bit - modifications to the OP Stack would only have to make their execution layer changes in one place and get kona + reth compatibility in one go.
@clabby You had mentioned implementing the traits in alloy / op-alloy. I assume this accomplishes what you wanted, or was there a reason you prefer it to exist there?
Yeah I'd prefer if it wasn't in kona or reth. A common set of executor abstractions is pretty desirable.
All that said, let me know your appetite for making that sort of change. I'm open to taking a more minimal approach at first, but would def prefer if we could work w/ @mattsse et. co on standardizing the interface and placing it somewhere that we can all use.
Currently
kona-executor
exposes the revm handler in order to customize block execution. However, larger customizations of the EVM are not possible.An abstraction to perform these deeper customizations already exists in reth/revm, where:
reth
executes, itsBasicBlockExecutor
contains astrategy
for executionexecute()
(link), it callsapply_pre_execution_changes()
,execute_transactions()
,apply_post_execution_changes()
, andfinish()
on the strategy.OpExecutionStrategy
which is a good example of this implementation.evm_config
which must implementConfigureEvm
.This
evm_config
is what allows customization. Specifically for Kona's context, three of the functions it implements replace some of the hardcoded actions in Kona:fill_cfg_env()
replacesself.evm_cfg_env()
fill_block_env()
replacesSelf::prepare_block_env()
fill_tx_env()
replacesSelf::prepare_tx_env()
I believe the best option to allow Kona more flexibility in execution is to refactor Executor to rely on a struct implementing the
ConfigureEvm
trait in order to perform the above actions. For "normal" Kona, we can break the existing functions into a new type that implements theConfigureEvm
trait. For other customized chains like Odyssey, we can simply inherit whateverConfigureEvm
struct they are passing to reth for execution.@clabby You had mentioned implementing the traits in
alloy
/op-alloy
. I assume this accomplishes what you wanted, or was there a reason you prefer it to exist there?Let's talk through this and make sure it's the right strategy before touching any code. I'm available async or for a live call on Monday if that's easier. Thanks guys.
The text was updated successfully, but these errors were encountered: