EIP-8297: Partitioned Binary Tree

Abstract

Introduce a new binary state tree to replace the hexary Patricia tries. Account and storage tries are merged into a single tree with 32-byte keys that also holds contract code. Account data is broken into independent leaves grouped by 256 to provide locality.

The tree is partitioned into zones. The high 4 bits of every key are a zone identifier that labels the category of state the key holds: account headers, contract code, or storage. Storage takes the entire upper half of the zone space (any key with the high bit set), so it is rooted at depth 1 and occupies about half the tree. Account headers and code take fixed low zones, and the remaining low zones are reserved for future categories.

Note: the hash function used in this draft is not final. The reference implementation uses BLAKE3 to reduce friction for clients experimenting with this EIP, but the choice remains open.

1 Like

Zero deletions meaning that state have to persist zero values for nullified addresses, otherwise node executed blocks from hardfork/genesis, and node which independently takes latest chain state will get different roots.

EIP-6780 supposes account deletion after CREATE2 call

Transaction T:
  CREATE2(address A)
  A.SELFDESTRUCT(...)

A should be not present

In MPT we can delete accounts along with their storage subtries - those become unreachable and state root differs.

even though we could consider that node just not supposed to be able to re-execute whole chain (pre Cancun) and case above is obsolete, 7702 authorization whose delegation address is zero clears the authorizing EOA’s 23-byte delegation designator, which fits into account header.

So, at least, one edge case. Its easy to catch and run code chunks zeroficatoin. But in general, its an attack surface, and code hash change doesnt catch that - chunks are not tied to it.