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

fix(anvil): clean up eth_estimateGas #7515

Merged
merged 5 commits into from
Mar 28, 2024
Merged

fix(anvil): clean up eth_estimateGas #7515

merged 5 commits into from
Mar 28, 2024

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Mar 28, 2024

Motivation

Closes #7490 and changes code to avoid duplication of error handling logic between initial estimation vs binary search steps.

Solution

Adds GasEstimationCallResult which takes care of matching errors occured during call and fully covers all potential InstructionResults to distinguish between out of gas errors, reverts and unexpected failures.

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

this is great!

only have a few suggestions

crates/anvil/src/eth/api.rs Outdated Show resolved Hide resolved
crates/anvil/src/eth/api.rs Show resolved Hide resolved
crates/anvil/src/eth/api.rs Outdated Show resolved Hide resolved
crates/anvil/src/eth/api.rs Show resolved Hide resolved
crates/anvil/src/eth/api.rs Show resolved Hide resolved
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm

@mattsse mattsse merged commit 617dfc2 into master Mar 28, 2024
18 of 19 checks passed
@mattsse mattsse deleted the klkvr/estimate-gas branch March 28, 2024 23:03
ZhangZhuoSJTU pushed a commit to MEDGA-eth/foundry that referenced this pull request Mar 29, 2024
* fix(anvil): clean up eth_estimateGas

* fix doc

* fix doc

* fix doc

* review fixes
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.

anvil: EVM error MemoryLimitOOG
2 participants