Skip to content

feat: use hardcoded zero value for base fee per gas (#5023)#5034

Open
jasuwienas wants to merge 4 commits intomainfrom
5023-basefeepergas-should-be-always-0
Open

feat: use hardcoded zero value for base fee per gas (#5023)#5034
jasuwienas wants to merge 4 commits intomainfrom
5023-basefeepergas-should-be-always-0

Conversation

@jasuwienas
Copy link
Contributor

Description

base fee per gas value in block data response will be hardcoded to 0x0

Related issue(s)

Fixes #5023

Testing Guide

  1. Run tests
  2. Verify output

Changes from original design (optional)

N/A

Additional work needed (optional)

N/A

Checklist

  • I've assigned an assignee to this PR and related issue(s) (if applicable)
  • I've assigned a label to this PR and related issue(s) (if applicable)
  • I've assigned a milestone to this PR and related issue(s) (if applicable)
  • I've updated documentation (code comments, README, etc. if applicable)
  • I've done sufficient testing (unit, integration, etc.)

Signed-off-by: Mariusz Jasuwienas <jasuwienas@gmail.com>
@jasuwienas jasuwienas self-assigned this Mar 4, 2026
@jasuwienas jasuwienas added the enhancement New feature or request label Mar 4, 2026
@jasuwienas jasuwienas added this to the 0.76.0 milestone Mar 4, 2026
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Test Results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit a8830f3. ± Comparison against base commit 730d785.

♻️ This comment has been updated with latest results.

Signed-off-by: Mariusz Jasuwienas <jasuwienas@gmail.com>
Signed-off-by: Mariusz Jasuwienas <jasuwienas@gmail.com>
@jasuwienas jasuwienas marked this pull request as ready for review March 6, 2026 14:27
@jasuwienas jasuwienas requested review from a team as code owners March 6, 2026 14:27
@jasuwienas jasuwienas requested a review from acuarica March 6, 2026 14:27
Signed-off-by: Mariusz Jasuwienas <jasuwienas@gmail.com>
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 });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...c/lib/services/ethService/feeService/FeeService.ts 85.71% 1 Missing ⚠️
@@            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     
Flag Coverage Δ
config-service 98.65% <ø> (ø)
relay 92.27% <93.75%> (-0.02%) ⬇️
server 88.39% <ø> (ø)
ws-server 96.62% <ø> (-1.28%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/relay/src/lib/eth.ts 99.81% <100.00%> (+0.54%) ⬆️
packages/relay/src/lib/factories/blockFactory.ts 98.79% <100.00%> (-0.01%) ⬇️
packages/relay/src/lib/model.ts 94.64% <100.00%> (+0.05%) ⬆️
...ib/services/ethService/blockService/blockWorker.ts 95.07% <ø> (-0.03%) ⬇️
...c/lib/services/ethService/feeService/FeeService.ts 92.68% <85.71%> (-1.15%) ⬇️

... and 11 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

baseFeePerGas should be always 0

1 participant