EIP-8435 Last written block stored in the PBT leaf (Last-Written Block in PBT Leaves)
No call decision · Scaling & data · EIP status Draft · created 2026-10-04
This embeds the block number at which an account or storage slot was last written (last_written_block) directly into the leaf value of the Partitioned Binary Tree (PBT). Accounts use the spare space in the existing BASIC_DATA leaf, and storage leaves grow from 32 bytes to 36 bytes.
Why it is needed
Ethereum has a proposal (EIP-8188) to create a consensus-verified record of when an account or storage slot was last written. State-tiering designs that treat long-unused state differently, such as EIP-8295, build on top of this record. However, EIP-8188 is defined in terms of the current state tree, the Merkle Patricia Trie (MPT): it adds a fifth element to the account RLP list and wraps slots in a two-element RLP list. The new state tree, the Partitioned Binary Tree (PBT, EIP-8297), has no RLP. Account fields are filled into fixed byte positions of the BASIC_DATA leaf, and slot leaves hold only a 256-bit value. So EIP-8188's encoding cannot be carried over as is, and a place for last_written_block in the PBT has to be defined separately. This proposal defines that place so tiering can run directly off the tree. However, like EIP-8188, it deals only with metadata, and aside from EIP-8037's state-creation gas adjustment, it does not change gas costs or tiering policy.
What changes
Today
- In the PBT, there is no record of when accounts and slots were last written
- last_written_block is defined by EIP-8188 only in terms of MPT's RLP encoding
- The account BASIC_DATA leaf has 3 reserved bytes and a 4-byte code_size
- A storage slot leaf's value is only the 32-byte slot value
After EIP-8435
- Every account and slot leaf carries the block number at which it was last written
- A dedicated encoding fitting PBT's fixed-offset scheme is created, usable regardless of whether EIP-8188 is activated
- The reserved bytes plus 1 byte trimmed from code_size form a 4-byte field, and the account leaf size stays the same
- The storage leaf becomes 36 bytes, with a 4-byte block number appended after the 32-byte value
Who is affected
- Client teams: The BASIC_DATA layout, storage leaf length, and deletion criteria change, so the state root changes. It must be implemented as a hard fork, and activating it in the same fork as EIP-8297 is recommended.
- Proof verifiers and light clients: They must handle the new BASIC_DATA layout and the 36-byte storage leaf. In exchange, a single standard inclusion proof lets them verify last_written_block against the state root as well.
- Contract developers and users: EVM behavior is unchanged. SLOAD still returns only the slot value, and there are no new opcodes. The only gas change is that state-creation gas increases by 4 bytes when a new slot is created.
- State-tiering researchers: Tiering designs such as EIP-8295 can now be driven from tree data alone. However, an account's field does not represent that account's storage write history as well.
In depth
Account encoding: relayout of BASIC_DATA
EIP-8297's BASIC_DATA leaf consists of version (1 byte), 3 reserved bytes, code_size (4 bytes), nonce (8 bytes), and balance (16 bytes). This proposal adds 1 byte trimmed from code_size to the 3 reserved bytes to fit a 4-byte last_written_block starting at offset 1. code_size becomes 3 bytes at offset 5, holding up to 2^24 - 1 (16,777,215) bytes, about 256 times EIP-7954's 64 KiB code size limit, so valid code can never exceed it. nonce and balance keep their offsets and widths unchanged. EIP-8297's rule of zeroing version and the reserved bytes when writing header fields is replaced with a rule that zeroes version while setting last_written_block only according to the update rules.
Storage encoding: the 36-byte leaf
Every storage slot leaf's value becomes STORAGE_LEAF_VALUE_LENGTH (36) bytes. The 32-byte slot_value sits at offset 0, in the same place as in EIP-8297, and a 4-byte big-endian last_written_block follows at offset 32. This applies identically to slots 0..63 stored in the account header stem (sub-index HEADER_STORAGE_OFFSET + storage_key) and to slots 64 and above in the STORAGE_ZONE, and storage keys are unchanged. Since all 256 bits of a slot are meaningful, unlike an account there is no spare byte to repurpose, so the leaf was widened instead. The alternative of a separate metadata leaf was ruled out because it would double the number of slot leaves, require separate keys and branches, and need to be kept in sync with the slot. With both values in one leaf, a single read, write, or proof handles both, and deletion, revert, and migration all happen together automatically.
Tree rule changes: length checks and deletion criteria
EIP-8297's state_root required len(value) == 32 for every entry; this proposal changes that to len(value) == value_length(key), which depends on the key. The Merkleization itself is unchanged: leaf_hash = H(LEAF_TAG || key || value). The rule that writing 32 bytes of zero counts as deletion now applies only to slot_value in storage leaves. If slot_value is 0, the leaf is deleted along with its metadata, and reading a non-existent slot returns 0. Account deletion still follows EIP-161 state clearing and EIP-6780's same-transaction SELFDESTRUCT as before, and whether an account is empty is judged only by nonce, balance, and code. An empty account must not survive just because last_written_block is non-zero. The EIP-7610 check for non-empty storage is also unchanged.
Update rules: slots and accounts move independently
When state changes, the affected leaf's last_written_block is set to the current block_number, and rewrites within the same block are idempotent. The only difference from EIP-8188 is that storage writes do not touch the account's fields. In the MPT, the account RLP contains storageRoot, so a storage write rewrites the account leaf anyway, but the PBT has no storage_root, so adding a cascade would add a BASIC_DATA rewrite every block that the tree did not originally make. The account-side rules are: non-zero balance transfers (both sender and receiver), nonce increments (including setting and clearing EIP-7702 delegation), a fee recipient receiving a non-zero priority fee, an EIP-4895 withdrawal recipient, new account creation, and balance moves from SELFDESTRUCT under EIP-6780. Pure reads never update it, and on revert the leaf is restored to its previous value together with the balance, nonce, and storage on that same leaf.
Retrieval: the leaf alone is enough to verify
Because last_written_block is part of the leaf's committed value, reading the leaf alone is enough, with no transaction execution or separate index needed. A lookup is a pure read that does not change state, and the leaf is read the same way wherever it lives, whether in the primary database, cold storage, a snapshot, or a block witness. Since leaf_hash covers this field, a single standard EIP-8297 inclusion proof is enough to verify it against the state root, letting light clients and stateless validators confirm it without trusting a node. There are no new opcodes, it is invisible to contracts, and retrieval happens at the client, RPC, or proof level. JSON-RPC exposure is allowed but standardizing it is out of scope. State that predates activation returns 0 until its first write. Code-zone leaves and the CODE_HASH_LEAF_KEY and DELEGATION_LEAF_KEY leaves do not have fields of their own.
Choosing and limiting the fixed 4-byte width
EIP-8188's RLP integer uses only as many bytes as needed and automatically becomes 5 bytes after block 2^32 - 1, but the PBT uses fixed offsets, so the width has to be decided once up front. 3 bytes (2^24 - 1 = 16,777,215) is already smaller than the current mainnet block height and is insufficient, and 4 bytes is the maximum that BASIC_DATA can spare without touching nonce or balance. Among the candidates for giving up bytes, nonce has a consensus-level cap set by EIP-2681 at 2^64 - 1, and narrowing balance's width would create a new consensus cap. Only code_size could be narrowed, since its protocol limit (64 KiB) is far smaller than the field's width. The storage leaf could have been widened further, but it uses the same 4 bytes so that it is stored the same way as the account. Because this field cannot grow on its own, the width will need to be widened in a separate fork before mainnet reaches block 2^32 (about 1,600 years away at a 12-second slot time, or about 800 years away at a 6-second slot time).
Impact on gas and state size
EIP-8037's STATE_BYTES_PER_STORAGE_SET increases by LAST_WRITTEN_BLOCK_SIZE (4), tracking the larger leaf size so that the state-creation gas for a new slot keeps pace. Account leaves do not grow, so STATE_BYTES_PER_NEW_ACCOUNT stays the same, and there are no other gas changes. No new write operation is added either, so every update rides along with a write that has already been paid for. At roughly 1.5 billion slots (EIP-8188's early-2026 estimate), this adds about 6GB of raw data, which is less than the roughly 9GB that EIP-8188 adds through 6-byte RLP framing. Storage slot proofs grow by 4 bytes per slot, while account proofs stay the same. Based on BLAKE3 in the EIP-8297 reference implementation, the leaf hash preimage input is 71 or 103 bytes, which still fits into two 64-byte blocks without increasing the number of compressions, though this should be rechecked once the Merkleization hash is finalized.
Current status: Draft, recommended for the same fork as EIP-8297
This proposal requires a hard fork, because the BASIC_DATA layout, storage leaf length, and deletion determination all affect the state root. The specification recommends activating it in the same fork as EIP-8297. Activating it later would require rewriting every BASIC_DATA leaf, since the code_size position would change, and every storage leaf, since the value would widen. It does not require EIP-8188 and can be activated independently regardless of whether EIP-8188 is activated on the MPT. The document status is Draft, so the content may still change, and no decision has yet been made in core developer calls to include it in a specific fork.