fix: create FULL variant for gloas genesis and allow block production when stalled with peers - #9153
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 several updates to support the Gloas fork. Key changes include refactoring fork choice initialization to correctly handle Gloas payload status, updating the validator API to allow requests during a stalled sync state if peers are connected, and adjusting genesis state initialization to account for the removal of the latestExecutionPayloadHeader in the Gloas fork. Additionally, the ProtoArray now explicitly treats the genesis block as having a full payload status. I have no feedback to provide as the changes appear correct and align with the intended architectural updates.
…nc with peers - Create FULL variant via onExecutionPayload() after ProtoArray.initialize() for gloas genesis when payload is available. onBlock() only creates PENDING + EMPTY variants, but the finalized checkpoint expects FULL. - Allow API requests when sync is Stalled but node has connected peers, since stalled with peers means range sync is idle (nothing to sync), not that the node lacks connectivity. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d063a7f to
687eb98
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d063a7fff9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| currentSlot, | ||
| toRootHex(gloasState.latestBlockHash), | ||
| 0, | ||
| toRootHex(blockHeader.stateRoot) |
There was a problem hiding this comment.
Use payload state root for anchor FULL variant
When initializing from a finalized post-Gloas anchor that already has payload available, this call creates the FULL variant with blockHeader.stateRoot, but FULL variants are expected to use the payload/envelope state root (as done in importBlock and importExecutionPayloadEnvelope). regen.getPreState() later reads the FULL parent’s stateRoot for child transition, so using the header root can select a pre-envelope state and cause child block import/proposal to fail after restart (especially once execution requests mutate state).
Useful? React with 👍 / 👎.
nflaig
left a comment
There was a problem hiding this comment.
looks good enough for epbs-devnet-1 branch, thanks @barnabasbusa
Summary
onBlock()only creates PENDING + EMPTY variants, but the finalized checkpoint expects FULL (becauseexecutionPayloadAvailabilityis all-ones in genesis state). Now callsonExecutionPayload()afterProtoArray.initialize()to create the FULL variant. FixesFORKCHOICE_ERROR_MISSING_PROTO_ARRAY_BLOCKongetFinalizedBlock().Stalledbut the node has connected peers, range sync is idle because peers don't have newer data (e.g. fresh genesis network). The node should serve API requests instead of returning 503.Test plan
mainnetpreset,gloas_fork_epoch: 0, 2 lodestar-geth pairs — chain produces blocks every slot🤖 Generated with Claude Code