EIPs Explained

EIP-3584 · Stagnant · Core · 2021-05-22

EIP-3584: Block Access List

A stagnant proposal to collect every address and storage key touched in a block into a canonical, sorted access list and commit to it in the block header, enabling parallel execution and partial sync.

What problem does it solve?

After Berlin, EIP-2929 made the first access to an account or storage slot in a transaction expensive, and EIP-2930 let transactions declare an access_list up front to pre-load those locations. Clients therefore already track every address and slot each transaction touches.

EIP-3584 proposes taking that one step further: build a block-level access list covering all transactions, and put a commitment to it in the header. That gives clients an index of what the block reads and writes, which could be used to:

  1. Execute non-conflicting transactions in parallel and warm caches ahead of time.
  2. Let light or fast sync fetch and serve only the parts of a block relevant to certain addresses.
  3. Later, bundle witness data for stateless clients.

How it works

The block access list is a list of entries, one per address touched in the block:

access_list           := [access_list_entry, ...]          # sorted by address
access_list_entry     := [address, storage_keys, accesses_by_txn_index]
storage_keys          := [storage_key, ...]                # all keys of this address in the block, sorted
accesses_by_txn_index := [[txn_index, storage_keys], ...]  # sorted by txn_index

Each address, key and transaction index may appear only once in its list, and all sorting is ascending, so every honest client builds exactly the same list.

The header carries an AccessListRoot, written as a URN-like string so the scheme can change later:

urn:sha256:json:0x<SHA256 of the canonical access_list serialized as JSON>

A block is valid only if its AccessListRoot matches the list produced by executing it. The rationale suggests a Merkle, Verkle or KZG commitment could replace the plain hash later to allow partial verification.

Sample code

Building the canonical list and root from per-transaction accesses (TypeScript, Node):

import { createHash } from "node:crypto";

type TxAccess = Map<string, Set<string>>; // address -> storage keys

function blockAccessList(txs: TxAccess[]) {
  const byAddr = new Map<string, Map<number, Set<string>>>();
  txs.forEach((acc, i) => acc.forEach((keys, addr) => {
    if (!byAddr.has(addr)) byAddr.set(addr, new Map());
    byAddr.get(addr)!.set(i, keys);
  }));
  return [...byAddr.keys()].sort().map((addr) => {
    const perTx = byAddr.get(addr)!;
    const all = new Set([...perTx.values()].flatMap((k) => [...k]));
    return [
      addr,
      [...all].sort(),
      [...perTx.keys()].sort((a, b) => a - b).map((i) => [i, [...perTx.get(i)!].sort()]),
    ];
  });
}

const list = blockAccessList(txAccesses);
const root = "urn:sha256:json:0x" + createHash("sha256").update(JSON.stringify(list), "utf8").digest("hex");

Things to know

  • Status is Stagnant; it was never scheduled for a fork.
  • The JSON-string serialization is underspecified (for example, hex casing and number encoding are not pinned down), so two implementations could produce different roots. Treat the snippet above as illustrative.
  • The block-level access list idea was later revived in EIP-7928 (Block-Level Access Lists), which is the proposal to follow today.
  • Generating and storing the list over JSON-RPC without the header commitment was described as optional and client-dependent.

#core #access-list #block-header #parallelization #stateless

Details

Authors
Gajinder Singh (@g11in), Piper Merriam (@pipermerriam)
Status
Stagnant
Type
Standards Track / Core
Created
2021-05-22
Requires

Machine-readable: Markdown · JSON