Skip to content

Commit

Permalink
Add endpoint for fetching blinded blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsproul committed Sep 13, 2022
1 parent b51e6fa commit 9c1db6b
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
61 changes: 61 additions & 0 deletions apis/beacon/blocks/blinded_block.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
get:
operationId: getBlindedBlock
summary: Get blinded block
description: |
Retrieves blinded block for given block ID.
Depending on `Accept` header it can be returned either as JSON or as bytes serialized by SSZ
tags:
- Beacon
parameters:
- name: block_id
in: path
required: true
$ref: '../../../beacon-node-oapi.yaml#/components/parameters/BlockId'
responses:
"200":
description: "Successful response"
headers:
Eth-Consensus-Version:
$ref: '../../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version'
content:
application/json:
schema:
title: GetBlindedBlockResponse
type: object
properties:
version:
type: string
enum: [phase0, altair, bellatrix]
example: "phase0"
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
data:
oneOf:
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/SignedBeaconBlock"
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Altair.SignedBeaconBlock"
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Bellatrix.SignedBlindedBeaconBlock"
application/octet-stream:
schema:
description: "SSZ serialized block bytes. Use Accept header to choose this response type"
"400":
description: "The block ID supplied could not be parsed"
content:
application/json:
schema:
allOf:
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage"
- example:
code: 400
message: "Invalid block ID: current"
"404":
description: "Block not found"
content:
application/json:
schema:
allOf:
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage"
- example:
code: 404
message: "Block not found"
"500":
$ref: "../../../beacon-node-oapi.yaml#/components/responses/InternalError"
2 changes: 2 additions & 0 deletions beacon-node-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ paths:
$ref: "./apis/beacon/blocks/root.yaml"
/eth/v1/beacon/blocks/{block_id}/attestations:
$ref: "./apis/beacon/blocks/attestations.yaml"
/eth/v1/beacon/blinded_blocks/{block_id}:
$ref: "./apis/beacon/blocks/blinded_block.yaml"

/eth/v1/beacon/pool/attestations:
$ref: "./apis/beacon/pool/attestations.yaml"
Expand Down

0 comments on commit 9c1db6b

Please sign in to comment.