Skip to content

fix(spec-specs): carry excess blob gas across fork transitions - #3352

Merged
spencer-tb merged 1 commit into
ethereum:forks/amsterdamfrom
spencer-tb:fix-excess-blob-gas-transition
Aug 12, 2026
Merged

spencer-tb merged 1 commit into
ethereum:forks/amsterdamfrom
spencer-tb:fix-excess-blob-gas-transition

Conversation

@spencer-tb

@spencer-tb spencer-tb commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

calculate_excess_blob_gas only reads the parent's blob gas fields when the parent is the current fork's own Header. At a fork boundary the parent is the previous fork's header type, so chain validation zeroes any accumulated excess blob gas at the transition block. Clients carry it across the boundary, so EELS rejects correct chains at every post-Cancun transition. The path is unreachable through t8n, which builds the parent from the env as the current fork's class, so fills and fixtures were always correct.

The fix widens the check to also accept the previous fork's header, on every fork whose predecessor carries the fields (prague through amsterdam). Cancun keeps the zeroing, since its shanghai parent has no blob gas fields.

Demonstration at the BPO5 to Amsterdam boundary, with a parent at excess_blob_gas=10000000 and blob_gas_used=786432:

  • before: calculate_excess_blob_gas(parent) returns 0
  • after: it returns 8951424

Receipts:

  • Existing coverage already pins the carried value in fixtures: test_fork_transition_excess_blob_gas_post_blob_genesis runs at the transition to Prague and every later fork and verifies the fork block header. Those fixtures were always correct. This change fixes the chain validation half so EELS accepts them.
  • 2706 blob fixtures fill byte for byte identically before and after the fix.
  • ethereum-spec-lint, full mypy and just static are clean.

Found while reviewing projects/zkevm, which carries the same fix for amsterdam.

Adding @jsign for credit, added as a co-author.

Related Issues or PRs

N/A.

Checklist

  • Ran fast static checks to avoid CI fails, see Code Standards & Verifying Changes: just static
  • PR title has the form <type>(<area>): <title>, where <type> and <area> come from an appropriate C-<type>, respectively A-<area>, label. The title should match the target squash commit message.

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@spencer-tb
spencer-tb force-pushed the fix-excess-blob-gas-transition branch from 99ed065 to f27845d Compare August 11, 2026 12:15
@spencer-tb spencer-tb added A-spec-specs Area: Specification—The Ethereum specification itself (eg. `src/ethereum/*`) C-bug Category: this is a bug, deviation, or other problem labels Aug 11, 2026
@spencer-tb
spencer-tb requested a review from gurukamath August 11, 2026 12:15
@spencer-tb
spencer-tb marked this pull request as ready for review August 11, 2026 12:15
@spencer-tb
spencer-tb force-pushed the fix-excess-blob-gas-transition branch from f27845d to feac431 Compare August 11, 2026 12:16
Co-authored-by: jsign <6136245+jsign@users.noreply.github.com>
@spencer-tb
spencer-tb force-pushed the fix-excess-blob-gas-transition branch from feac431 to 4d5c575 Compare August 11, 2026 12:17
@codecov

codecov Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.53%. Comparing base (5b2b22c) to head (4d5c575).

Files with missing lines Patch % Lines
src/ethereum/forks/amsterdam/vm/gas.py 0.00% 0 Missing and 1 partial ⚠️
src/ethereum/forks/osaka/vm/gas.py 66.66% 0 Missing and 1 partial ⚠️
src/ethereum/forks/prague/vm/gas.py 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           forks/amsterdam    #3352   +/-   ##
================================================
  Coverage            93.53%   93.53%           
================================================
  Files                  624      624           
  Lines                37070    37072    +2     
  Branches              3394     3394           
================================================
+ Hits                 34675    34677    +2     
  Misses                1645     1645           
  Partials               750      750           
Flag Coverage Δ
unittests 93.53% <57.14%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@spencer-tb

Copy link
Copy Markdown
Contributor Author

Don't merge without ack from @jsign please!

@spencer-tb
spencer-tb merged commit 2867859 into ethereum:forks/amsterdam Aug 12, 2026
23 of 24 checks passed
ilitteri pushed a commit to lambdaclass/execution-specs that referenced this pull request Aug 13, 2026
…eum#3352)

Co-authored-by: jsign <6136245+jsign@users.noreply.github.com>
MysticRyuujin pushed a commit to MysticRyuujin/ethrex that referenced this pull request Aug 24, 2026
…aclass#7159)

**Motivation**

`tests-glamsterdam-devnet@v8.1.1` is out — a coverage and
fixture-exception-mapping follow-up to v8.1.0, [announced with no spec
changes](https://github.com/ethereum/execution-specs/releases/tag/tests-glamsterdam-devnet@v8.1.1).

**Description**

Moves `tooling/ef_tests/.fixtures_url_amsterdam` and
`.github/config/hive/amsterdam.yaml` (`fixtures` + `eels_commit`) to
v8.1.1. Both, together: grading one release's client against another
release's bundle fails every fixture the two disagree on, which is what
produced 2168 hive failures when only the ef-test pin moved to v8.1.0.
`eels_commit` is `32f597f7`, which is both the v8.1.1 tag and the tip of
`devnets/glamsterdam/8`.

No client change was needed.

**Verified the "no spec changes" claim rather than assuming it.** For
the numbers it holds — the `forks/amsterdam` diff is a `Uint` →
`ExecutionGas(Uint(..))` type-wrapper refactor with every value
identical. One behaviour did change:

```python
-    if isinstance(parent_header, Header):
-        # After the fork block, read them from the parent header.
+    if isinstance(parent_header, (Header, PreviousHeader)):
+        # Read them from any parent that carries the fields, so
+        # accumulated excess blob gas survives a fork transition.
```

`calculate_excess_blob_gas` no longer resets excess blob gas to zero at
a fork block
([specs#3352](ethereum/execution-specs#3352)).
ethrex already behaved that way — `calc_excess_blob_gas` reads the
parent's blob fields unconditionally, with no fork-boundary case — so
this is the spec catching up to clients, and the
`for_bpo2toamsterdamattime15k` transition fixtures pass unchanged.

**How to test**

```
make -C tooling/ef_tests/blockchain test-levm
make -C tooling/ef_tests/engine test
make -C tooling/ef_tests/state run-evm-ef-tests-ci
```

Results on this branch:

| suite | result |
|---|---|
| blockchain | **11752 passed, 0 failed** |
| engine | **11020 passed, 0 failed** |
| state | **64740 passed, 0 failed** (8983 groups, 201792/201792
vectors, none below 100%) |

The coverage this release adds passes as filled, including the new BAL
storage-slot numeric-ordering fixture
([specs#3382](ethereum/execution-specs#3382))
and the un-skipped Amsterdam ported-static create-OOG and
depth-recursion tests
([specs#3320](ethereum/execution-specs#3320),
[specs#3264](ethereum/execution-specs#3264)).

Already live on `glamsterdam-devnet-8` (`59befe28d`).

**Checklist**

- [x] No `Store` schema change, so `STORE_SCHEMA_VERSION` is untouched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-spec-specs Area: Specification—The Ethereum specification itself (eg. `src/ethereum/*`) C-bug Category: this is a bug, deviation, or other problem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants