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

chore: relax a generic trait #12

Merged
merged 8 commits into from
Feb 13, 2025
Merged

chore: relax a generic trait #12

merged 8 commits into from
Feb 13, 2025

Conversation

rakita
Copy link
Collaborator

@rakita rakita commented Feb 11, 2025

Precompile generic used for EthEvm, by default it will be EthPrecompiles

@rakita rakita requested review from mattsse and klkvr as code owners February 11, 2025 21:16
Comment on lines +25 to +27
pub struct EthEvm<DB: Database, I, PRECOMPILE = EthPrecompiles<EthEvmContext<DB>>>(
RevmEvm<EthEvmContext<DB>, I, EthInstructions<EthInterpreter, EthEvmContext<DB>>, PRECOMPILE>,
);
Copy link
Member

Choose a reason for hiding this comment

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

is there no mainnet evm anymore?

isn't this intended as a wrapper around the plain L1 evm?

imo this shouldn't require this much setup

Copy link
Member

Choose a reason for hiding this comment

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

ah I think this is so that this specific EthEvm type can be reused

Copy link
Member

Choose a reason for hiding this comment

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

this will likely be a common use case so worth thinking how we can simplify this setup out of the box

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah I think this is so that this specific EthEvm type can be reused

Yes, so we can change precompiles as in reth precompile example.

As the default value for Precompiles is EthPrecompile it will be the same as the previous Mainnet type.

We could use Box<dyn Precompiles> that would remove generic from it.

Copy link
Member

@klkvr klkvr left a comment

Choose a reason for hiding this comment

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

lgtm, I don't mind it here for now

Ideally we should be able to implement evm trait directly on revm Evm and not need to add such generics to reth/op-reth implementations just for reuse in examples

@klkvr klkvr merged commit b5065b6 into klkvr/new-revm Feb 13, 2025
27 checks passed
@klkvr klkvr deleted the rakita/new-revm branch February 13, 2025 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants