EIPs Explained

EIP-8057 · Draft · Core · 2025-10-20

EIP-8057: Inter-Block Temporal Locality Gas Discounts

Discounts the cold-access surcharge for accounts and storage slots that were touched in the last 32 blocks, using block-level access lists so the discount is deterministic and known in advance.

What problem does it solve?

Since EIP-2929, the first touch of an account or storage slot in a transaction pays a large "cold" surcharge (2600 for accounts, 2100 for slots) because it might require a disk read. That models the worst case well.

In practice, clients keep recently accessed state in memory caches, and popular contracts are touched again and again within a few blocks. Those accesses are much cheaper for the node than the gas schedule says. Because gas must cover the worst case, this gap limits how far the gas limit can rise. EIP-8057 prices the common case more accurately without touching the worst case.

How it works

  • For the first access in a transaction to an account or storage slot, look up the most recent earlier block (within WINDOW_SIZE_BLOCKS = 32) in which it was accessed.
  • The block distance D determines a discount on the cold surcharge using a reversed smoothstep curve: full discount at D = 1 (charged like a warm access), falling smoothly to zero at D = 32.
  • Beyond the window, or if never seen, normal cold pricing applies.
  • Same-transaction warming and EIP-2930 access lists work as today; items pre-warmed by an access list get no extra discount. Precompiles are unaffected.
  • It is a discount on what is charged, not a refund.

The history comes from block-level access lists (EIP-7928), which commit to the accounts and slots each block touched. A freshly synced node only needs the access lists of the previous 32 blocks to price the next one, with no historical re-execution.

Sample code

Discount calculation (floating point for clarity; consensus code must use integers):

WINDOW = 32
COLD_SLOAD_SURCHARGE = 2100
WARM = 100

def smoothstep(x: float) -> float:
    x = max(0.0, min(1.0, x))
    return x * x * (3.0 - 2.0 * x)

def sload_first_access_cost(distance: int) -> int:
    if distance < 1 or distance > WINDOW:
        discount = 0
    else:
        x = (distance - 1) / (WINDOW - 1)
        discount = round(COLD_SLOAD_SURCHARGE * (1.0 - smoothstep(x)))
    return WARM + max(0, COLD_SLOAD_SURCHARGE - discount)

sload_first_access_cost(1)   # 100  (warm price)
sload_first_access_cost(32)  # 2200 (normal cold price)

Things to know

  • Status: Draft. The Glamsterdam repricing directory (EIP-8007) lists it as declined for inclusion in that fork.
  • Wallets should not assume a discount when estimating gas, because the landing block is uncertain. The spec recommends pricing as if no discount applies.
  • Operators who can reliably target a specific block might plan around exact discounts, but the spec calls this an advanced, non-default case.
  • Clients need a rolling index of the last 32 blocks' access lists; reorgs deeper than the window are handled like a resync.

#gas #storage #repricing #state-access #core

Details

Authors
Ben Adams (@benaadams), Toni Wahrstätter (@nerolation), Maria Inês Silva (@misilva73), Amirul Ashraf (@asdacap)
Status
Draft
Type
Standards Track / Core
Created
2025-10-20
Requires
Required by

Machine-readable: Markdown · JSON