Skip to content

fix: create FULL variant for gloas genesis and allow block production when stalled with peers - #9153

Merged
nflaig merged 2 commits into
ChainSafe:epbs-devnet-1from
barnabasbusa:epbs-devnet-1
Apr 3, 2026
Merged

fix: create FULL variant for gloas genesis and allow block production when stalled with peers#9153
nflaig merged 2 commits into
ChainSafe:epbs-devnet-1from
barnabasbusa:epbs-devnet-1

Conversation

@barnabasbusa

Copy link
Copy Markdown
Contributor

Summary

  • Create FULL variant for gloas genesis block: onBlock() only creates PENDING + EMPTY variants, but the finalized checkpoint expects FULL (because executionPayloadAvailability is all-ones in genesis state). Now calls onExecutionPayload() after ProtoArray.initialize() to create the FULL variant. Fixes FORKCHOICE_ERROR_MISSING_PROTO_ARRAY_BLOCK on getFinalizedBlock().
  • Allow API requests when sync is stalled with peers: When sync state is Stalled but 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

  • All fork-choice unit tests pass (104/104)
  • Build passes
  • Local Kurtosis devnet with mainnet preset, gloas_fork_epoch: 0, 2 lodestar-geth pairs — chain produces blocks every slot

🤖 Generated with Claude Code

- 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>
@barnabasbusa
barnabasbusa requested a review from a team as a code owner April 1, 2026 21:17

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 nflaig left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good enough for epbs-devnet-1 branch, thanks @barnabasbusa

@nflaig
nflaig merged commit 2771b59 into ChainSafe:epbs-devnet-1 Apr 3, 2026
12 of 16 checks passed
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