Skip to content

feat: parse the head_v2 SSE event (gloas) - #41

Open
samcm wants to merge 4 commits into
masterfrom
feat/head-v2-sse
Open

feat: parse the head_v2 SSE event (gloas)#41
samcm wants to merge 4 commits into
masterfrom
feat/head-v2-sse

Conversation

@samcm

@samcm samcm commented Jul 12, 2026

Copy link
Copy Markdown
Member

Adds HeadEventV2 plus topic registration and dispatch for the beacon-API head_v2 eventstream topic (gloas). The event uses the versioned {"version","data"} envelope, handled via unmarshalVersionedEventData like the other gloas topics, with the bare shape accepted as a fallback. Consumers subscribe with HeadV2Handler or receive *apiv1.HeadEventV2 through the generic handler.

https://claude.ai/code/session_019cbhUv62kwFTKQD5aM8FGC

Adds HeadEventV2 and dispatch for the head_v2 beacon-API topic: the
gloas-aware head event that drops previous_duty_dependent_root, renames
current_duty_dependent_root to current_epoch_dependent_root, and adds
next_epoch_dependent_root, payload_status and execution_optimistic. The
payload arrives in the {"version","data"} envelope, so the handler uses
unmarshalVersionedEventData (bare objects accepted as fallback, matching
the other gloas topics).

Claude-Session: https://claude.ai/code/session_019cbhUv62kwFTKQD5aM8FGC
The head_v2 event type made every decodeFixedBytes call site pass a
32-byte length, tripping unparam on the untouched helper. The parameter
stays — it exists for future non-root fields.

Claude-Session: https://claude.ai/code/session_019cbhUv62kwFTKQD5aM8FGC
@samcm
samcm marked this pull request as ready for review July 12, 2026 08:34
samcm added 2 commits July 18, 2026 00:14
Beacon API JSON encodes integers as strings; lighthouse returns
"version": "1" and unmarshaling into a bare uint8 fails, breaking
every gloas BeaconState fetch (xatu-cannon's beaconValidators deriver
errors with 'cannot unmarshal string into Go struct field
builderJSON.version'). MarshalYAML also dropped the field entirely.
…y and ptc_window (#43)

execution_payload_availability is a bitvector, hex-encoded on the wire like
justification_bits; it was marshalled as a per-byte decimal array and
unmarshalled through encoding/json's base64 path for byte slices, so every
gloas BeaconState fetch failed. ptc_window is served by lighthouse as bare
JSON numbers rather than the quoted-integer convention; accept both forms.
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.

1 participant