Skip to content

Implement Gloas builder flow from beacon-APIs - #948

Open
hangleang wants to merge 10 commits into
developfrom
feature/gloas-builder-beacon-apis
Open

hangleang wants to merge 10 commits into
developfrom
feature/gloas-builder-beacon-apis

Conversation

@hangleang

@hangleang hangleang commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Specs: beacon-APIs#630, keymanager-APIs#88 (with #93, #94), builder-specs#138 (with #165, #168)

Beacon API

  • POST /eth/v4/validator/blocks/{slot} takes a BuilderConfig body, requests a bid from each builder entry while the block body is built, and picks the winner by builder_boost_factor * (value + min(execution_payment, max_execution_payment)) against the local payload. It validates those bids against the block production state before selection. Returns Eth-Builder-Url when a builder API bid wins.
  • POST /eth/v2/beacon/blocks forwards the signed block to the Eth-Builder-Url builder after publishing.
  • POST /eth/v1/validator/builder_preferences submits each entry to its builder.

Keymanager API

  • GET/POST/DELETE /eth/v1/validator/{pubkey}/builder_config. GET returns the fully resolved config, POST replaces it, DELETE resets it. Invalid configs (missing url, duplicate url + auth_data, a nonzero max_execution_payment without the opt-in) are rejected.
  • Per-key configs are validated when validators.yml loads.

Built-in validator

  • In the epoch before each proposal, it submits builder preferences to the key's builders and caches the signed auths to reuse during bid requests from builder APIs.
  • When proposing, it requests bids from the key's builders alongside the local payload, and forwards the beacon block to the builder whose bid won.

Builder API client

  • Implements client requests to builder API endpoints: getExecutionPayloadBid, submitBuilderPreferences and submitSignedBeaconBlock.
  • Request bodies follow --builder-api-format. A builder that answers an SSZ body with 415 or 406 gets the request again in JSON, and JSON from then on.

Testing

Kurtosis devnet with buildoor builder_api enabled connected to a grandine node with Lodestar VC (beacon api path) and a grandine node with its built-in validator.

participants:
  - el_type: geth
    el_image: ethpandaops/geth:master
    cl_type: grandine
    cl_binary_path: "./binaries/grandine-minimal"
    cl_force_restart: true
    cl_extra_env_vars:
      GRANDINE_LOG: "http_api=debug,block_producer=debug,builder_api=debug,fork_choice_control=debug"
    vc_type: lodestar
    vc_image: chainsafe/lodestar:latest
    vc_extra_params:
      - "--builder.urls=http://buildoor-grandine-geth-1:8080,http://builder-a.invalid:18550"
  - el_type: geth
    el_image: ethpandaops/geth:master
    cl_type: lighthouse
    cl_image: ethpandaops/lighthouse:unstable
    cl_log_level: debug
  - el_type: geth
    el_image: ethpandaops/geth:master
    cl_type: grandine
    cl_binary_path: "./binaries/grandine-minimal"
    cl_force_restart: true
    cl_extra_env_vars:
      GRANDINE_LOG: "validator=debug,block_producer=debug,builder_api=debug,fork_choice_control=debug"
    cl_extra_params:
      - "--payload-builder-urls=http://buildoor-grandine-geth-1:8080,http://builder-c.invalid:18550"
      - "--allow-trusted-payments"
      - "--default-builder-max-execution-payment=50000000"
    keymanager_enabled: true

network_params:
  gloas_fork_epoch: 1
  preset: minimal

additional_services:
  - dora
  - buildoor

buildoor_params:
  image: ethpandaops/buildoor:main-latest
  epbs_builder: true
  builder_api: true
  lifecycle: true
  extra_args:
    - "--builder-api-subsidy=150000000"
    - "--builder-api-execution-payment-percent=50"

port_publisher:
  cl:
    enabled: true

@hangleang
hangleang force-pushed the feature/gloas-builder-beacon-apis branch from 8f7f393 to 06a3308 Compare October 2, 2026 07:01
@hangleang hangleang linked an issue Oct 2, 2026 that may be closed by this pull request
@hangleang
hangleang force-pushed the feature/gloas-builder-beacon-apis branch from 06a3308 to 699f519 Compare October 8, 2026 07:49
@hangleang hangleang linked an issue Oct 8, 2026 that may be closed by this pull request
@hangleang
hangleang force-pushed the feature/gloas-builder-beacon-apis branch from 699f519 to 175c9e2 Compare October 8, 2026 08:56
There are two parts still missing: request bids from `builders` API
therefore no `Eth-Builder-Url` in the response headers
… validator

When proposing after the Gloas fork, the built-in validator resolves the key's builder config, signs a `BuilderRequestAuth` for each builder and requests bids alongside the local payload. If a builder-API bid wins, the signed block is also forwarded to that builder.

In the epoch before each of its proposals, the validator submits builder preferences to the key's builders and caches the signed auths, so the proposal can reuse them instead of signing again.
`PayloadBuilderApi` now sends getExecutionPayloadBid, submitBuilderPreferences and submitSignedBeaconBlock instead of failing with stub error `NotImplemented`.
@hangleang
hangleang force-pushed the feature/gloas-builder-beacon-apis branch from 175c9e2 to 0ed35bc Compare October 10, 2026 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add per-key builder configuration to key manager Add gloas builder beacon API

1 participant