Skip to content

Commit 7d3a047

Browse files
nflaigrolfyone
andauthored
Add SSZ support to attestation apis (#527)
Co-authored-by: Paul Harris <[email protected]>
1 parent bf7dd4a commit 7d3a047

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

apis/beacon/pool/attestations.v2.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ post:
8585
- type: array
8686
items:
8787
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/Phase0.Attestation'
88+
application/octet-stream:
89+
schema:
90+
description: "SSZ serialized `List[Attestation, MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT]` or `List[SingleAttestation, MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT]` bytes. Use content type header to indicate that SSZ data is contained in the request body."
8891
responses:
8992
"200":
9093
description: Attestations are stored in pool and broadcast on the appropriate subnet
@@ -94,5 +97,7 @@ post:
9497
application/json:
9598
schema:
9699
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/IndexedErrorMessage"
100+
"415":
101+
$ref: '../../../beacon-node-oapi.yaml#/components/responses/UnsupportedMediaType'
97102
"500":
98103
$ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError'

apis/validator/aggregate_and_proofs.v2.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,15 @@ post:
2424
- type: array
2525
items:
2626
$ref: '../../beacon-node-oapi.yaml#/components/schemas/Phase0.SignedAggregateAndProof'
27+
application/octet-stream:
28+
schema:
29+
description: "SSZ serialized `List[SignedAggregateAndProof, MAX_COMMITTEES_PER_SLOT * TARGET_AGGREGATORS_PER_COMMITTEE]` bytes. Use content type header to indicate that SSZ data is contained in the request body."
2730
responses:
2831
"200":
2932
description: "Successful response"
3033
"400":
3134
$ref: '../../beacon-node-oapi.yaml#/components/responses/InvalidRequest'
35+
"415":
36+
$ref: '../../beacon-node-oapi.yaml#/components/responses/UnsupportedMediaType'
3237
"500":
3338
$ref: '../../beacon-node-oapi.yaml#/components/responses/InternalError'

apis/validator/aggregate_attestation.v2.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,14 @@ get:
5151
anyOf:
5252
- $ref: '../../beacon-node-oapi.yaml#/components/schemas/Electra.Attestation'
5353
- $ref: '../../beacon-node-oapi.yaml#/components/schemas/Phase0.Attestation'
54+
application/octet-stream:
55+
schema:
56+
description: "SSZ serialized `Attestation` bytes. Use Accept header to choose this response type"
5457
"400":
5558
$ref: '../../beacon-node-oapi.yaml#/components/responses/InvalidRequest'
5659
"404":
5760
$ref: '../../beacon-node-oapi.yaml#/components/responses/NotFound'
61+
"406":
62+
$ref: "../../beacon-node-oapi.yaml#/components/responses/NotAcceptable"
5863
"500":
5964
$ref: '../../beacon-node-oapi.yaml#/components/responses/InternalError'

apis/validator/attestation_data.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,13 @@ get:
3636
properties:
3737
data:
3838
$ref: '../../beacon-node-oapi.yaml#/components/schemas/Phase0.AttestationData'
39+
application/octet-stream:
40+
schema:
41+
description: "SSZ serialized `AttestationData` bytes. Use Accept header to choose this response type"
3942
"400":
4043
$ref: '../../beacon-node-oapi.yaml#/components/responses/InvalidRequest'
44+
"406":
45+
$ref: '../../beacon-node-oapi.yaml#/components/responses/NotAcceptable'
4146
"500":
4247
$ref: '../../beacon-node-oapi.yaml#/components/responses/InternalError'
4348
"503":

0 commit comments

Comments
 (0)