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

feat(executor): Expose full revm Handler #475

Merged
merged 2 commits into from
Sep 2, 2024
Merged

Conversation

clabby
Copy link
Collaborator

@clabby clabby commented Sep 2, 2024

Overview

Improves the API around the revm handler passed to the StatelessL2BlockExecutor to be less about precompile overrides and more about modifying the handler at large. Also removes the old PrecompileOverride trait in favor of holding onto an optional function pointer - the StatelessL2BlockExecutorBuilder no longer requires specifying a noop handler in the case where it does not need to be modified.

Usage

/// A type alias for the [revm::handler::register::HandleRegister] for kona's block executor.
pub type KonaHandleRegister<F, H> =
    for<'i> fn(&mut EvmHandler<'i, (), &mut State<&mut TrieDB<F, H>>>);

// ...

/// A custom [KonaHandleRegister] to pass to the [StatelessL2BlockExecutor].
pub(crate) fn custom_handle_register<F, H>(
    handler: &mut EvmHandler<'_, (), &mut State<&mut TrieDB<F, H>>>,
) where
    F: TrieDBFetcher,
    H: TrieDBHinter,
{
    // Modify the `EvmHandler`...
}


// ...

// Create the stateless L2 block executor
let mut executor = StatelessL2BlockExecutor::builder(...)
    .with_parent_header(...)
    .with_fetcher(...)
    .with_hinter(...)
    .with_handler_register(custom_handle_register)
    .build()?;

@clabby clabby self-assigned this Sep 2, 2024
@clabby clabby added K-feature Kind: feature A-executor Area: kona-executor crate labels Sep 2, 2024
@clabby clabby force-pushed the cl/executor-custom-evm branch from 103c66c to d5efe5c Compare September 2, 2024 20:57
Copy link

codecov bot commented Sep 2, 2024

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

Copy link
Collaborator Author

clabby commented Sep 2, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @clabby and the rest of your teammates on Graphite Graphite

Copy link
Collaborator

@refcell refcell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeps it nice and simple 👍

Improves the API around the `revm` handler in the
`StatelessL2BlockExecutor` to allow for a custom `HandleRegister` to be
passed into the `StatelessL2BlockExecutorBuilder`.
lint
Base automatically changed from cl/org-transfer to main September 2, 2024 21:49
@clabby clabby force-pushed the cl/executor-custom-evm branch from d5efe5c to 9bde398 Compare September 2, 2024 21:49
@clabby clabby enabled auto-merge September 2, 2024 21:49
@clabby clabby added this pull request to the merge queue Sep 2, 2024
Merged via the queue into main with commit 9e5e7d3 Sep 2, 2024
15 checks passed
@github-actions github-actions bot mentioned this pull request Sep 2, 2024
@clabby clabby deleted the cl/executor-custom-evm branch September 2, 2024 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-executor Area: kona-executor crate K-feature Kind: feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants