feat: use hardcoded zero value for base fee per gas (#5023)#5034
Open
jasuwienas wants to merge 4 commits intomainfrom
Open
feat: use hardcoded zero value for base fee per gas (#5023)#5034jasuwienas wants to merge 4 commits intomainfrom
jasuwienas wants to merge 4 commits intomainfrom
Conversation
Signed-off-by: Mariusz Jasuwienas <jasuwienas@gmail.com>
Signed-off-by: Mariusz Jasuwienas <jasuwienas@gmail.com>
Signed-off-by: Mariusz Jasuwienas <jasuwienas@gmail.com>
Signed-off-by: Mariusz Jasuwienas <jasuwienas@gmail.com>
jasuwienas
commented
Mar 6, 2026
| let wallet = (await ethers.getSigners())[0]; | ||
| const Greeter = await ethers.getContractFactory('Greeter', wallet); | ||
| const greeter = await Greeter.deploy('initial_msg'); | ||
| const greeter = await Greeter.deploy('initial_msg', { gasPrice: 710_000_000_000 }); |
Contributor
Author
There was a problem hiding this comment.
If we return baseFeePerGas as the task states - equal 0, hardhat will use maxFeePerGas = 1_000_000_000n by default (which is too low for us)..
hardhat-ethers/src/internal/hardhat-ethers-provider.ts
const latestBlock = await this.getBlock("latest");
const baseFeePerGas = latestBlock?.baseFeePerGas;
if (baseFeePerGas !== undefined && baseFeePerGas !== null) {
(...)
maxPriorityFeePerGas = maxPriorityFeePerGas ?? 1_000_000_000n;
maxFeePerGas = 2n * baseFeePerGas + maxPriorityFeePerGas;
}
Returning undefined or null there would force it to get the value from eth_getPRice instead, but it is not happening... This is why I had to update hardhat example. (and this is why this might be a breaking change for some of the users @Ferparishuertas )
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #5034 +/- ##
==========================================
+ Coverage 95.77% 95.80% +0.03%
==========================================
Files 144 144
Lines 24623 24593 -30
Branches 1958 1959 +1
==========================================
- Hits 23583 23562 -21
+ Misses 1011 1004 -7
+ Partials 29 27 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 11 files with indirect coverage changes 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
base fee per gas value in block data response will be hardcoded to 0x0
Related issue(s)
Fixes #5023
Testing Guide
Changes from original design (optional)
N/A
Additional work needed (optional)
N/A
Checklist