EIPs Explained

EIP-7707 · Stagnant · Core · 2024-05-12

EIP-7707: Incentivize Access List Provisioning

Proposed cutting the gas price of EIP-2930 access-list entries to calldata-like levels so senders would actually supply them and clients could prefetch state in parallel.

What problem does it solve?

EIP-2930 lets a transaction declare up front which addresses and storage slots it will touch (an access list). In principle this is great for clients: knowing what to load in advance lets them fetch state from disk in parallel instead of one random read at a time, which matters because for some clients data loading dominates block execution time.

In practice almost nobody uses access lists, because the pricing rarely pays off. Each listed address costs 2,400 gas and each storage key 1,900 gas, while pre-warming saves only 100 gas per key versus a cold SLOAD. Per the spec's analysis, you need about 24 keys per address just to break even, and a single unused key costs far more than the savings. Since a slightly different execution path can change which slots are touched, senders see access lists as a risk.

EIP-7707 proposes to make access lists cheap enough that including a complete one is the obvious choice.

How it works

The proposal changes only two constants from EIP-2930:

Constant EIP-2930 EIP-7707
ACCESS_LIST_ADDRESS_COST 2400 512
ACCESS_LIST_STORAGE_KEY_COST 1900 320

The new values price access-list bytes like calldata: bytes × 4 tokens × 4 gas per token, giving 32 × 16 = 512 for an address entry and 20 × 16 = 320 for a key, as computed in the spec. The cold/warm access rules for SLOAD and friends are unchanged; only the up-front charge for declaring entries shrinks.

With these values, the spec's example of one cold SLOAD declared in the access list drops from 4,400 gas total to 932, which is cheaper than the 2,100 gas of an undeclared cold read.

Sample code

Generating an access list with a node's eth_createAccessList and attaching it to a type-1 or type-2 transaction (ethers v6):

import { JsonRpcProvider, Wallet } from "ethers";

const provider = new JsonRpcProvider(process.env.RPC_URL);
const wallet = new Wallet(process.env.PRIVATE_KEY!, provider);

const req = { from: wallet.address, to: target, data: calldata };
const { accessList } = await provider.send("eth_createAccessList", [req, "latest"]);

const tx = await wallet.sendTransaction({
  ...req,
  type: 2,
  accessList, // [{ address, storageKeys: [...] }, ...]
});
await tx.wait();

Today this only saves gas for heavy storage readers; EIP-7707's pricing would make it worthwhile for ordinary transactions too.

Things to know

  • Status is Stagnant. These prices are not live on any network.
  • An earlier attempt, EIP-3521, proposed cutting only the address cost; it is also stagnant.
  • Protocol direction has since gone the other way: EIP-7981 proposes raising access-list cost so it cannot be used as cheap data, while EIP-7928 introduces block-level access lists produced by the block builder rather than each sender.
  • Access lists only help when they are accurate; a node-generated list can go stale if state changes before inclusion.

#gas #access-list #transactions #performance #core

Details

Authors
Ben Adams (@benaadams), Oleg Iakushkin (@OlegJakushkin)
Status
Stagnant
Type
Standards Track / Core
Created
2024-05-12
Requires

Machine-readable: Markdown · JSON