Skip to content

fix(anvil): clean up eth_estimateGas#7515

Merged
mattsse merged 5 commits into
masterfrom
klkvr/estimate-gas
Mar 28, 2024
Merged

fix(anvil): clean up eth_estimateGas#7515
mattsse merged 5 commits into
masterfrom
klkvr/estimate-gas

Conversation

@klkvr

@klkvr klkvr commented Mar 28, 2024

Copy link
Copy Markdown
Member

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.

@klkvr klkvr requested review from DaniPopes and mattsse as code owners March 28, 2024 21:50

@mattsse mattsse left a comment

Copy link
Copy Markdown
Member

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

Comment thread crates/anvil/src/eth/api.rs Outdated
Comment thread crates/anvil/src/eth/api.rs
Comment thread crates/anvil/src/eth/api.rs Outdated
Comment thread crates/anvil/src/eth/api.rs
Comment thread crates/anvil/src/eth/api.rs

@mattsse mattsse left a comment

Copy link
Copy Markdown
Member

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
@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