-
Notifications
You must be signed in to change notification settings - Fork 76
Staked Builder API for Glamsterdam #138
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
Open
bharath-123
wants to merge
17
commits into
main
Choose a base branch
from
epbs-updates
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
3f58cfb
initial builder-api for gloas
bharath-123 c1255e3
updates
bharath-123 8719a35
pass in params while querying execution payload bid
bharath-123 ffdc228
introduce validator registrations v2
bharath-123 05db388
run doctoc
bharath-123 49adb85
update validator registration v2
bharath-123 c5eadb1
add more specs
bharath-123 9bd69ae
run lint
bharath-123 a047abb
updates
bharath-123 dc342d6
abstract execution_payment_accepted to a BuilderPreferences struct
bharath-123 7e12901
minor fixes
bharath-123 4ef6a82
run doctoc
bharath-123 b8ad2f8
use correct method to check if builder is active
bharath-123 5e0cd76
save
bharath-123 f222e70
updates
bharath-123 1992f10
add information for bidding
bharath-123 a693a28
update
bharath-123 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| post: | ||
| operationId: "submitSignedBeaconBlock" | ||
| summary: Submit a signed beacon block with the execution payload bid. | ||
| description: | | ||
| Submits a `SignedBeaconBlock` to the builder, binding the proposer to the block. | ||
|
|
||
| A success response (200) indicates that the signed beacon block was | ||
| valid. If the signed beacon block was invalid, then the builder | ||
| must return an error response (400) with a description of the validation | ||
| failure. | ||
| tags: | ||
| - Builder | ||
| parameters: | ||
| - in: header | ||
| schema: | ||
| $ref: "../../builder-oapi.yaml#/components/schemas/ConsensusVersion" | ||
| required: false | ||
| name: Eth-Consensus-Version | ||
| description: "The active consensus version to which the block being submitted belongs. Required if request is SSZ encoded." | ||
| requestBody: | ||
| description: A `SignedBeaconBlock`. | ||
| required: true | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: object | ||
| required: [data] | ||
| properties: | ||
| data: | ||
| $ref: "../../beacon-apis/types/gloas/block.yaml#/Gloas/SignedBeaconBlock" | ||
| description: "The signed beacon block." | ||
| application/octet-stream: | ||
| schema: | ||
| description: "SSZ serialized `SignedBeaconBlock` bytes. Use content type header to indicate that SSZ data is contained in the request body." | ||
| responses: | ||
| "202": | ||
| description: Success response. | ||
| "400": | ||
| description: Error response. | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: "../../builder-oapi.yaml#/components/schemas/ErrorMessage" | ||
| example: | ||
| code: 400 | ||
| message: "Invalid signed beacon block: missing signature" | ||
| "415": | ||
| $ref: "../../builder-oapi.yaml#/components/responses/UnsupportedMediaType" | ||
| "500": | ||
| $ref: "../../builder-oapi.yaml#/components/responses/InternalError" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| get: | ||
| operationId: "getExecutionPayloadBid" | ||
| summary: Get an execution payload bid. | ||
| description: | | ||
| Requests a builder node to produce a valid execution payload bid, which | ||
| can be integrated into a blinded beacon block and signed. | ||
|
|
||
| If the builder is unable to produce a valid execution payload bid, then | ||
| the builder MUST return a 204 response. If the request is invalid, then the | ||
| builder MUST return an error response (400) with a description of the | ||
| validation failure. | ||
|
|
||
| This API is applicable from Glamsterdam fork onwards. | ||
| tags: | ||
| - Builder | ||
| parameters: | ||
| - name: slot | ||
| in: path | ||
| required: true | ||
| description: The slot for which the block should be proposed. | ||
| schema: | ||
| $ref: "../../builder-oapi.yaml#/components/schemas/Uint64" | ||
| - name: parent_hash | ||
| in: path | ||
| required: true | ||
| description: Hash of execution layer block the proposer will build on. | ||
| schema: | ||
| $ref: "../../builder-oapi.yaml#/components/schemas/Root" | ||
| - name: parent_root | ||
| in: path | ||
| required: true | ||
| description: Root of the beacon block the proposer will build on. | ||
| schema: | ||
| $ref: "../../builder-oapi.yaml#/components/schemas/Root" | ||
| - name: proposer_index | ||
|
Collaborator
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. should we stick with the proposer pubkey or use proposer index? |
||
| in: path | ||
| required: true | ||
| description: Index of the proposer. | ||
| schema: | ||
| $ref: "../../builder-oapi.yaml#/components/schemas/Uint64" | ||
| - name: Date-Milliseconds | ||
| in: header | ||
| required: false | ||
| description: | | ||
| Optional header containing a Unix timestamp in milliseconds representing | ||
| the point-in-time the request was sent. This header can be used to measure | ||
| latency. | ||
| schema: | ||
| type: integer | ||
| format: int64 | ||
| example: 1710338135000 | ||
| - name: X-Timeout-Ms | ||
| in: header | ||
| required: false | ||
| description: | | ||
| Optional header containing the proposer's timeout for the request in milliseconds. | ||
| Builders should use this header to adjust the amount of time by which they delay getBid | ||
| requests to maximise block rewards. Otherwise, getBid requests will timeout and the proposer | ||
| will not receive the header in time. | ||
| schema: | ||
| type: integer | ||
| format: int64 | ||
| example: 10000 | ||
| responses: | ||
| "200": | ||
| description: Success response. | ||
| headers: | ||
| Eth-Consensus-Version: | ||
| $ref: "../../builder-oapi.yaml#/components/headers/Eth-Consensus-Version" | ||
| required: false | ||
| content: | ||
| application/json: | ||
| schema: | ||
| title: GetExecutionPayloadBidResponse | ||
| type: object | ||
| required: [version, data] | ||
| properties: | ||
| version: | ||
| type: string | ||
| enum: [ gloas ] | ||
| example: "gloas" | ||
| data: | ||
| $ref: "../../beacon-apis/types/gloas/execution_payload_bid.yaml#/Gloas/ExecutionPayloadBid" | ||
| application/octet-stream: | ||
| schema: | ||
| description: "SSZ serialized `ExecutionPayloadBid` bytes. Use Accept header to choose this response type" | ||
| "204": | ||
| description: No header is available. | ||
| "400": | ||
| description: Error response. | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: "../../builder-oapi.yaml#/components/schemas/ErrorMessage" | ||
| examples: | ||
| InvalidRequest: | ||
| value: | ||
| code: 400 | ||
| message: "Unknown hash: missing parent hash" | ||
| "406": | ||
| $ref: "../../builder-oapi.yaml#/components/responses/NotAcceptable" | ||
| "500": | ||
| $ref: "../../builder-oapi.yaml#/components/responses/InternalError" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| post: | ||
| operationId: "registerValidatorV2" | ||
| summary: Register or update a validator's block building preferences for Gloas. | ||
| description: | | ||
| Registers a validator's preferred fee recipient, gas limit and preferences. | ||
|
|
||
| A success response (200) indicates that the registration was valid. If the | ||
| registration passes validation, then the builder MUST integrate the | ||
| registration into its state, such that future blocks built for the | ||
| validator conform to the preferences expressed in the registration. If the | ||
| registration is invalid, then the builder MUST return an error response | ||
| (400) with a description of the validation failure. | ||
| tags: | ||
| - Builder | ||
| requestBody: | ||
| description: | | ||
| A signed declaration of a validator's block building preferences. | ||
| required: true | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: array | ||
| items: | ||
| $ref: "../../builder-oapi.yaml#/components/schemas/SignedValidatorRegistrationV2" | ||
| example: | ||
| $ref: "../../builder-oapi.yaml#/components/examples/SignedValidatorRegistrations/value" | ||
| application/octet-stream: | ||
| schema: | ||
| description: "SSZ serialized `List[SignedValidatorRegistrationV2, VALIDATOR_REGISTRY_LIMIT]` bytes. Use content type header to indicate that SSZ data is contained in the request body." | ||
| responses: | ||
| "200": | ||
| description: Success response. | ||
| "400": | ||
| description: Error response. | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: "../../builder-oapi.yaml#/components/schemas/ErrorMessage" | ||
| example: | ||
| code: 400 | ||
| message: "unknown validator" | ||
| "415": | ||
| $ref: "../../builder-oapi.yaml#/components/responses/UnsupportedMediaType" | ||
| "500": | ||
| $ref: "../../builder-oapi.yaml#/components/responses/InternalError" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are no longer passing in the
slot,parent_hashandpubkeyas params in the path. I am unsure if we need to submit that data anymore since the validator already checks if the latest slot and parent_hash match from state while processing the ExecutionPayloadBid