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

Handle edge case for initialized chain #3103

Merged
merged 2 commits into from
Sep 21, 2023

Conversation

reedsa
Copy link
Contributor

@reedsa reedsa commented Sep 20, 2023

What was wrong?

Closes #1149

The time based gas price strategy assumes there are many blocks to sample from. In cases where test chains are spun up and no blocks have been mined, this can throw exceptions for folks who are running tests.

How was it fixed?

Check the latest block prior to attempting to sample so it can fallback to the gas price in w3.eth.gas_price.

Todo:

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

Copy link
Contributor

@pacrob pacrob left a comment

Choose a reason for hiding this comment

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

lgtm!

@reedsa reedsa merged commit 5dca524 into ethereum:main Sep 21, 2023
84 checks passed
@reedsa reedsa deleted the time-based-gas-price-fallback branch September 21, 2023 20:28
Copy link
Collaborator

@fselmo fselmo left a comment

Choose a reason for hiding this comment

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

lgtm 👍🏼

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.

Web3 crashes in time-based gas price strategies with empty chain
3 participants