-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Support injecting custom precompiles to anvil #7498
Comments
This should be doable, what we need is a way to tell the In reth this is kinda doable already, like: so what we need here is something similar. I think for anvil this should also be abstracted over a trait that can be boxed so we don't end up with a bunch of generics everywhere, which is the most difficult part here because the Evm interface is a bit hard to work with in that regard. so this likely needs some trial and error first |
Hey, so I started working on this, and I have the following thoughts/questions. I know you know all of this, but I like to have all the context in one place. I see that Evm environment is separate from Evm execution, in the sense that all that foundry/crates/evm/core/src/utils.rs Lines 102 to 118 in bd56eef
and this is passed the So, one path I see is creating a wrapper This will also mean modifying // NOTE: We could use `revm::Evm::builder()` here, but on the current patch it has some
// performance issues. Does this make sense to you? Am I missing something? |
yes, this part we need to make configurable, we need something that knows how to do this and takes care of configuring the evm given an env we need to abandon this util function |
Somewhat related #6509 (i.e. the idea is WASM modules to insert as precompiles for foundry) |
Component
Anvil
Describe the feature you would like
Currently, we have a use case where we want to spin up an isolated
anvil
instance per test with custom precompiles.Given that the team is willing to support custom precompiles as functions in Foundry, it would be nice to add a way to inject custom precompiles to
anvil
(as a library), like for example, being able to pass the result ofrevm::Evm::builder()
.If I'm reading
anvil
's source code correctly, this would imply updatingNodeConfig
to support some form of precompile injection.This would outsource maintaining custom precompiles from the team to consumers.
Additional context
No response
The text was updated successfully, but these errors were encountered: