Skip to content

Commit

Permalink
Fee Recipient API (#24)
Browse files Browse the repository at this point in the history
* prysm flow

* prysm specific info

* remove DS_Store

* removed...

* initial commit

* fixing tags

* fixing linting

* adding warning that API works only post bellatrix

* updating based on some review comments

* fixing linting tabbing

* adjusting functions based on comment feedback

* updating description

* removing unneeded file

* deleted the wrong file adding it back in and deleting the correct one

* updating based on review comments

* updating based on review comments

* updating based on comments

* adjusting path
  • Loading branch information
james-prysm authored Apr 22, 2022
1 parent e9617c2 commit 28c18e1
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 26 deletions.
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":
$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":
$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/validator/{pubkey}/feerecipient:
$ref: './apis/fee_recipient.yaml'

components:
securitySchemes:
Expand All @@ -52,8 +56,12 @@ components:
schemas:
Pubkey:
$ref: './types/public_key.yaml'
EthAddress:
$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'

0 comments on commit 28c18e1

Please sign in to comment.