From 7109932e3850bff7d463c352008d602c5cf517be Mon Sep 17 00:00:00 2001 From: "lightclient@protonmail.com" Date: Fri, 6 May 2022 13:33:08 +0200 Subject: [PATCH] add new register_validator endpoint --- apis/validator/register_validator.yaml | 31 ++++++++++++++++++++++++++ beacon-node-oapi.yaml | 5 +++++ types/registration.yaml | 29 ++++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 apis/validator/register_validator.yaml create mode 100644 types/registration.yaml diff --git a/apis/validator/register_validator.yaml b/apis/validator/register_validator.yaml new file mode 100644 index 00000000..cf09a6c5 --- /dev/null +++ b/apis/validator/register_validator.yaml @@ -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' diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index 7bb7d7ae..71f44940 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -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" @@ -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' diff --git a/types/registration.yaml b/types/registration.yaml new file mode 100644 index 00000000..9f4646f0 --- /dev/null +++ b/types/registration.yaml @@ -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"