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 Node doesn't handle estimateGas calls with a low base fee #3474

Open
fvictorio opened this issue Dec 28, 2022 · 0 comments
Open

Hardhat Node doesn't handle estimateGas calls with a low base fee #3474

fvictorio opened this issue Dec 28, 2022 · 0 comments
Assignees
Labels
blocked-reason:needs-edr status:blocked Blocked by other issues or external reasons type:bug Something isn't working

Comments

@fvictorio
Copy link
Member

fvictorio commented Dec 28, 2022

If you start a Hardhat node and send an eth_estimateGas whose gas price (or max fee per gas) is lower than the current base fee, you get an ugly "If you think this is a bug in Hardhat, please report it here" error.

This happens often when interacting with a contract in the node using MetaMask. I guess MetaMask assumes local networks have a base fee of 0.

A workaround is to set initialBaseFeePerGas to zero:

module.exports = {
  solidity: "0.8.17",
  networks: {
    hardhat: {
      initialBaseFeePerGas: 0
    },
  },
};

But we should show a proper error in these cases.

Alternatively, maybe we should just accept estimateGas calls that don't have a gas price above the base fee. See #2469

@fvictorio fvictorio added type:bug Something isn't working priority:high status:ready This issue is ready to be worked on labels Dec 28, 2022
@fvictorio fvictorio moved this to Todo in Hardhat Jul 14, 2023
@fvictorio fvictorio moved this from Ready to To-do in Hardhat Aug 9, 2023
@fvictorio fvictorio self-assigned this Sep 20, 2023
@fvictorio fvictorio moved this from To-do to Backlog in Hardhat Nov 15, 2023
@fvictorio fvictorio added status:blocked Blocked by other issues or external reasons blocked-reason:needs-edr and removed status:ready This issue is ready to be worked on labels Nov 15, 2023
compojoom added a commit to shutter-network/shutter-dao that referenced this issue Dec 15, 2023
compojoom added a commit to shutter-network/shutter-dao that referenced this issue Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked-reason:needs-edr status:blocked Blocked by other issues or external reasons type:bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

1 participant