Skip to content

Add EIP-8272 RECENT_ROOT_CODE predeploy - #53

Open
AnkushinDaniil wants to merge 1 commit into
ethereum:mainfrom
AnkushinDaniil:daniil/recent-root-8272
Open

Add EIP-8272 RECENT_ROOT_CODE predeploy#53
AnkushinDaniil wants to merge 1 commit into
ethereum:mainfrom
AnkushinDaniil:daniil/recent-root-8272

Conversation

@AnkushinDaniil

Copy link
Copy Markdown

Adds the RECENT_ROOT_CODE predeploy for EIP-8272 as a geas source, following the request from the EIP authors to maintain the runtime here with generated bytecode and tests rather than as a hex blob in the EIP text.

src/recent_root/main.eas assembles byte-identical to the 144-byte runtime currently pinned in EIP-8272. ctor.eas is the deploy-time wrapper in the same shape as the other predeploys here. shasum -c passes for both generated files.

The runtime reads the current slot with the EIP-7843 SLOTNUM opcode (0x4b), which geas does not yet know as a named mnemonic, so it is emitted as a raw byte and the two recent_root targets are built with -no-stackcheck. The Foundry test covers the calldata-length and call-value guards, which revert before SLOTNUM is reached; the full write path needs an EIP-7843-aware EVM and is exercised on the client devnet instead.

The behaviour it implements, from EIP-8272:

calldata = salt(32) || root(32); revert unless len == 64 and value == 0
source_id   = keccak256(msg.sender || salt)
i           = SLOTNUM mod RECENT_ROOT_LENGTH
entry_hash  = keccak256(ENTRY_DOMAIN   || source_id || uint64_be(SLOTNUM) || root)
storage_key = keccak256(STORAGE_DOMAIN || source_id || uint64_be(i))
storage[storage_key] = entry_hash

@AnkushinDaniil
AnkushinDaniil force-pushed the daniil/recent-root-8272 branch from a75a4c6 to 488096e Compare August 11, 2026 05:39
@fjl

fjl commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Geas supports SLOTNUM with #pragma target "amsterdam".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants