Skip to content

Gloas ensure we emit payload attributes SSE event#9348

Open
eserilev wants to merge 8 commits into
sigp:unstablefrom
eserilev:gloas-head-block-number
Open

Gloas ensure we emit payload attributes SSE event#9348
eserilev wants to merge 8 commits into
sigp:unstablefrom
eserilev:gloas-head-block-number

Conversation

@eserilev
Copy link
Copy Markdown
Member

Issue Addressed

#8817

we were not emitting payload attribute SSE events for gloas. Since the head snapshot stores the canonical latest execution payload envelope we have all the info we need to emit the event.

@eserilev eserilev added ready-for-review The code is ready for review gloas labels May 24, 2026
@mergify
Copy link
Copy Markdown

mergify Bot commented May 24, 2026

Some required checks have failed. Could you please take a look @eserilev? 🙏

@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 May 24, 2026
@eserilev eserilev 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 May 24, 2026
Comment thread beacon_node/beacon_chain/src/canonical_head.rs Outdated
Comment on lines +202 to +206
// This fallback is strictly for the fork boundary case when self.snapshot.execution_envelope is `None`.
// Note: If there is a missed/orphaned envelope at the fork boundary we wont be able to get the block number using this fallback.
// We could try handling that edge case but it doesn't seem worth it. Returning `None` here just means that we don't
// emit a payload attributes SSE event further upstream.
self.head_block_number().ok()
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.

This assumption is wrong currently: the snapshot.execution_envelope is also None for empty blocks. Currently we only load the head execution envelope for full blocks, here:

let execution_envelope = if new_payload_status == PayloadStatus::Full {
let envelope = self
.store
.get_payload_envelope(&new_view.head_block_root)?
.map(Arc::new)
.ok_or(Error::MissingExecutionPayloadEnvelope(
new_view.head_block_root,
))?;
Some(envelope)
} else {
None
};

We could change this invariant so that we always have a payload post-Gloas, by loading/storing the most recent envelope (i.e. the parent's envelope in the case of an empty block).

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.

thanks for catching that, i've changed the invariant so that we always have a payload post-gloas and added some tests

@michaelsproul michaelsproul 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 May 25, 2026
@eserilev eserilev 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 May 25, 2026
@mergify
Copy link
Copy Markdown

mergify Bot commented May 25, 2026

Some required checks have failed. Could you please take a look @eserilev? 🙏

@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 May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gloas waiting-on-author The reviewer has suggested changes and awaits thier implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants