Skip to content

Modify notify_forkchoice_updated - #5197

Merged
jtraglia merged 6 commits into
ethereum:masterfrom
mkalinin:modify-fcu
May 9, 2026
Merged

Modify notify_forkchoice_updated#5197
jtraglia merged 6 commits into
ethereum:masterfrom
mkalinin:modify-fcu

Conversation

@mkalinin

Copy link
Copy Markdown
Contributor

Modifies the computation of safe_block_hash and finalized_block_hash that are passed to the notify_forkchoice_updated starting with Gloas:

  • safe_block_hash is computed as the parent_block_hash of the safe block, this modification is done by extending get_safe_execution_block_hash function
  • finalized_block_hash is computed as the parent_block_hash of the finalized block bid

@github-actions github-actions Bot added the gloas label Apr 29, 2026
@mkalinin mkalinin changed the title gloas: Modify notify_forkchoice_updated Gloas: Modify notify_forkchoice_updated Apr 29, 2026
Comment thread specs/gloas/fork-choice.md Outdated
Comment thread specs/gloas/fork-choice.md Outdated
Comment thread specs/gloas/fork-choice.md Outdated
@mkalinin

Copy link
Copy Markdown
Contributor Author

@jtraglia Removed the function header and rephrased the statements inspired by your comments

Comment thread fork_choice/safe-block.md
# Return Hash32() if no payload is yet justified
if compute_epoch_at_slot(safe_block.slot) >= GLOAS_FORK_EPOCH:
safe_block_bid = safe_block.body.signed_execution_payload_bid.message
return safe_block_bid.parent_block_hash

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.

Just curious, why not safe_block_bid.block_hash?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because we yet don’t know if this payload is going to be canonical, do we?

@jtraglia jtraglia changed the title Gloas: Modify notify_forkchoice_updated Modify notify_forkchoice_updated May 9, 2026
@jtraglia
jtraglia merged commit 57b4a97 into ethereum:master May 9, 2026
15 checks passed
@zilm13 zilm13 mentioned this pull request May 18, 2026
17 tasks
nflaig added a commit to ChainSafe/lodestar that referenced this pull request Aug 7, 2026
**Motivation**

Post-Gloas (ePBS) a block's own payload may not yet be confirmed
canonical, so `engine_forkchoiceUpdated` must report the bid's
`parent_block_hash` as the safe/finalized block hash.

**Description**

- Add `getFinalizedExecutionBlockHash` and a shared fork-aware helper;
switch all five FCU callsites
- Post-Gloas blocks report the bid `parent_block_hash`; pre-Gloas
behavior unchanged
- Safe hash is based on the fast-confirmation confirmed block via new
`IForkChoice.getConfirmedBlock()` (justified fallback when FCR is
disabled), with warnings on zero-hash fallbacks
- Genesis anchor: `ZERO_HASH` pre-Gloas (genesis body carries a default
payload, so it is not an execution block); bid `parent_block_hash` for
Gloas genesis

References:
- ethereum/consensus-specs#5197
- ethereum/consensus-specs#5449

**AI Assistance Disclosure**

- Claude-assisted (rebase, genesis semantics, validation)

---------

Co-authored-by: Nazar Hussain <nazarhussain@gmail.com>
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
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.

3 participants