-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add liveness endpoint for doppleganger protection (#131)
Co-authored-by: realbigsean <sean@sigmaprime.io>
- Loading branch information
1 parent
e4047de
commit 8a96147
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
post: | ||
tags: | ||
- Validator | ||
summary: "Indicates if a validator has been observed on the network" | ||
operationId: "getLiveness" | ||
description: "Requests the beacon node to indicate if a validator has been | ||
observed to be live in a given epoch. The beacon node might detect liveness by | ||
observing messages from the validator on the network, in the beacon chain, | ||
from its API or from any other source. A beacon node SHOULD support the current | ||
and previous epoch, however it MAY support earlier epoch. It is important to | ||
note that the values returned by the beacon node are not canonical; they are best-effort | ||
and based upon a subjective view of the network. A beacon node that was recently | ||
started or suffered a network partition may indicate that a validator is not live | ||
when it actually is." | ||
requestBody: | ||
description: "An array of the validator indices for which to detect liveness." | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
title: PostLivenessRequestBody | ||
type: object | ||
properties: | ||
epoch: | ||
$ref: "../../beacon-node-oapi.yaml#/components/schemas/Uint64" | ||
indices: | ||
type: array | ||
items: | ||
$ref: '../../beacon-node-oapi.yaml#/components/schemas/Uint64' | ||
minItems: 1 | ||
responses: | ||
"200": | ||
description: Success response | ||
content: | ||
application/json: | ||
schema: | ||
title: PostLivenessResponseBody | ||
type: object | ||
properties: | ||
data: | ||
type: array | ||
items: | ||
type: object | ||
properties: | ||
index: | ||
$ref: '../../beacon-node-oapi.yaml#/components/schemas/Uint64' | ||
is_live: | ||
type: boolean | ||
"400": | ||
description: "Invalid epoch or index" | ||
content: | ||
application/json: | ||
schema: | ||
allOf: | ||
- $ref: "../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" | ||
- example: | ||
code: 400 | ||
message: "Invalid epoch: -2" | ||
"500": | ||
$ref: '../../beacon-node-oapi.yaml#/components/responses/InternalError' | ||
"503": | ||
$ref: '../../beacon-node-oapi.yaml#/components/responses/CurrentlySyncing' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters