Skip to content

feat: add EIP-7843 slot_number + fix genesis compatibility with geth - #3

Open
qu0b wants to merge 1 commit into
jochem-brouwer:refactor/bal-benchmarksfrom
qu0b:qu0b/fix/eels-geth-genesis-compat
Open

feat: add EIP-7843 slot_number + fix genesis compatibility with geth#3
qu0b wants to merge 1 commit into
jochem-brouwer:refactor/bal-benchmarksfrom
qu0b:qu0b/fix/eels-geth-genesis-compat

Conversation

@qu0b

@qu0b qu0b commented Mar 17, 2026

Copy link
Copy Markdown

Summary

Three fixes to make EELS-generated Amsterdam fixtures consumable by geth via benchmarkoor:

1. Add slot_number (EIP-7843) to Amsterdam block header

Geth includes slot_number in Amsterdam block headers (including genesis). EELS didn't have this field, causing different genesis block hashes → all fixture blocks rejected as "missing parent."

Files:

  • src/ethereum/forks/amsterdam/blocks.py — Add slot_number: U64 to Header
  • src/ethereum/genesis.py — Default slot_number = U64(0) for genesis
  • src/ethereum_spec_tools/evm_tools/t8n/env.py — Include in t8n parent header
  • Testing framework: FixtureHeader, FixtureExecutionPayload, fork requirements, genesis

2. Fix genesis nonce parsing for hex values

int(account.get("nonce", "0")) crashes on hex nonces like "0x01". Changed to hex_to_uint(). This caused EELS to compute a different genesis state root from geth (all account nonces were 0 instead of their actual values).

3. Fix genesis requests_hash to match EIP-7685

EELS used Hash32(b"\0" * 32) (all-zeros) for empty requests hash. The spec (EIP-7685) and geth use SHA-256("") = 0xe3b0c442.... This changed the genesis block hash.

Testing

With these fixes + a geth t8n that outputs currentSlotNumber in its result:

  • 44/44 BAL scenario benchmarks pass in benchmarkoor with geth
  • All 3 geth BAL execution modes tested (full, sequential, nobatchio)
  • Genesis hashes now match between EELS and geth for the same alloc

Note on geth t8n changes

For full compatibility, the geth t8n also needs to:

  1. Output currentSlotNumber in its execution result JSON
  2. Default slotNumber = blockNumber for Amsterdam blocks when not provided in env

These changes are in our geth fork at qu0b/go-ethereum on the feat/update-t8n-for-amsterdam worktree.

🤖 Generated with Claude Code

…with geth

Three fixes to make EELS-generated Amsterdam fixtures consumable by geth:

1. Add `slot_number` (EIP-7843) to Amsterdam block header
   - `src/ethereum/forks/amsterdam/blocks.py`: Add `slot_number: U64` field
   - `src/ethereum/genesis.py`: Default `slot_number = U64(0)` for genesis
   - `src/ethereum_spec_tools/evm_tools/t8n/env.py`: Include in t8n parent header
   - Testing framework: Add to FixtureHeader, FixtureExecutionPayload,
     fork requirements, and genesis construction

2. Fix genesis nonce parsing for hex values
   - `src/ethereum/genesis.py`: `int(nonce)` → `hex_to_uint(nonce)` to handle
     hex nonces like "0x01" in alloc data

3. Fix genesis requests_hash to match EIP-7685 spec
   - `src/ethereum/genesis.py`: Use SHA-256("") instead of zero hash for
     empty requests_hash, matching geth's `EmptyRequestsHash`

Without these fixes, EELS and geth compute different genesis block hashes
from the same alloc, causing all EELS-generated Amsterdam fixtures to be
rejected by geth with "missing parent" errors.

Tested: 44/44 BAL scenario benchmarks pass in benchmarkoor with geth
across all 3 BAL execution modes (full, sequential, nobatchio).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

This PR has had no recent activity and has been marked as stale.

@github-actions github-actions Bot added the stale label Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant