Skip to content

EIP-8038 — State-access gas ​

EIP-8038State-access gas

Runnable

Live on the hosted MCP — free on Amsterdam. Connect an agent and ask.

Amsterdam (Glamsterdam) vs FusakaRuns withrun_bytecoderun_transaction

What became possible ​

When you SSTORE on Glamsterdam, what are you paying for — touching the slot, changing it, or creating it?

EIP-8038 splits state-touching costs into touch (load), change (write), and create (new leaf). Cold storage access stays 2,100. The write surcharge on an existing slot is STORAGE_WRITE 10,000 (was about 2,800). Creating a slot is still EIP-8037 state gas (about 97,920). EXTCODESIZE / EXTCODECOPY pay an extra warm read.

The MCP server runs your program. It does not ship demo bytecode.

  • Touch / EXTCODESIZE: Run bytecode — call-frame gasUsed.
  • SSTORE write (change): Run bytecode. Existing-slot cold write is about 5,006 vs 12,106. Seed accounts[].storage on 0x00000000000000000000000000000000000000b1.
  • SSTORE create vs change (paid / state gas): Run transaction with code at to. On Glamsterdam, txStateGas is 0 for an existing slot and about 97,920 for a new one. On bytecode, new-slot Glamsterdam sets stateGasSpilled 97,920 (gasUsed includes the spill).

Try asking your agent ​

The hosted MCP is live (Connect). Copy a prompt into your agent — each quote is self-contained.

Job

Amsterdam

On Glamsterdam, run bytecode that cold SSTOREs 9 into storage slot 1 when slot 1 already holds 7 — prefund slot 1 with 7 on the contract first. How much gas does the call use?

Look forcall gas near 12,106 for the existing-slot write

Agent will likely call run_bytecode

Lesson

Fusaka vs Amsterdam

Cold SSTORE 9 into storage slot 1 when slot 1 already holds 7 — prefund slot 1 with 7 on the contract, run on Fusaka and on Glamsterdam, and compare call gas.

Look forabout 5,006 vs 12,106

Agent will likely call run_bytecode

Check

Amsterdam

On Amsterdam, SSTORE the same value into the same slot twice in one bytecode run — do you pay STORAGE_WRITE twice?

Agent will likely call run_bytecode

What the server does ​

  1. Discover support

    Confirm the 8038 catalog row; tools include run_bytecode and run_transaction.

  2. Run bytecode

    SLOAD / EXTCODESIZE / SSTORE program gas on fusaka then glamsterdam; read gasUsed (and stateGasSpilled on a new slot).

  3. Run transaction

    Paid SSTORE code at to when you need txStateGas; seed accounts[].storage for an existing slot.

Seed storage (existing slot) on run_bytecode — put slots on the lab execution account:

json
{
  "bytecode": "<your SSTORE program>",
  "accounts": [
    {
      "address": "0x00000000000000000000000000000000000000b1",
      "storage": [{ "slot": "0x03", "value": "0x01" }]
    }
  ],
  "fork": { "baseHardfork": "glamsterdam" }
}

For paid txStateGas, use run_transaction with code at to and accounts[].storage on that to. Omit storage for a new empty slot. Repeat with "baseHardfork": "fusaka".

Fork caveat

Run the same program twice — fusaka (baseline), then glamsterdam (preview). Glamsterdam already bundles EIP-8038 in EthereumJS v10. Passing eips: [8038] is accepted but is not a pre/post toggle.

Paid gasUsed on a transaction is not a clean 5,006 vs 12,106 — it includes 21,000 intrinsic and EIP-2780 recipient access. Lead with call-frame gasUsed on run_bytecode for the write jump, and txStateGas / stateGasSpilled for create vs change. Cold SLOAD stays 2,103. EXTCODESIZE is about 2,603 vs 3,103.

Twins and spec ​

Canonical spec
EIP-8038
Spec date
2026-08-04
Coverage index
EIP catalogue
EIP-8038 MCP Catalogue Changelog
EIP-8038 MCP Catalogue Changelog
  1. v0.32026-09-14run_bytecode is a VM message-call — SSTORE program gas in-call; seed storage on the lab execution account; txStateGas still run_transaction.
  2. v0.22026-09-14Named catalog row — SLOAD/EXTCODESIZE via run_bytecode; SSTORE via run_transaction with optional accounts[].storage; txStateGas for create vs change.
  3. v0.12026-09-11Exploration twin — simulate gasUsed already shows the SSTORE write jump; named catalog row follows with the engine module.

Get started = connect and ask questions. Reference = catalogues and tool schemas. Internals = for builders.