-
Notifications
You must be signed in to change notification settings - Fork 2k
feat(anvil): add block context overrides for eth_call and eth_estimateGas #10487
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
base: master
Are you sure you want to change the base?
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.
this looks great already,
I have a few style nits
Thanks @mattsse for your feedback! I will squash it before marking this PR as ready. |
fb16804
to
5590414
Compare
…eGas This commit implements block context overrides for eth_call and eth_estimateGas RPC methods, allowing users to specify block parameters like timestamp, number, difficulty, etc. for call execution context. Key changes: - BlockOverrides added to EthRequest enum variants for eth_call and eth_estimateGas - Block overrides handling implemented in `anvil::eth::backend::mem::state` as `apply_block_overrides()` function (ported from reth) - Add new error type EvmOverrideError to group state and block override related errors (due to fork mode) - State override handling refactored: - Rename `apply_cached_db_state_override()` to `apply_state_overrides()` - Modify to take mutable `CacheDB` reference instead of creating new instance - Consistent pattern for `apply_state_overrides()` and `apply_block_overrides()`
5590414
to
180f897
Compare
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, ty!
this will likely conflict with #10454
so I'm resolving the conflicts after and merge this,
tysm
Motivation
Resolve #10458 by implementing block context overrides for
eth_call
andeth_estimateGas
RPC methods, allowing users to specify block parameters like timestamp, number, difficulty, etc. for call execution context.Solution
Key changes:
anvil::eth::backend::mem::state
asapply_block_overrides()
function (ported from reth)apply_cached_db_state_override()
toapply_state_overrides()
CacheDB
reference instead of creating new instanceapply_state_overrides()
andapply_block_overrides()
PR Checklist
Add Tests with State and Block overrides foreth_call
andeth_estimateGas