-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: abstraction to allow customized EVMs #839
Comments
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
Yeah I'd prefer if it wasn't in 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. |
Chatted about this a bit more with @mattsse today. Looking like the effort on creating a unified interface has picked back up, issue should be able to be revived soon. |
Adding
M-blocked
Some more info on why this is important to us:
|
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: