Skip to content

gloas: fix BeaconState JSON codings for execution_payload_availability and ptc_window - #43

Merged
samcm merged 1 commit into
feat/head-v2-ssefrom
fix/gloas-state-availability-ptc
Jul 18, 2026
Merged

gloas: fix BeaconState JSON codings for execution_payload_availability and ptc_window#43
samcm merged 1 commit into
feat/head-v2-ssefrom
fix/gloas-state-availability-ptc

Conversation

@samcm

@samcm samcm commented Jul 18, 2026

Copy link
Copy Markdown
Member

Fixes the two remaining gloas `BeaconState` JSON coding mismatches, found live on glamsterdam-devnet-7 after #42 landed.

  • `execution_payload_availability` is a bitvector, served as a single hex string (same as `justification_bits`). It was marshalled as a per-byte decimal array and unmarshalled straight into `[]uint8`, which routes through `encoding/json`'s base64 path — every gloas `BeaconState` fetch failed with `illegal base64 data at input byte 2048`.
  • `ptc_window` is served by lighthouse as bare JSON numbers rather than the beacon-API quoted-integer convention. The unmarshaller expected `[][]string` only. It now accepts both forms; marshalling keeps the quoted convention.

Field encodings verified against a live lighthouse `/eth/v2/debug/beacon/states/head` response. Round-trip and lighthouse-shaped tests included.

…y and ptc_window

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.
@samcm
samcm merged commit cba019f into feat/head-v2-sse Jul 18, 2026
3 checks passed
@samcm
samcm deleted the fix/gloas-state-availability-ptc branch July 18, 2026 02:00
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