Repository navigation
Implement EIP-8038: "State-access gas cost update" - #1731
Conversation
Merging this PR will improve performance by 2.71%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | baseline/analyse/main/sha1_shifts |
11.5 µs | 11.2 µs | +2.71% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing amsterdam/8038 (1baca41) with master (4029845)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1731 +/- ##
==========================================
- Coverage 97.99% 97.98% -0.01%
==========================================
Files 181 182 +1
Lines 16759 16778 +19
Branches 3827 3832 +5
==========================================
+ Hits 16423 16440 +17
- Misses 249 250 +1
- Partials 87 88 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
b52f025 to
ec55933
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The block RLP remains stale and Amsterdam authorization processing still uses legacy gas pricing.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (3)
What changed in this PR
Implements Amsterdam’s EIP-8038 state-access gas repricing across opcode execution, storage accounting, transaction costs, and tests.
Changes:
- Adds named account/storage access and write costs.
- Reprices calls, creation, self-destruct, EXTCODE operations, SSTORE, and access lists.
- Updates gas expectations and blockchain fixtures.
| File | Description |
|---|---|
lib/evmone/instructions_traits.hpp |
Defines EIP-8038 costs and opcode pricing. |
lib/evmone/instructions.hpp |
Applies account-access and SELFDESTRUCT charges. |
lib/evmone/instructions_calls.cpp |
Reprices calls and delegation access. |
lib/evmone/instructions_storage.cpp |
Updates SSTORE costs and refunds. |
test/state/state.cpp |
Reprices Amsterdam access lists. |
test/unittests/tooling_t8n_test.cpp |
Updates refund accounting expectation. |
test/unittests/state_transition_tx_test.cpp |
Updates access-list tests. |
test/unittests/state_transition_eip8037_state_gas_test.cpp |
Adjusts state-gas scenarios. |
test/unittests/state_transition_eip7778_block_gas_test.cpp |
Updates block-gas refund test. |
test/integration/evmone-cli/test/blockchaintest/eip7778_block_gas.json |
Updates expected block outputs. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
a908886 to
c9fd9f3
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Several consensus-critical gas schedules and OOG branches lack direct regression coverage.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (5)
Resolved since last review (1)
373e5b7 to
0e031dd
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Several consensus-critical Amsterdam gas paths lack direct boundary tests.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (7)
Update EIP-7702 authorization gas accounting for Amsterdam Cover Amsterdam SELFDESTRUCT charge and beneficiary conditions · New Pin Amsterdam gas costs for account reads and value calls · New Add Amsterdam opcode pricing boundary tests Extend storage refund schedule tests for Amsterdam Test Amsterdam SELFDESTRUCT gas charging and OOG ordering Add Amsterdam EXTCODE warm and cold gas tests
Reprice state access and split it into access and write components. https://eips.ethereum.org/EIPS/eip-8038 - COLD_ACCOUNT_ACCESS rises 2600 -> 3000; COLD_STORAGE_ACCESS (2100) and WARM_ACCESS (100) are unchanged. - New ACCOUNT_WRITE (9000) prices account mutations: CALL_VALUE becomes ACCOUNT_WRITE + CALL_STIPEND (11300), SELFDESTRUCT sending a balance to a dead beneficiary pays it, and CREATE/CREATE2 pay CREATE_ACCESS (12000) in place of the flat 32000. - New STORAGE_WRITE (10000) makes the first SSTORE change to a slot cost 10100 for both set and reset, its cold surcharge now matches SLOAD, and the clear refund becomes 11616. - EXTCODESIZE and EXTCODECOPY pay an extra WARM_ACCESS for their second database read. - Access-list entries cost 2900 per address and 2000 per storage key.
0e031dd to
1baca41
Compare
|
@codspeedbot explain why performance improved |
Short answer: this one is not caused by your change — it is a runner-environment artifact, and the +2.71% should be ignored. What the profiles show Comparing the flamegraphs of
The entire gain comes from glibc's allocator; the evmone code in the benchmark is unchanged. Why the environment differs The comparison report flags a toolchain difference between the two runs: the build IDs of Why the PR cannot affect this benchmark anyway The diff touches only Nothing to fix here, and no changes were pushed to the branch. Summary
Was this response helpful? React with 👍 or 👎 to help us improve CodSpeedBot. |
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Consensus-critical gas accounting changes require final human validation against the EIP specification and execution tests.
Review effort: Balanced
Findings: None
Resolved since last review (7)
Update EIP-7702 authorization gas accounting for Amsterdam Pin Amsterdam gas costs for account reads and value calls Cover Amsterdam SELFDESTRUCT charge and beneficiary conditions Add Amsterdam opcode pricing boundary tests Extend storage refund schedule tests for Amsterdam Test Amsterdam SELFDESTRUCT gas charging and OOG ordering Add Amsterdam EXTCODE warm and cold gas tests



Reprice state access and split it into access and write components.
https://eips.ethereum.org/EIPS/eip-8038
and WARM_ACCESS (100) are unchanged.
ACCOUNT_WRITE + CALL_STIPEND (11300), SELFDESTRUCT sending a balance
to a dead beneficiary pays it, and CREATE/CREATE2 pay CREATE_ACCESS
(12000) in place of the flat 32000.
cost 10100 for both set and reset, its cold surcharge now matches
SLOAD, and the clear refund becomes 11616.
second database read.