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

Add graffiti API #63

Merged
merged 7 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ such as GUIs, alerts, etc.
Learn about the Consensus Validator Clients that implement these APIs on the [Ethereum.org](https://ethereum.org/)

### v1 APIS
| Validator Client/Remote Managers | local keymanager | remote keymanager | fee recipient | gas limit |
| -------------------------------- | ---------------- | ----------------- | ------------- |------------|
| Prysm | production | production | production | production |
| Teku | production | production | production | production |
| Lighthouse | v2.1.2 | v2.3.0 | v2.4.0 | v3.0.0 |
| Nimbus | production | production | 22.7.0 | - |
| Lodestar | production | v0.40.0 | production | production |
| Web3signer | production | N/A | N/A | N/A |

| Validator Client/Remote Managers | local keymanager | remote keymanager | fee recipient | gas limit | graffiti |
| -------------------------------- | ---------------- | ----------------- | ------------- | ---------- | -------- |
| Prysm | production | production | production | production | - |
| Teku | production | production | production | production | - |
| Lighthouse | v2.1.2 | v2.3.0 | v2.4.0 | v3.0.0 | - |
| Nimbus | production | production | 22.7.0 | - | - |
| Lodestar | v0.35.0 | v0.40.0 | v1.2.0 | v1.2.0 | v1.12.0 |
| Web3signer | production | N/A | N/A | N/A | N/A |

## Use Cases

Expand All @@ -50,7 +51,7 @@ Further detail on expected behavior and error states of the APIs are listed in t

To render the spec in a browser you will need an HTTP server to serve the `index.html` file.
Rendering occurs client-side in JavaScript, so no changes are required to the HTML file between
edits.
edits.

##### Python

Expand Down
120 changes: 120 additions & 0 deletions apis/graffiti.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
get:
operationId: getGraffiti
summary: Get Graffiti
description: |
Get the graffiti for an individual validator. If no graffiti is set
explicitly, returns the process-wide default.
security:
- bearerAuth: []
tags:
- Graffiti
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: GraffitiResponse
type: object
required: [data]
properties:
data:
nflaig marked this conversation as resolved.
Show resolved Hide resolved
type: object
required: [graffiti]
properties:
pubkey:
$ref: "../keymanager-oapi.yaml#/components/schemas/Pubkey"
graffiti:
$ref: "../keymanager-oapi.yaml#/components/schemas/Graffiti"
"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"

post:
nflaig marked this conversation as resolved.
Show resolved Hide resolved
operationId: setGraffiti
summary: Set Graffiti
description: |
Set the graffiti for an individual validator.
security:
- bearerAuth: []
tags:
- Graffiti
parameters:
- in: path
name: pubkey
schema:
$ref: "../keymanager-oapi.yaml#/components/schemas/Pubkey"
required: true
requestBody:
content:
application/json:
schema:
title: SetGraffitiRequest
type: object
required: [graffiti]
properties:
graffiti:
$ref: "../keymanager-oapi.yaml#/components/schemas/Graffiti"
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"

delete:
operationId: deleteGraffiti
summary: Delete Configured Graffiti
description: |
Delete the configured graffiti for the specified public key.
nflaig marked this conversation as resolved.
Show resolved Hide resolved
security:
- bearerAuth: []
tags:
- Graffiti
parameters:
- in: path
name: pubkey
schema:
$ref: "../keymanager-oapi.yaml#/components/schemas/Pubkey"
required: true
responses:
"204":
description: Successfully removed the graffiti, or there was no graffiti set for the requested public key.
"400":
$ref: "../keymanager-oapi.yaml#/components/responses/BadRequest"
"401":
$ref: "../keymanager-oapi.yaml#/components/responses/Unauthorized"
"403":
description: A graffiti was found, but cannot be removed. This may be because the graffiti was in configuration files that cannot be updated.
content:
application/json:
schema:
$ref: "../keymanager-oapi.yaml#/components/schemas/ErrorResponse"
"404":
description: The key was not found on the server, nothing to delete.
content:
application/json:
schema:
$ref: "../keymanager-oapi.yaml#/components/schemas/ErrorResponse"
"500":
$ref: "../keymanager-oapi.yaml#/components/responses/InternalError"
6 changes: 6 additions & 0 deletions keymanager-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ tags:
description: Set of endpoints for management of fee recipient.
- name: Gas Limit
description: Set of endpoints for management of gas limits.
- name: Graffiti
description: Set of endpoints for management of graffiti.
- name: Local Key Manager
description: Set of endpoints for key management of local keys.
- name: Remote Key Manager
Expand All @@ -51,6 +53,8 @@ paths:
$ref: './apis/fee_recipient.yaml'
/eth/v1/validator/{pubkey}/gas_limit:
$ref: './apis/gas_limit.yaml'
/eth/v1/validator/{pubkey}/graffiti:
$ref: './apis/graffiti.yaml'
/eth/v1/validator/{pubkey}/voluntary_exit:
$ref: './apis/voluntary_exit.yaml'

Expand All @@ -72,6 +76,8 @@ components:
$ref: './types/fee_recipient.yaml'
GasLimit:
$ref: './types/gas_limit.yaml'
Graffiti:
$ref: './types/graffiti.yaml'
Uint64:
$ref: './types/uint.yaml#/Uint64'
SignerDefinition:
Expand Down
3 changes: 3 additions & 0 deletions types/graffiti.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type: string
description: "Arbitrary data to set in the graffiti field of BeaconBlockBody"
example: "plain text value"