Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

fix: handle eth_gasEstimate reverts correctly to prevent potential process crash #4056

Merged
merged 2 commits into from
Dec 19, 2022

Conversation

davidmurdoch
Copy link
Member

@davidmurdoch davidmurdoch commented Dec 17, 2022

When updating to support the Merge hardfork code that handled eth_gasEstimate was refactored. A code block that previously "short circuited" the function no longer did, causing a JavaScript Promise to be fullfilled with a handled rejection, but then also an unhandled rejection.

We've fixed the short circuit code and added a test to prevent this from regressing in the future.

@jeffsmale90
Copy link
Contributor

@davidmurdoch originally I was deploying a contract that throws in the constructor, but figured this was a simpler way to cause the estimator to fail. LMK what you think.

@davidmurdoch davidmurdoch changed the title fix: fix failing rejected gasEstimate fix: handle eth_gasEstimate reverts correctly to prevent potential process crash Dec 19, 2022
@davidmurdoch davidmurdoch marked this pull request as ready for review December 19, 2022 15:45
@davidmurdoch
Copy link
Member Author

Code coverage in the problematic function with @jeffsmale90's test is now:

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants