Gloas: external builder API (payload bid selection and block production) - #9757
Gloas: external builder API (payload bid selection and block production)#9757ethDreamer wants to merge 13 commits into
Conversation
67d6620 to
9dd827f
Compare
9dd827f to
a7ac4b7
Compare
|
Some required checks have failed. Could you please take a look @ethDreamer? 🙏 |
|
thanks for breaking it up into commits like this! im wondering if you would be willing to convert this into stacked PRs? We did this here: #9764 I think it makes reviewing big PRs much easier and hopefully more maintainable for the author. Lmk what you think |
|
This pull request has merge conflicts. Could you please resolve them @ethDreamer? 🙏 |
…ad error variants
…uilder-Url round-trip
a7ac4b7 to
9bebf0d
Compare
|
This PR has been split into a 5-PR Mergify stack for review, merging bottom-up into
The combined diff of the stack is identical to this PR's diff. This PR is now a draft serving as the end-to-end tracking view; review comments should go on the individual stack PRs. Unresolved feedback from reviews here will be re-raised on the relevant stack PR. |
|
@eserilev done! 🎉 See the stack linked in the comment above: #9803 → #9804 → #9805 → #9806 → #9807 (Mergify stack, merging bottom-up into A couple of notes on how it was cut:
Bottom-up review order is #9803 first — it's the smallest and unblocks the rest. This PR stays as a draft tracking view until the stack drains. |
Issue Addressed
Closes #9590.
Adds support for the Gloas (ePBS) external builder API: the flow by which a proposer solicits
execution payload bids from off-protocol builders, ranks them against its local build and
gossip-relayed bids, commits to a winner, and forwards the signed block to the winning builder so it
reveals the execution payload envelope.
Implements the relevant parts of:
produceBlockV4, builder-preferences endpoint,Eth-Builder-UrlgetExecutionPayloadBid,submitBuilderPreferences,submitSignedBeaconBlock, request authExecutionPayloadBidProposed Changes
A Gloas proposer now considers three payload sources — its local EL build, gossip bids, and bids
fetched directly from configured builders — selects the most profitable eligible one, and (for a
direct builder) forwards the signed block back for envelope reveal.
The branch is organized as a bottom-up, dependency-ordered stack of commits so it can be reviewed one
layer at a time:
(
compute_domain(DOMAIN_REQUEST_AUTH)) for authenticating Gloas builder-API requests.request auth, builder URL).
produceBlockV4, submitting builder preferences,and the
Eth-Builder-Urlresponse/echo header.Buildersservice thatfans
getExecutionPayloadBid/submitBuilderPreferences/submitSignedBeaconBlockout acrossa proposer's configured builders. The pre-Gloas relay client is relocated here.
sharing the state-dependent consistency checks.
BidCandidate/BidSource { Local, Gossip, Direct }model andselect_payload_bid, wired into Gloas blockproduction. All bid value math lives on
BidCandidate, computed on demand: ranking is the trustedvalue scaled by
builder_boost_factor, in wei, so the local EL block value compares directly andbuilder_boost_factor == u64::MAX("always prefer") is a plain multiply.min_bidis a rankingtier — a below-floor bid wins when it's the only option (e.g. the local build failed) but loses to
any floor-clearing candidate. Direct-bid BLS verification runs on a blocking thread (off the async
executor), and gossip bids are re-validated against the production state at selection time so a bid
that has gone stale since gossip verification can't win selection and then fail block processing.
Buildersservice (honoring--builder-user-agent/--builder-disable-ssz) and wire it into the chain.produceBlockV4,POST /eth/v1/validator/builder_preferences, and theEth-Builder-Urlpublish round-trip. The winning builder's URL travels back to the VC as aresponse header and is echoed on publish, so forwarding the signed block works even when the
publishing beacon node isn't the one that produced it.
production / publish.
Additional Info
Best reviewed commit-by-commit: the commits form a bottom-up dependency layering (types → wire types
→ clients → beacon_chain → node / network / API → validator_client), each a coherent per-crate
change.