-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat(anvil
): add eth_config
rpc endpoint
#11591
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense! left a comment re blobSchedule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is my new favorite endpoint 👍
this is likely not super helpful for the average user but nice to have
if self.odyssey { | ||
precompiles_map.insert( | ||
PrecompileId::P256Verify.name().to_string(), | ||
u64_to_address(P256VERIFY_ADDRESS), | ||
); | ||
} | ||
|
||
if self.is_celo() { | ||
precompiles_map.insert( | ||
celo_precompile::PRECOMPILE_ID_CELO_TRANSFER.clone().name().to_string(), | ||
CELO_TRANSFER_ADDRESS, | ||
); | ||
} | ||
|
||
if let Some(factory) = &self.precompile_factory { | ||
for (precompile, _) in &factory.precompiles() { | ||
precompiles_map.insert(precompile.id().name().to_string(), *precompile.address()); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to do something about this, we have this in a few locations and maintaining this is a bit horrible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, will have a look in a follow-up if we can have a shared helper for this to make this more maintainable as it currently is strictly tied to the EVM creation that we don't have access to in Anvil's backend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Motivation
In order to make it easier to figure out the supported precompiles and system contracts as a user I think it makes sense to add an
eth_config
-like RPC method: https://eips.ethereum.org/EIPS/eip-7910Closes: #11433
This completes the work required to make Foundry ready for Osaka.
Closes: #11428
Solution
Adds
eth_config
-like endpoint inspired by the actualeth_config
specification with notable exceptions:Spec compliant:
next
andlast
fields are alwaysnull
as this node does not participate in any forking on the network.Not spec compliant:
The
fork_id
is always0x00000000
as this node does not participate in any forking on the network. For all intended purposes you can consider this unused by Anvil.Another thing that may be confusing to people is that we currently do not explicitly support all effects of system contracts yet, notably: #10357
Example output:
PR Checklist