-
Notifications
You must be signed in to change notification settings - Fork 781
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
Provide payloadAttributes
for block proposers in advance
#2936
Labels
bellatrix
Required to support the Bellatrix Upgrade
Comments
I think this will interact significantly with #2883, and should possibly be implemented in the same PR. |
paulhauner
changed the title
Provide
Provide Feb 25, 2022
payloadAttributes
in for block proposers in advancepayloadAttributes
for block proposers in advance
bors bot
pushed a commit
that referenced
this issue
Mar 9, 2022
## Issue Addressed Resolves #2936 ## Proposed Changes Adds functionality for calling [`validator/prepare_beacon_proposer`](https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Validator/prepareBeaconProposer) in advance. There is a `BeaconChain::prepare_beacon_proposer` method which, which called, computes the proposer for the next slot. If that proposer has been registered via the `validator/prepare_beacon_proposer` API method, then the `beacon_chain.execution_layer` will be provided the `PayloadAttributes` for us in all future forkchoiceUpdated calls. An artificial forkchoiceUpdated call will be created 4s before each slot, when the head updates and when a validator updates their information. Additionally, I added strict ordering for calls from the `BeaconChain` to the `ExecutionLayer`. I'm not certain the `ExecutionLayer` will always maintain this ordering, but it's a good start to have consistency from the `BeaconChain`. There are some deadlock opportunities introduced, they are documented in the code. ## Additional Info - ~~Blocked on #2837~~ Co-authored-by: realbigsean <[email protected]>
Resolved via #3043 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
According to the execution API spec, consensus clients must call
engine_forkchoiceUpdatedV1
(fcU) with apayloadAttributes
that is non-null
when the node expects to produce a block in the next slot. This gives the execution engine time to prepare the optimal set of transactions, before we request the payload.Lighthouse is not presently sending the
payloadAttributes
in advance. Instead, it always ends up hitting the fall-back path which sends the fcU message immediately before theengine_getPayloadV1
call.Mechanisms
In order to supply
payloadAttributes
in advance, we need the VC to call the/eth/v1/validator/prepare_beacon_proposer
, an endpoint currently implemented in a PR to the beacon-APIs repo.The simplest implementation would be for the BN to immediately do an fcU call when it receives something on the
prepare_beacon_proposer
endpoint. However, I don't think that's how we should implement it. There's a whole bunch of edge-cases regarding re-orgs and timing assumptions, I think it's best if the VC just says "hey I have this validator" and then the BN takes care of issuing the right call at the right time. AFAIK, this is how all other clients are implementing it too.To implement it properly, I think we should build a service in the BN that accepts
prepare_beacon_proposer
calls and then "registers" avalidator_index
as a local, potential block producer. Then, that service would issues the fcU with the appropriatepayloadAttributes
when it's some time (t
) before the start of a slot. It would also be re-org aware and could make sure the execution engine is kept up-to-date relative to a changing head.The API docs state:
So, this service needs to track each validator for 2-3 epochs and then forget about it. That means that the VC will need to issue this call at least once every 2-3 epochs. I suggest we do it more frequently, perhaps every epoch or every slot.
Steps Required
As I see it, we need to do the following things:
prepare_beacon_proposer
with all its validators (that have validator indices) every slot/epoch/whatever.The text was updated successfully, but these errors were encountered: