Skip to content

Commit

Permalink
add new register_validator endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
lightclient committed May 6, 2022
1 parent 409e11a commit 7109932
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
31 changes: 31 additions & 0 deletions apis/validator/register_validator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
post:
operationId: "registerValidator"
summary: Provide beacon node with registrations for the given validators to the external builder network.
description: |
Prepares the beacon node for engaging with external builders. The
information will be sent by the beacon node to each external builders it is
connected to. It is expected that the validator client will send this
information periodically to ensure the beacon node has correct and timely
registration information to provide to builders. The validator client
should not sign blinded beacon blocks that do not adhere to their latest
fee recipient and gas limit preferences.
Note that requests containing currently inactive or unknown validator
indices will be accepted, as they may become active at a later epoch.
tags:
- Validator
requestBody:
content:
application/json:
schema:
type: array
items:
$ref: '../../beacon-node-oapi.yaml#/components/schemas/SignedValidatorRegistration'
responses:
"200":
description: |
Preparation information has been received.
"400":
$ref: '../../beacon-node-oapi.yaml#/components/responses/InvalidRequest'
"500":
$ref: '../../beacon-node-oapi.yaml#/components/responses/InternalError'
5 changes: 5 additions & 0 deletions beacon-node-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ paths:
$ref: "./apis/validator/sync_committee_contribution_and_proof.yaml"
/eth/v1/validator/prepare_beacon_proposer:
$ref: "./apis/validator/prepare_beacon_proposer.yaml"
/eth/v1/validator/register_validator:
$ref: "./apis/validator/register_validator.yaml"

/eth/v1/events:
$ref: "./apis/eventstream/index.yaml"
Expand Down Expand Up @@ -273,6 +275,9 @@ components:
ConsensusVersion:
enum: [phase0, altair, bellatrix]
example: "phase0"
SignedValidatorRegistration:
$ref: './types/registration.yaml#/SignedValidatorRegistration'

parameters:
StateId:
$ref: './params/index.yaml#/StateId'
Expand Down
29 changes: 29 additions & 0 deletions types/registration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ValidatorRegistration:
type: object
description: "The [`ValidatorRegistration`]() object from the Builder API spec."
properties:
fee_recipient:
allOf:
- $ref: '../beacon-apis/types/primitive.yaml#/ExecutionAddress'
- description: "Address to receive fees from the block."
gas_limit:
allOf:
- $ref: "../beacon-apis/types/primitive.yaml#/Uint64"
- description: "Gas limit the validator desires to target."
timestamp:
allOf:
- $ref: '../beacon-apis/types/primitive.yaml#/Uint64'
- description: "Unix timestamp of registration."
pubkey:
allOf:
- $ref: '../beacon-apis/types/primitive.yaml#/Pubkey'
- description: "BLS public key of validator."

SignedValidatorRegistration:
type: object
description: "The [`SignedValidatorRegistration`]() object from the Builder API spec."
properties:
message:
$ref: "#/ValidatorRegistration"
signature:
$ref: "../beacon-apis/types/primitive.yaml#/Signature"

0 comments on commit 7109932

Please sign in to comment.