-
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
base: main
Are you sure you want to change the base?
Conversation
01bb9e6 to
0cf7078
Compare
|
Open questions:
|
| @@ -0,0 +1,38 @@ | |||
| <!-- START doctoc generated TOC please keep comment here to allow auto update --> | |||
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.
What else can we spec out here?
| @@ -0,0 +1,34 @@ | |||
| <!-- START doctoc generated TOC please keep comment here to allow auto update --> | |||
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.
What else can we spec out here?
| This API is applicable from Glamsterdam fork onwards. | ||
| tags: | ||
| - Builder | ||
| parameters: |
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_hash and pubkey as 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
| required: false | ||
| description: | | ||
| Optional header containing the proposer's timeout for the request in milliseconds. | ||
| Relays should use this header to adjust the amount of time by which they delay getBid |
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.
| Relays should use this header to adjust the amount of time by which they delay getBid | |
| Builders should use this header to adjust the amount of time by which they delay getBid |
| type: integer | ||
| format: int64 | ||
| example: 10000 | ||
| - name: X-Fee-Recipient |
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.
Currently speccing it out to support sending the fee_recipient while sending the request to get the bid
|
Spellcheck fixes are trivial and shuoldn't block any feedback. |
specs/gloas/builder.md
Outdated
|
|
||
| This document documents the builder behaviour with the Builder-API. | ||
|
|
||
| ### `ValidatorRegistrationV1` are deprecated |
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.
Do we want to deprecate ValidatorRegistrationV1 going forward for gloas? or do builders want to keep it?
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.
There might be value keeping validator registrations for validators to communicate per builder preference.
|
Note: We want the response to the get the bid to be signed by the validator on the builder pub key and slot. This is so that the builder won't get spammed by other builders to reveal their bid. |
specs/gloas/builder.md
Outdated
| timestamp: uint64 | ||
| pubkey: BLSPubkey | ||
| can_accept_trusted_payment: bool | ||
| proposal_epoch: Epoch |
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 now suggest validator to send the registration only if they will be proposing in the upcoming epoch. This might be useful information to have?
specs/gloas/builder.md
Outdated
|
|
||
| ```python | ||
| class ValidatorRegistrationV2(Container): | ||
| builder_pubkey: BLSPubkey ## is this needed? |
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.
primary use of validator registrations with gloas is to indicate per builder preferences. Maybe this can be helpful for the builder to identify if the registration is indeed indicated for them.
specs/gloas/validator.md
Outdated
| This specification suggests validators re-submit registrations only if they will be proposing in the upcoming epoch(E+1). | ||
| This is to avoid sending a lot of `ValidatorRegistrations` every epoch. This can potentially help reduce the load | ||
| Validators are expected to perform this check at every epoch boundary. Validators can send their registrations even though | ||
| they won't be proposing in the upcoming epoch. |
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 don't want to have a very strong enforcement on validators to send registrations only when they are proposing in epoch E+1 but we recommend them to do this.
1a37a61 to
9bd69ae
Compare
| def verify_registration_signature(state: BeaconState, signed_registration: SignedValidatorRegistrationV2) -> bool: | ||
| validator = state.validators[signed_registration.message.validator_index] | ||
| pubkey = validator.pubkey | ||
| domain = compute_domain(DOMAIN_APPLICATION_BUILDER) |
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.
Do we need to update the domain as we are introducing a new type of registration?
|
|
||
| ```python | ||
| class BuilderPreferences(Container): | ||
| execution_payment_accepted: boolean |
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.
Can we allow validators to express arbitrary preferences here? That might be useful for proposers and builders alike. But the proposer and builders will have to agree on the scheme for preferences ahead of time. And on the other hand, hard coding preferences into BuilderPreferences will have to involve a co-ordinated rollout amongst clients.
| assert signed_bid.prev_randao == get_randao_mix(state, get_current_epoch(state)) | ||
| assert is_builder(state, builder.pubkey) | ||
|
|
||
| if signed_bid.value > 0: |
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.
it might not be necessary for a builder to use the execution_payment field to pay the bid even through the builder-api.
|
|
||
| ```python | ||
| def is_eligible_for_bid(state: BeaconState, | ||
| registrations: Dict[BLSPubkey, ValidatorRegistrationV2], |
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.
I guess it shouldn't be relevant to use whether registrations are a Dict from BLSPubKey -> ValidatorRegistrationV2 or ValidatorIndex -> ValidatorRegistrationV2? or maybe it does?
| description: Root of the beacon block the proposer will build on. | ||
| schema: | ||
| $ref: "../../builder-oapi.yaml#/components/schemas/Root" | ||
| - name: proposer_index |
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.
should we stick with the proposer pubkey or use proposer index?
This PR begins work and discussions on the builder-spec for ePBS for staked builders.
ePBS introduces the following protocol upgrades:
A high level description of the design is available at: https://hackmd.io/J24hFHFvRl2DOZijvocukg?view
We introduce 2 new APIs(we have room for bikeshedding these names):
getExecutionPayloadBid: GET/eth/v1/builder/execution_payload_bidThis API is called by the proposer to the builder/relay. The proposer sends the
fee_recipientas a header along with the request. The builder/relay returns an execution payload bid with theexecution_paymentdirected to the sentfee_recipient.submitSignedBeaconBlock: POST/eth/v1/builder/beacon_blockThis API is called by the proposer to the builder/relay when the proposer commits to the bid received from
getExecutionPayloadBid. The proposer sends the signed beacon block with the execution payload bid embedded to it.We introduce
ValidatorRegistrationV2which contains the following new fields:builder_index: This is the index of the builder to which the registration is being sent.validator_index: This is the index of the validator to which the registration is being sent.builder_preferences: This contains the per builder preferences per validator. Currently the only builder preference supported isexecution_payment_accepted.proposal_slot: This slot in which this validator will be proposing.In gloas, All the validators will not send validator registrations every epoch like how it worked till Fulu. A validator will send it's registration in the epoch prior to which it will propose.
e.g, let's say a validator will propose in epoch E+1, it will send it's validator registrations at epoch E.
This spec is based on: ethereum/consensus-specs#4788 which is not yet merged.
Closes: #137