Repository navigation
Add POST builders query endpoint #614
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
Changes from 1 commit
7cdab88
80516ba
68449e2
cb45ca3
98142ed
0050f4e
be7d5cd
9ea2597
b415d0f
f1fd94d
4d2c986
3bdbf0e
5d8c099
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| post: | ||
| operationId: "postStateBuilders" | ||
|
rolfyone marked this conversation as resolved.
Resolved
|
||
| summary: "Get builders from state" | ||
| description: | | ||
| Returns filterable list of builders with their status and index. | ||
|
|
||
| Information will be returned for all indices or public keys that match known builders. If an index or public key does not | ||
| match any known builder, no information will be returned but this will not cause an error. There are no guarantees for the | ||
| returned data in terms of ordering; both the index and public key are returned for each builder, and can be used to confirm | ||
| for which inputs a response has been returned. | ||
|
|
||
| Returns 400 if the requested state is prior to Gloas. | ||
|
|
||
| Depending on `Accept` header data can be returned either as JSON or as bytes serialized by SSZ. | ||
|
nflaig marked this conversation as resolved.
Resolved
|
||
| tags: | ||
| - Beacon | ||
| parameters: | ||
| - name: state_id | ||
| in: path | ||
| $ref: '../../../beacon-node-oapi.yaml#/components/parameters/StateId' | ||
| requestBody: | ||
| description: "The list of builder IDs to filter on. Values are either hex encoded public keys (any bytes48 with 0x prefix) or builder indices. If no body is supplied then all builders will be returned." | ||
| required: false | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: object | ||
| required: [] | ||
| properties: | ||
| ids: | ||
| type: array | ||
| uniqueItems: true | ||
| description: | | ||
| An array of values, with each value either a hex encoded public key (any bytes48 with 0x prefix) or a builder index. | ||
|
|
||
| If the supplied list is empty (i.e. the value is `[]`) or the property is omitted then all builders will be returned. | ||
| items: | ||
| type: string | ||
| responses: | ||
| "200": | ||
| description: Success | ||
| content: | ||
| application/json: | ||
| schema: | ||
| title: PostStateBuildersResponse | ||
| type: object | ||
| required: [execution_optimistic, finalized, data] | ||
| properties: | ||
| execution_optimistic: | ||
| $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic" | ||
| finalized: | ||
| $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized" | ||
| data: | ||
| type: array | ||
| items: | ||
| $ref: '../../../beacon-node-oapi.yaml#/components/schemas/BuilderResponse' | ||
| application/octet-stream: | ||
| schema: | ||
| description: "SSZ serialized results. Use Accept header to choose this response type" | ||
| "400": | ||
| description: "Invalid state ID, builder ID, or malformed request" | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" | ||
| example: | ||
| code: 400 | ||
| message: "Invalid state ID: current" | ||
| "404": | ||
| description: "State not found" | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" | ||
| example: | ||
| code: 404 | ||
| message: "State not found" | ||
| "406": | ||
| $ref: "../../../beacon-node-oapi.yaml#/components/responses/NotAcceptable" | ||
| "500": | ||
| $ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,18 @@ ValidatorIdentityResponse: | |
| $ref: "./primitive.yaml#/Uint64" | ||
| description: "Epoch when validator activated. 'FAR_FUTURE_EPOCH' if not activated" | ||
|
|
||
| BuilderResponse: | ||
| type: object | ||
| required: [index, status, builder] | ||
| properties: | ||
| index: | ||
| $ref: './primitive.yaml#/Uint64' | ||
| description: "Index of builder in builder registry." | ||
| status: | ||
| $ref: "#/BuilderStatus" | ||
| builder: | ||
| $ref: "./gloas/builder.yaml#/Gloas/Builder" | ||
|
|
||
| ValidatorStatus: | ||
| description: | | ||
| Possible statuses: | ||
|
|
@@ -57,6 +69,16 @@ ValidatorStatus: | |
| enum: ["pending_initialized", "pending_queued", "active_ongoing", "active_exiting", "active_slashed", "exited_unslashed", "exited_slashed", "withdrawal_possible", "withdrawal_done"] | ||
| example: "active_ongoing" | ||
|
|
||
| BuilderStatus: | ||
| description: | | ||
| Possible statuses: | ||
| - **0** - pending | ||
| - **1** - active | ||
| - **2** - withdrawn | ||
|
rolfyone marked this conversation as resolved.
Resolved
|
||
| type: integer | ||
| enum: [0, 1, 2] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. echoing what @etan-status mentioned here #601 (comment), we might wanna follow the validators api for now and figure out a proper enum solution later, it's definitely not ideal that this api won't support ssz initially but especially for builders it should not be as problematic as there won't be that many compared to validators
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's fairly academic.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
enum ssz type doesn't require a hard fork, it will be optional so once we have a well-defined enum ssz type with a spec we can start implementing this already and clients that do have it can support ssz on the validators and builders api since adding it later is backward compatible |
||
| example: 1 | ||
|
nflaig marked this conversation as resolved.
Resolved
|
||
|
|
||
|
|
||
| Committee: | ||
| description: Group of validators assigned to attest at specific slot and that have the same committee index (shard in phase 1) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| Gloas: | ||
| Builder: | ||
| type: object | ||
| description: "The [`Builder`](https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.8/specs/gloas/beacon-chain.md#builder) object from the CL Gloas spec." | ||
|
rolfyone marked this conversation as resolved.
Resolved
|
||
| required: [pubkey, version, execution_address, balance, deposit_epoch, withdrawable_epoch] | ||
| properties: | ||
| pubkey: | ||
| $ref: "../primitive.yaml#/Pubkey" | ||
| version: | ||
| $ref: "../primitive.yaml#/Uint8" | ||
| description: "Builder version." | ||
| execution_address: | ||
| $ref: "../primitive.yaml#/ExecutionAddress" | ||
| description: "Execution-layer address that receives builder withdrawals." | ||
| balance: | ||
| $ref: "../primitive.yaml#/Gwei" | ||
| description: "Current builder balance in gwei." | ||
| deposit_epoch: | ||
| $ref: "../primitive.yaml#/Uint64" | ||
| description: "Epoch when the builder deposit was processed." | ||
| withdrawable_epoch: | ||
| $ref: "../primitive.yaml#/Uint64" | ||
| description: "Epoch when the builder can withdraw. 'FAR_FUTURE_EPOCH' if not exiting." | ||
Uh oh!
There was an error while loading. Please reload this page.