Skip to content

feat: add experimental EIP-8038 support (Amsterdam) - #1887

Merged
anaPerezGhiglia merged 3 commits into
mainfrom
feat/eip-8038-state-access-cost
Oct 29, 2026
Merged

anaPerezGhiglia merged 3 commits into
mainfrom
feat/eip-8038-state-access-cost

Conversation

@anaPerezGhiglia

@anaPerezGhiglia anaPerezGhiglia commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

👀 Targets the feat/amsterdam-revm-upgrade feature branch, not main


Announces the EIP-8038 side of the revm 43 bump (#1847). revm's gas table prices the repriced operations and validates the values against the execution-spec fixtures; EDR only maps its hardfork to revm's spec id. No EDR code change: this PR adds tests that the repricing activates with the Amsterdam hardfork, plus the changeset.

Tests

data/contracts/test/StateAccess.sol (compiled to data/deployment_bytecode/StateAccess.bin) exposes noop(), readBalance() (an untouched account, so the access is cold) and write(uint256). An operation's cost is the gasUsed of calling its function less that of noop(), so intrinsic gas and solc overhead cancel out and the cost's change from Osaka to Amsterdam is the parameter's change in the EIP's table.

Every function first expands memory to 4,096 words. That keeps the EIP-3529 refund cap and the EIP-7976 calldata floor out of the measurements; without it, the floor binds for a bare noop() on Amsterdam and skews the baseline.

@changeset-bot

changeset-bot Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 73319d3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@nomicfoundation/edr Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

Static review identified no blocking issues in the focused gas-comparison tests, fixtures, or behavior-preserving helper extraction; tests were not executed.

No open issues 🎉

What changed in this PR

Adds regression tests and release notes for experimental EIP-8038 support on the Amsterdam feature branch. Gas repricing remains implemented by revm; this PR adds no EDR runtime logic.

Changes:

  • Tests cold account-access pricing and storage-clear refund changes between Osaka and Amsterdam.
  • Adds a Solidity fixture and compiled bytecode with memory expansion to avoid refund-cap and calldata-floor interference.
  • Extracts a shared transaction gas-measurement helper and adds a patch changeset.
File Description
data/​deployment_bytecode/​StateAccess.bin Compiled deployment bytecode for the test fixture.
data/​contracts/​test/​StateAccess.sol Provides baseline, balance-read, and storage-write operations.
crates/​edr_provider/​tests/​integration/​mod.rs Registers the EIP-8038 tests.
crates/​edr_provider/​tests/​integration/​eip8038.rs Checks gas-cost and refund changes at Amsterdam.
crates/​edr_provider/​tests/​integration/​eip2780.rs Reuses the shared gas-measurement helper.
crates/​edr_provider/​tests/​common/​provider.rs Adds the shared helper without changing its behavior.
.changeset/​eip8038-state-access-gas.md Announces experimental EIP-8038 support.

Review effort: Balanced

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.50%. Comparing base (16e44d9) to head (73319d3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1887   +/-   ##
=======================================
  Coverage   81.50%   81.50%           
=======================================
  Files         473      473           
  Lines       84050    84050           
  Branches    84050    84050           
=======================================
+ Hits        68508    68509    +1     
  Misses      13248    13248           
+ Partials     2294     2293    -1     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@anaPerezGhiglia
anaPerezGhiglia marked this pull request as ready for review October 23, 2026 13:55
@anaPerezGhiglia
anaPerezGhiglia requested a review from a team October 23, 2026 13:55
@anaPerezGhiglia
anaPerezGhiglia force-pushed the feat/amsterdam-revm-upgrade branch from 5e923dc to 2a528c5 Compare October 26, 2026 18:19
@anaPerezGhiglia
anaPerezGhiglia force-pushed the feat/eip-8038-state-access-cost branch from 63300e9 to 69c78dc Compare October 26, 2026 18:32
@anaPerezGhiglia
anaPerezGhiglia force-pushed the feat/amsterdam-revm-upgrade branch from 2a528c5 to ac6b64d Compare October 26, 2026 19:10
@anaPerezGhiglia
anaPerezGhiglia force-pushed the feat/eip-8038-state-access-cost branch from 69c78dc to 4292e04 Compare October 26, 2026 19:10
@anaPerezGhiglia
anaPerezGhiglia force-pushed the feat/amsterdam-revm-upgrade branch from ac6b64d to 0077d09 Compare October 26, 2026 19:19
@anaPerezGhiglia
anaPerezGhiglia force-pushed the feat/eip-8038-state-access-cost branch from 4292e04 to b3c6f18 Compare October 26, 2026 19:20
@anaPerezGhiglia
anaPerezGhiglia temporarily deployed to github-action-benchmark October 26, 2026 19:21 — with GitHub Actions Inactive
@anaPerezGhiglia
anaPerezGhiglia force-pushed the feat/eip-8038-state-access-cost branch from 8028c71 to 76fdc28 Compare October 26, 2026 19:58
@anaPerezGhiglia
anaPerezGhiglia temporarily deployed to github-action-benchmark October 26, 2026 19:58 — with GitHub Actions Inactive
@anaPerezGhiglia
anaPerezGhiglia temporarily deployed to github-action-benchmark October 26, 2026 20:36 — with GitHub Actions Inactive
@Wodann
Wodann removed the request for review from a team October 27, 2026 14:41
@Wodann
Wodann self-requested a review October 27, 2026 14:41
@anaPerezGhiglia
anaPerezGhiglia temporarily deployed to github-action-benchmark October 27, 2026 15:35 — with GitHub Actions Inactive
@anaPerezGhiglia
anaPerezGhiglia force-pushed the feat/amsterdam-revm-upgrade branch from 6253e3b to 4e66d4d Compare October 29, 2026 12:47
@Wodann Wodann changed the title Add experimental EIP-8038 support (Amsterdam) feat: add experimental EIP-8038 support (Amsterdam) Oct 29, 2026

@Wodann Wodann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM; thanks!

Two non-blocking suggestions and two nits inline. Feel free to merge without re-approval.

//! performing it, less the `gasUsed` of calling its `noop`, so the intrinsic
//! gas (also repriced in Amsterdam, by EIP-2780) and the contract's overhead
//! cancel out. The cost's change from Osaka to Amsterdam is then the
//! parameter's change in the EIP's table.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

suggestion (non-blocking): assert the STORAGE_WRITE repricing too, to match the claim in this sentence.

STORAGE_WRITE (2,800 → 10,000) is the largest change in the table, and storage_clear_refund already measures it. write_cost(2) after the seed is 5,389 on Osaka and 12,489 on Amsterdam. That delta is 7,100 rather than the 7,200 this rule predicts, because EIP-8038 folds the 100 warm base into the cold storage charge: 2,100 + 2,800 + 100 before, 2,100 + 10,000 after. So the rule holds for cold account access and the clear refund, but not in general.

Ideal change: a changing_a_slot_costs_more_from_amsterdam test that asserts the 7,100 delta with the warm-base fold written out in the constants.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed by 73319d3

Comment thread data/contracts/test/StateAccess.sol Resolved
Base automatically changed from feat/amsterdam-revm-upgrade to main October 29, 2026 16:49
@anaPerezGhiglia
anaPerezGhiglia force-pushed the feat/eip-8038-state-access-cost branch from 76fdc28 to c020f35 Compare October 29, 2026 17:16
@anaPerezGhiglia
anaPerezGhiglia temporarily deployed to github-action-benchmark October 29, 2026 18:02 — with GitHub Actions Inactive
@anaPerezGhiglia
anaPerezGhiglia temporarily deployed to github-action-benchmark October 29, 2026 18:38 — with GitHub Actions Inactive
@anaPerezGhiglia
anaPerezGhiglia temporarily deployed to github-action-benchmark October 29, 2026 18:38 — with GitHub Actions Inactive
@anaPerezGhiglia
anaPerezGhiglia merged commit 21098dc into main Oct 29, 2026
64 checks passed
@anaPerezGhiglia
anaPerezGhiglia deleted the feat/eip-8038-state-access-cost branch October 29, 2026 20:17

This branch was previously deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants