Skip to content

Commit e85caa1

Browse files
committed
Request SSZ encoding for getHeader response (with Accept header)
1 parent b66471c commit e85caa1

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

.spectral.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ rules:
3535
recommended: true
3636
severity: error
3737
message: "{{description}}: {{error}}"
38-
given: $.paths.[*].requestBody.content[?(@property.indexOf('json') === -1)]^
38+
given: $.paths.[*].requestBody.content[0(@property.indexOf('json') === -1)]^
3939
then:
4040
function: falsy
4141

apis/builder/blinded_blocks.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ post:
99
1010
If the builder is not able to unblind the corresponding
1111
`ExecutionPayloadHeader`, it must error.
12+
13+
The request body can be encoded as JSON (application/json) or SSZ (application/octet-stream).
14+
Note: SSZ support can be determined by requesting an SSZ encoded response in the `getHeader`
15+
request.
1216
tags:
1317
- Builder
1418
requestBody:
@@ -22,6 +26,9 @@ post:
2226
examples:
2327
bellatrix:
2428
$ref: "../../builder-oapi.yaml#/components/examples/Bellatrix.SignedBlindedBeaconBlock"
29+
application/octet-stream:
30+
schema:
31+
title: SignedBlindedBeaconBlock
2532

2633
responses:
2734
"200":
@@ -42,6 +49,12 @@ post:
4249
examples:
4350
bellatrix:
4451
$ref: "../../builder-oapi.yaml#/components/examples/Bellatrix.ExecutionPayload"
52+
application/octet-stream:
53+
schema:
54+
title: SubmitBlindedBlockResponse
55+
type: string
56+
format: binary
57+
description: SSZ encoded SubmitBlindedBlockResponse
4558
"400":
4659
description: Error response.
4760
content:

apis/builder/header.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ get:
1818
builder must return a header that moves `gas_limit` the maximum amount
1919
allowed under the rules of consensus (currently `parent.gas_limit +/-
2020
parent.gas_limit / 1024`).
21+
22+
A SSZ encoded response can be requested using the `Accept` request header:
23+
`Accept: application/octet-stream`.
2124
tags:
2225
- Builder
2326
parameters:
@@ -39,6 +42,13 @@ get:
3942
description: The validator's BLS public key.
4043
schema:
4144
$ref: "../../builder-oapi.yaml#/components/schemas/Pubkey"
45+
- name: accept
46+
in: header
47+
description: "requested encoding: `application/octet-stream` (SSZ), `application/json`, or a combination."
48+
example: "application/octet-stream;q=1,application/json;q=0.9"
49+
required: false
50+
schema:
51+
type: string
4252
responses:
4353
"200":
4454
description: Success response.
@@ -58,6 +68,13 @@ get:
5868
examples:
5969
bellatrix:
6070
$ref: "../../builder-oapi.yaml#/components/examples/Bellatrix.SignedBuilderBid"
71+
application/octet-stream:
72+
schema:
73+
title: GetHeaderResponse
74+
type: string
75+
format: binary
76+
description: SSZ encoded GetHeaderResponse
77+
6178
"204":
6279
description: No header is available.
6380
"400":

0 commit comments

Comments
 (0)