Skip to content

fix(anvil): properly estimate gas instead of bailing on GasTooHigh#4861

Merged
mattsse merged 3 commits intomasterfrom
evalir/evm-error-fix
May 1, 2023
Merged

fix(anvil): properly estimate gas instead of bailing on GasTooHigh#4861
mattsse merged 3 commits intomasterfrom
evalir/evm-error-fix

Conversation

@Evalir
Copy link
Member

@Evalir Evalir commented May 1, 2023

Motivation

Anvil is improperly bailing out of estimating gas if we run into a GasTooHigh error—we should treat it like other revert/OOG/OOF errors and just adjust the gas price accordingly. This was due to an improperly mapped error type when performing a call with state.

Solution

Properly maps the error to InvalidTransactionError::GasTooHigh and refactors the binary search to also include the case when this happens.

@Evalir Evalir requested a review from mattsse May 1, 2023 19:47
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

needs linting, perhaps unrelated?

@Evalir
Copy link
Member Author

Evalir commented May 1, 2023

yeah this is unrelated haha, lemme fix it so you can send it

@mattsse mattsse merged commit e15e33a into master May 1, 2023
@mattsse mattsse deleted the evalir/evm-error-fix branch May 1, 2023 20:37
@antazoey
Copy link
Contributor

antazoey commented May 4, 2023

ya i get intrinsic gas too high on normal transactions when i dont estimate gas all of i sudden... not sure why. i am using max gas

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.

3 participants