EIPs Explained

EIP-8295 · Draft · Core · 2026-06-10

EIP-8295: State Tiering by Periods

Charges extra gas to write state that has not been written for a long time, using EIP-8188's last-written block, so long-untouched state carries an ongoing cost without any deletion.

What problem does it solve?

Today every write to existing state costs the same, whether the slot was last changed a minute ago or five years ago. In practice they are not the same for a node: recently written state tends to live in the fast "working set", while long-untouched state sits on slower database paths with deeper lookups and more write overhead. A flat price overcharges the active set and undercharges reviving old state.

There is also a fairness issue. Once state is created it lives forever, and node operators pay to store and index it with no ongoing contribution from whoever created it. Clients could track write age locally, but a local heuristic cannot be priced: an attacker could deliberately touch lots of old state to make every node do expensive work.

EIP-8188 adds consensus metadata, last_written_block, recording when each account and storage slot was last written. EIP-8295 turns that metadata into a price.

How it works

  • Periods. Block numbers are bucketed into coarse periods of PERIOD_LENGTH blocks, counted from the fork block. The target duration mentioned in the rationale is about six months; the exact constants are still TBD.
  • Two tiers. If current_period - last_written_period < INACTIVE_MIN_AGE, an item is Active; otherwise it is Inactive.
  • Surcharge, not replacement. Writing an existing Inactive account adds INACTIVE_ACCOUNT_WRITE_SURCHARGE; changing an existing Inactive storage slot adds INACTIVE_STORAGE_WRITE_SURCHARGE. Normal gas from EIP-8038 and EIP-8037 still applies. Active writes are not repriced, and reads are unchanged.
  • What gets hit. SSTORE to an existing slot (the slot plus its account, since storageRoot changes), value transfers (sender and receiver), nonce bumps, the creator of CREATE/CREATE2, and the authority in an EIP-7702 authorization.
  • Creation is exempt. New accounts, new slots and deployed code are never surcharged; their price comes from EIP-8037. Writing a new slot into a dormant contract still pays the account surcharge.
  • Once per block. The tier is checked before the write; the write then refreshes last_written_block, so the item becomes Active.
  • The surcharge is ordinary regular gas: non-refundable, still consumed if the frame reverts (and the item stays Inactive), and counted against the EIP-7825 per-transaction cap.

Renewal tiers are separate from EIP-2929 warm/cold. Pre-warming a slot through an access list does not avoid the write surcharge.

Sample code

Tier logic from the spec (constants TBD):

def period_of(block_number: int) -> int:
    return max(0, (block_number - PERIOD_START_BLOCK) // PERIOD_LENGTH)

def write_surcharge(kind: str, last_written_block: int, block_number: int) -> int:
    age = period_of(block_number) - period_of(last_written_block)
    if age < INACTIVE_MIN_AGE:
        return 0  # Active: no extra cost
    return (INACTIVE_ACCOUNT_WRITE_SURCHARGE if kind == "account"
            else INACTIVE_STORAGE_WRITE_SURCHARGE)

# SSTORE changing an existing slot of an Inactive contract:
# normal cost + storage surcharge (slot) + account surcharge (storageRoot cascade)

Things to know

  • Status: Draft. PERIOD_LENGTH, INACTIVE_MIN_AGE and both surcharge values are still TBD, and test cases are not written yet.
  • It needs EIP-8188 (Draft) and must activate at or after the same fork.
  • eth_estimateGas implementations must look up each written item's last_written_block to estimate correctly. Contracts that rarely write storage may see higher one-off costs after long idle periods.
  • Rewriting state just to keep it Active is intended to cost something; the surcharge size has to balance that against mass speculative refreshes.
  • "Inactive" means not written recently. A slot read every block can still be Inactive, so clients should not treat the tier as a read-hotness signal.

#gas #state #state-expiry #repricing #core

Details

Authors
Wei Han Ng (@weiihann), Amirul Ashraf (@asdacap), Guillaume Ballet (@gballet), Maria Silva (@misilva73), Gary Rong (@rjl493456442), Carlos Perez (@CPerezz), Jochem Brouwer (@jochem-brouwer)
Status
Draft
Type
Standards Track / Core
Created
2026-06-10
Requires

Machine-readable: Markdown · JSON