Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fee Recipient API #24

Merged
merged 20 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions apis/fee_recipient.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
get:
operationId: ListFeeRecipient
summary: List Fee Recipient.
description: |
List the validator public key to eth address mapping for fee recipient feature on a specific public key.
The validator public key will return with the default fee recipient address if a specific one was not found.

WARNING: The fee_recipient is not used on Phase0 or Altair networks.
security:
- bearerAuth: []
tags:
- Fee Recipient
parameters:
- in: path
name: pubkey
schema:
$ref: "../keymanager-oapi.yaml#/components/schemas/Pubkey"
required: true
responses:
"200":
description: success response
content:
application/json:
schema:
title: ListFeeRecipientResponse
type: object
required: [data]
properties:
data:
$ref: "../keymanager-oapi.yaml#/components/schemas/FeeRecipient"
"401":
rolfyone marked this conversation as resolved.
Show resolved Hide resolved
$ref: "../keymanager-oapi.yaml#/components/responses/Unauthorized"
"403":
$ref: "../keymanager-oapi.yaml#/components/responses/Forbidden"
"404":
$ref: "../keymanager-oapi.yaml#/components/responses/NotFound"
"500":
$ref: "../keymanager-oapi.yaml#/components/responses/InternalError"

post:
operationId: SetFeeRecipient
summary: Set Fee Recipient.
description: |
Sets the validator client fee recipient mapping which will then update the beacon node.
Existing mappings for the same validator public key will be overwritten.
Specific Public keys not mapped will continue to use the default address for fee recipient in accordance to the startup of the validator client and beacon node.
Cannot specify default fee recipient address through API.

WARNING: The fee_recipient is not used on Phase0 or Altair networks.
security:
- bearerAuth: []
tags:
- Fee Recipient
parameters:
- in: path
name: pubkey
schema:
$ref: "../keymanager-oapi.yaml#/components/schemas/Pubkey"
required: true
requestBody:
content:
application/json:
schema:
$ref: '../keymanager-oapi.yaml#/components/schemas/Ethaddress'
required: true
responses:
"202":
description: successfully updated
"400":
$ref: "../keymanager-oapi.yaml#/components/responses/BadRequest"
"401":
$ref: "../keymanager-oapi.yaml#/components/responses/Unauthorized"
"403":
rolfyone marked this conversation as resolved.
Show resolved Hide resolved
$ref: "../keymanager-oapi.yaml#/components/responses/Forbidden"
"404":
$ref: "../keymanager-oapi.yaml#/components/responses/NotFound"
"500":
$ref: "../keymanager-oapi.yaml#/components/responses/InternalError"
23 changes: 0 additions & 23 deletions flows/client-specific/README.md

This file was deleted.

17 changes: 14 additions & 3 deletions keymanager-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ servers:
default: "https://public-mainnet-node.ethereum.org"

tags:
- name: Fee Recipient
description: Set of endpoints for management of fee recipient.
- name: Local Key Manager
description: Set of endpoints for key management of local keys.
- name: Remote Key Manager
Expand All @@ -41,6 +43,8 @@ paths:
$ref: './apis/local_keystores.yaml'
/eth/v1/remotekeys:
$ref: './apis/remote_keystores.yaml'
/eth/v1/feerecipient/{pubkey}:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the bit i think, if we just change this in the current PR to be /eth/v1/validator/{pubkey}/feerecipient I think we leave the change i was talking about easy without making people move from the one we do here...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh i misunderstood then, ok i'll follow that then and change it to under validator

$ref: './apis/fee_recipient.yaml'

components:
securitySchemes:
Expand All @@ -52,8 +56,12 @@ components:
schemas:
Pubkey:
$ref: './types/public_key.yaml'
Ethaddress:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EthAddress - missed capital ~A

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

$ref: './types/eth_address.yaml'
Keystore:
$ref: './types/keystore.yaml'
FeeRecipient:
$ref: './types/fee_recipient.yaml'
SignerDefinition:
$ref: './types/signer_definition.yaml'
ImportRemoteSignerDefinition:
Expand All @@ -70,21 +78,24 @@ components:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"

Unauthorized:
description: "Unauthorized, no token is found"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"

Forbidden:
description: "Forbidden, a token is found but is invalid"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"

NotFound:
description: "Path not found"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
InternalError:
description: |
Internal server error. The server encountered an unexpected error indicative of
Expand Down
4 changes: 4 additions & 0 deletions types/eth_address.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type: string
description: "An address on the execution (Ethereum 1) network."
example: "0xabcf8e0d4e9587369b2301d0790347320302cc09"
pattern: "^0x[a-fA-F0-9]{40}$"
7 changes: 7 additions & 0 deletions types/fee_recipient.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: object
required: [pubkey,ethaddress]
properties:
pubkey:
$ref: './public_key.yaml'
ethaddress:
$ref: './eth_address.yaml'