Skip to content

Add head_v2 event in beacon API and remove some fields in data_column_sidecar event - #9597

Merged
mergify[bot] merged 16 commits into
sigp:unstablefrom
chong-he:beacon-api-events
Jul 30, 2026
Merged

Add head_v2 event in beacon API and remove some fields in data_column_sidecar event#9597
mergify[bot] merged 16 commits into
sigp:unstablefrom
chong-he:beacon-api-events

Conversation

@chong-he

@chong-he chong-he commented Jul 8, 2026

Copy link
Copy Markdown
Member

Issue Addressed

#9045

Proposed Changes

  • Add head_v2 event
  • remove the fields kzg_commitments and versioned_hashes in data_column_sidecar

The other new task for the events API that has yet to be implemented include:

  • add fast_confirmation event, pending as it seems that Lighthouse still doesn't implement this (update: implemented in Implement Fast Confirmation Rule #8951 )
  • Removed parent_block_number field in payload_attributes event is to be done after Gloas, as highlighted below, because current (Fulu) PayloadAttributes still has parent_block_number
    // TODO(gloas) can remove this field once we fork to gloas
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub parent_block_number: Option<Quoted<u64>>,

AI-assisted, self-reviewed

@chong-he chong-he changed the title Add heav_v2 event in beacon API and remove some fields in data_column_sidecar event Add head_v2 event in beacon API and remove some fields in data_column_sidecar event Jul 8, 2026
@chong-he chong-he added the ready-for-review The code is ready for review label Jul 10, 2026
@mergify

mergify Bot commented Jul 13, 2026

Copy link
Copy Markdown

This pull request has merge conflicts. Could you please resolve them @chong-he? 🙏

@mergify mergify Bot added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Jul 13, 2026
@mergify mergify Bot added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Jul 13, 2026

@pawanjay176 pawanjay176 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.

Sorry this one took a while. Looks mostly good, just one small issue and a suggestion

Comment thread common/eth2/src/types.rs
pub slot: Slot,
pub block: Hash256,
pub state: Hash256,
pub payload_status: PayloadStatus,

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.

The spec seems to require the payload_status to be in lowercase. Maybe we can just do a serde container attribute for making it lowercase so that the json shows
{payload_status: "empty"} instead of Empty ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Great catch, I added #[serde(rename_all = "lowercase")] in the enum: 3742b57

match (current_epoch_dependent_root, next_epoch_dependent_root) {
(Ok(current_epoch_dependent_root), Ok(next_epoch_dependent_root)) => {
let head_v2 = SseHeadV2 {
slot: state.slot(),

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.

Maybe its more correct to choose the slot from new_snapshot.beacon_block.slot()?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good comment. I have revised this in 3742b57

@pawanjay176 pawanjay176 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.

I'm happy to merge this and iterate now.

Although, I'm a bit confused on if the head events are also supposed to handle reorg notifications. Seems like we didn't do it for Head v1 sse events, and now we are doing it only for Empty -> Full status changes for the same beacon block root.

The spec seems kinda ambiguous to me because there is also a chain-reorg event. Can someone with better knowledge of the beacon api clarify the intent for the head event? Is it supposed to handle reorgs too?

@mergify

mergify Bot commented Jul 29, 2026

Copy link
Copy Markdown

Queued — the merge queue status continues in this comment ↓.

@chong-he

chong-he commented Jul 30, 2026

Copy link
Copy Markdown
Member Author

I'm happy to merge this and iterate now.

Although, I'm a bit confused on if the head events are also supposed to handle reorg notifications. Seems like we didn't do it for Head v1 sse events, and now we are doing it only for Empty -> Full status changes for the same beacon block root.

The spec seems kinda ambiguous to me because there is also a chain-reorg event. Can someone with better knowledge of the beacon api clarify the intent for the head event? Is it supposed to handle reorgs too?

This is clarified recently in this PR: ethereum/beacon-APIs#628

Only the first change of payload_status (from empty to full) is required by the spec, further changes (re-org) is optional. We went with the no-implement route for further changes in payload_status

@mergify

mergify Bot commented Jul 30, 2026

Copy link
Copy Markdown

Merge Queue Status

This pull request spent 29 minutes 52 seconds in the queue, including 27 minutes 51 seconds running CI.

Required conditions to merge

@mergify mergify Bot added the queued label Jul 30, 2026
@mergify
mergify Bot merged commit 009258a into sigp:unstable Jul 30, 2026
38 checks passed
@mergify mergify Bot removed the queued label Jul 30, 2026
@chong-he
chong-he deleted the beacon-api-events branch July 30, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

HTTP-API ready-for-review The code is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants