Repository navigation
core/validatorapi: serve ssz for gloas endpoints - #4733
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## gloas #4733 +/- ##
========================================
Coverage ? 66.40%
========================================
Files ? 247
Lines ? 31952
Branches ? 0
========================================
Hits ? 21217
Misses ? 10734
Partials ? 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
a74b646 to
69b1452
Compare
OisinKyne
left a comment
There was a problem hiding this comment.
Sharing the feedback inclusive of the merge order suggestion to minimise conflicts
#4733 — serve SSZ on the gloas endpoints: approve after two fixes
The SSZ encoding is right: the body is the bare BeaconBlock/BlockContents/PayloadAttestationData, and all the envelope fields go out as headers (version, payload-included, both values).
- 🚨 Breaks when merged with #4732. Both PRs rewrite writeResponse, and git merge-tree shows a conflict. #4732's noContentResponse doesn't implement MarshalSSZ. If whoever resolves the conflict puts the SSZ type switch first, a VC asking for SSZ payload attestation data on an empty slot gets a 500 ("response type doesn't support ssz marshalling") instead of a 204. The 204 check has to come before the encoding switch. Whichever lands second needs a test for "SSZ requested + no block".
- Overlaps with go-eth2-client #33 (the one you just approved). The generic unmarshalSSZList duplicates the generated PayloadAttestationMessages/SignedProposerPreferencesList types, and it skips the list-length limits those types enforce (PTC_SIZE = 512; 64 for preferences). submit_payload_attestations also has no MaxBody cap. Once #33 is tagged and charon picks it up, switch to the generated types and delete the helper. Until then, a MaxBody cap or item-count check is a cheap stopgap.
- Nit: negotiateResponseType uses strings.Contains on the Accept header, which ignores quality weights (q=). That's fine for the Accept headers VCs actually send today, but add a comment saying it's deliberate.
Suggested merge order: #4727 → #33 tag → #4733 (moved onto the generated types) → #4732 rebased on top, with the 204 check placed first in writeResponse.
6c40735 to
c857cf9
Compare
c857cf9 to
e38d512
Compare
|
Rebased on |
|
* core/validatorapi: serve ssz propose block v4 responses * core/validatorapi: ssz for payload attestation endpoints
* core/validatorapi: serve ssz propose block v4 responses * core/validatorapi: ssz for payload attestation endpoints



Serves SSZ (
application/octet-stream) responses when the validator client asks for them via theAcceptheader on the gloas endpointsPOST /eth/v4/validator/blocks/{slot}andGET /eth/v1/validator/payload_attestation_data, and accepts SSZ request bodies onPOST /eth/v1/beacon/pool/payload_attestations. The spec offers SSZ on all three; charon only spoke JSON, which broke prysm on locally built blocks (it requires the payload-included v4 response as SSZ and does not fall back) and cost lighthouse a 415 round trip on every payload attestation submission.SSZ request bodies decode into the generated list types
PayloadAttestationMessagesandSignedProposerPreferencesListfromgo-eth2-clientv0.29.0-obol.5-gloas(ObolNetwork/go-eth2-client#33), so the bump is included here. A malformed SSZ body is now a 400 rather than a 415.category: bug
ticket: #4324