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

Hardhat: stop estimating gas, log like ganache #10

Merged
merged 2 commits into from
Jan 28, 2022

Conversation

feuGeneA
Copy link
Contributor

Fixes #9

With this GAS_LIMIT change in place, Hardhat is no longer estimating gas before running the transaction, and, by my measurements, its benchmark run time is down from 40 seconds to 8 when starting with a cache, and from 23 minutes to 15 when starting without a cache.

"If you are using ethers.js, then those values need to be set in each
call/deployment.

"The gasPrice that can be set in the config doesn't have an effect when
you are using ethers. We need to update that section of the docs to make
it clearer that that's the case."

source: https://twitter.com/fvictorio_nan/status/1470503282909093890

I confirmed with fvictorio that the same advice applies to the gas limit
as well.

I confirmed that, before this change, the log from the hardhat benchmark
run showed a call to eth_estimateGas, and after this change it did not.
Copy link
Owner

@mds1 mds1 left a comment

Choose a reason for hiding this comment

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

heh yes I noticed this too and have a branch that fixes it, as well a few other things like adding the block tag when fetching the owner. The extra logging is nice here so I'll merge this and will rebase my branch

@mds1 mds1 merged commit ac8a60a into mds1:main Jan 28, 2022
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.

fix: Hardhat is estimating gas
2 participants