Repository navigation
feat: add experimental EIP-8038 support (Amsterdam) - #1887
Conversation
🦋 Changeset detectedLatest commit: 73319d3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
994a569 to
63300e9
Compare
There was a problem hiding this comment.
🟢 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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
5e923dc to
2a528c5
Compare
63300e9 to
69c78dc
Compare
2a528c5 to
ac6b64d
Compare
69c78dc to
4292e04
Compare
ac6b64d to
0077d09
Compare
4292e04 to
b3c6f18
Compare
8028c71 to
76fdc28
Compare
6253e3b to
4e66d4d
Compare
Wodann
left a comment
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
76fdc28 to
c020f35
Compare
👀 Targets the
feat/amsterdam-revm-upgradefeature branch, notmainAnnounces 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 todata/deployment_bytecode/StateAccess.bin) exposesnoop(),readBalance()(an untouched account, so the access is cold) andwrite(uint256). An operation's cost is thegasUsedof calling its function less that ofnoop(), 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.