fix: handle genesis block in gloas fork choice and genesis state init - #9149
Conversation
- Fix PROTO_ARRAY_ERROR_UNKNOWN_PARENT_BLOCK at block production by treating genesis block (parentRoot=0x00..00) as FULL in getParentPayloadStatus() - Guard latestExecutionPayloadHeader assignments in genesis init to skip for gloas (field was removed in EIP-7732) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a check in the fork-choice logic to treat the genesis block as a full payload when the parent root is a zero hash. Additionally, it updates the genesis state initialization to conditionally set the latest execution payload header only for forks prior to gloas. A review comment identifies a type safety improvement opportunity in the genesis utility, noting that the executionPayloadHeader parameter is missing the Fulu-specific header type in its union definition, which leads to unnecessary casting.
nflaig
left a comment
There was a problem hiding this comment.
this looks good, still doing a quick sanity check, I don't think I ever tested gloas from genesis before
we also need to bring this to unstable branch, I can look into that more later
|
still seeing fork choice erros after genesis will merge this anyways, can fix that as part of the other wip |
Summary
parentRootingetParentPayloadStatus()— returnsPayloadStatus.FULLinstead of throwingPROTO_ARRAY_ERROR_UNKNOWN_PARENT_BLOCK. This fixes the mainnet preset crash at block production time.latestExecutionPayloadHeaderassignments ininitializeBeaconStateFromEth1()withfork < ForkSeq.gloassince this field was removed in gloas (EIP-7732), replaced bylatestExecutionPayloadBid.Note on minimal preset SSZ crash
The minimal preset crash (
First offset must equal to fixedEnd 109509 != 11589) is a genesis generator issue, not Lodestar. The difference of 97920 bytes exactly matchesptcWindowsize with mainnetPTC_SIZE=512vs minimalPTC_SIZE=2— the genesis generator (ethpandaops/ethereum-genesis-generator:gloas-genesis) appears to use mainnet'sPTC_SIZEwhen generating minimal preset states.Test plan
🤖 Generated with Claude Code