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

Different gas used in hardhat network with fork, without fork, and rinkeby #1043

Closed
fvictorio opened this issue Nov 20, 2020 · 0 comments · Fixed by #1062
Closed

Different gas used in hardhat network with fork, without fork, and rinkeby #1043

fvictorio opened this issue Nov 20, 2020 · 0 comments · Fixed by #1062
Labels
type:bug Something isn't working

Comments

@fvictorio
Copy link
Member

This is a simplified version of #990, but it's different enough to merit its own issue. Maybe fixing this (assuming there's something to be fixed) fixes that one too, but maybe not.

Reproduction steps

git clone https://github.com/fvictorio/hardhat-gas-used-bug
cd hardhat-gas-used-bug
export FORK_URL="https://mainnet.infura.io/v3/<project-id>"
export RINKEBY_URL="https://rinkeby.infura.io/v3/<project-id>"
export RINKEBY_PRIVATE_KEY="<rinkeby-account-private-key>"

npx hardhat run script.js # 43317
FORK=true npx hardhat run script.js # 43086
npx hardhat run script.js --network rinkeby # 58317

The three runs give a different gas used. To the best of my knowledge, the contracts don't use any on-chain state, so that shouldn't be the cause. But maybe I'm missing something here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant