feat: add EIP-7843 slot_number + fix genesis compatibility with geth - #3
Open
qu0b wants to merge 1 commit into
Open
Conversation
…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>
This was referenced Mar 17, 2026
|
This PR has had no recent activity and has been marked as stale. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three fixes to make EELS-generated Amsterdam fixtures consumable by geth via benchmarkoor:
1. Add
slot_number(EIP-7843) to Amsterdam block headerGeth includes
slot_numberin 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— Addslot_number: U64to Headersrc/ethereum/genesis.py— Defaultslot_number = U64(0)for genesissrc/ethereum_spec_tools/evm_tools/t8n/env.py— Include in t8n parent header2. Fix genesis nonce parsing for hex values
int(account.get("nonce", "0"))crashes on hex nonces like"0x01". Changed tohex_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_hashto match EIP-7685EELS used
Hash32(b"\0" * 32)(all-zeros) for empty requests hash. The spec (EIP-7685) and geth useSHA-256("")=0xe3b0c442.... This changed the genesis block hash.Testing
With these fixes + a geth t8n that outputs
currentSlotNumberin its result:Note on geth t8n changes
For full compatibility, the geth t8n also needs to:
currentSlotNumberin its execution result JSONslotNumber = blockNumberfor Amsterdam blocks when not provided in envThese changes are in our geth fork at
qu0b/go-ethereumon thefeat/update-t8n-for-amsterdamworktree.🤖 Generated with Claude Code