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: stateOverride usage with eth_estimateGas #6980

Closed
TateB opened this issue Feb 1, 2024 · 2 comments
Closed

feat: stateOverride usage with eth_estimateGas #6980

TateB opened this issue Feb 1, 2024 · 2 comments
Assignees
Labels
C-anvil Command: anvil good first issue Good for newcomers T-feature Type: feature

Comments

@TateB
Copy link
Contributor

TateB commented Feb 1, 2024

Component

Anvil

Describe the feature you would like

geth recently added the optional stateOverride parameter to eth_estimateGas, with the same functionality as eth_call (see ethereum/go-ethereum#27800, ethereum/go-ethereum#27845). would be super useful to have this added to anvil!

example usage: estimating the total gas of an approve and transfer transaction, before the approve transaction has been done

Additional context

No response

@TateB TateB added the T-feature Type: feature label Feb 1, 2024
@TateB TateB changed the title stateOverride usage with eth_estimateGas feat: stateOverride usage with eth_estimateGas Feb 1, 2024
@mattsse mattsse added good first issue Good for newcomers C-anvil Command: anvil labels Feb 1, 2024
@mattsse
Copy link
Member

mattsse commented Feb 1, 2024

TODO

add StateOverrides to estimate endpoint, then apply to state:

let state = state::apply_state_override(overrides.into_iter().collect(), state)?;

here

.with_database_at(Some(block_request), |state, block| {
self.do_estimate_gas_with_state(request, state, block)

see also eth_call

pub async fn call(
&self,
request: CallRequest,
fee_details: FeeDetails,
block_request: Option<BlockRequest>,
overrides: Option<StateOverride>,

@loocapro
Copy link
Contributor

loocapro commented Feb 1, 2024

Can I take this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-anvil Command: anvil good first issue Good for newcomers T-feature Type: feature
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants