Skip to content
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

Composable Block executor #11274

Closed
Tracked by #11169
mattsse opened this issue Sep 27, 2024 · 1 comment · Fixed by #11846
Closed
Tracked by #11169

Composable Block executor #11274

mattsse opened this issue Sep 27, 2024 · 1 comment · Fixed by #11846
Assignees
Labels
A-execution Related to the Execution and EVM C-enhancement New feature or request

Comments

@mattsse
Copy link
Collaborator

mattsse commented Sep 27, 2024

Currently we have a lot of semi duplicated code in both the OP and Eth (Batch)Executor

impl<EvmConfig, DB> Executor<DB> for EthBlockExecutor<EvmConfig, DB>

impl<EvmConfig, DB> Executor<DB> for OpBlockExecutor<EvmConfig, DB>

the only thing that's really different is how system transactions are executed.

we assume block execution follows this pattern:

  1. configure environment
  2. apply pre system txs
  3. execute block txs
  4. apply post system txs

Ideally all of those are composable.
if we can make this composable like have something that can execute system txs #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

@mattsse mattsse added C-enhancement New feature or request A-execution Related to the Execution and EVM labels Sep 27, 2024
@mattsse
Copy link
Collaborator Author

mattsse commented Oct 2, 2024

ideally we can use this to validate design: #9497

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-execution Related to the Execution and EVM C-enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants