Repository navigation
fix(test-forks): keep base fee change gas within the parent gas limit - #3760
Merged
spencer-tb merged 1 commit intoOct 13, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/bogota #3760 +/- ##
=============================================
Coverage 94.98% 94.98%
=============================================
Files 673 673
Lines 40831 40831
Branches 3747 3747
=============================================
Hits 38785 38785
Misses 1429 1429
Partials 617 617
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
spencer-tb
force-pushed
the
fix/base-fee-change-gas-limit
branch
from
October 13, 2026 19:46
bfef8da to
aa3884f
Compare
Contributor
|
Thanks @erkancamli! Pushed a small follow-up so unreachable base fees fail instead of returning out-of-block gas. |
spencer-tb
approved these changes
Oct 13, 2026
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_change_calculator(EIP-1559 fork helper) can return more gas than the parent gas limit when the parent base fee is below 8.For an increase, the estimate assumes the proportional change
parent_base_fee * (gas_used - target) / target / 8. Below a base fee of 8 that term rounds down to zero, and the spec'smax(..., 1)incalculate_base_fee_per_gasraises the base fee by exactly 1 for any block above target. The estimate ignores that floor, so for the framework's default base fee of 7 and a 30M gas limit it returns 32,142,857 gas, and from a base fee of 1 it returns 135M. The final check only compares the resulting base fee, so the impossible value is returned silently.This clamps the estimate to
parent_gas_limit, where a full block reaches the increase. Results that already fit within the limit are unchanged, so no existing fixtures change. #3721 recently fixed rounding in the same helper; its tests use base fees of 20 and above, which is why this case was not covered.test_base_fee_change_calculator_minimum_increasecovers London and Amsterdam at parent base fees 1, 7 and 8: 4 cases fail onforks/bogotaand all pass with the fix. The wholeforks/testssuite passes (248 tests). ruff, ruff format, mypy and codespell are clean on the changed files.Related Issues or PRs
Related to #3721.
Checklist
justis not available in my environment)<type>(<area>): <title>