feat: parse the head_v2 SSE event (gloas) - #41
Open
samcm wants to merge 4 commits into
Open
Conversation
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
marked this pull request as ready for review
July 12, 2026 08:34
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
HeadEventV2plus topic registration and dispatch for the beacon-APIhead_v2eventstream topic (gloas). The event uses the versioned{"version","data"}envelope, handled viaunmarshalVersionedEventDatalike the other gloas topics, with the bare shape accepted as a fallback. Consumers subscribe withHeadV2Handleror receive*apiv1.HeadEventV2through the generic handler.https://claude.ai/code/session_019cbhUv62kwFTKQD5aM8FGC