Skip to content

Construct and sign the Gloas SignedExecutionPayloadEnvelope, and broadcast it to beacon nodes - #503

Open
0w3n-d wants to merge 2 commits into
developfrom
od/gloas-step2-envelope-broadcast
Open

Construct and sign the Gloas SignedExecutionPayloadEnvelope, and broadcast it to beacon nodes#503
0w3n-d wants to merge 2 commits into
developfrom
od/gloas-step2-envelope-broadcast

Conversation

@0w3n-d

@0w3n-d 0w3n-d commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Issue: #489 (step 2 of 6)

Stacked on #501 — base branch is od/gloas-spec-link-cleanup, not develop. Retarget to develop once #501 merges.

What this PR does

  • BeaconClient/MultiBeaconClient::publish_execution_payload_envelope: POSTs a SignedExecutionPayloadEnvelope to a connected beacon node's /eth/v1/beacon/execution_payload_envelopes, mirroring publish_block's fan-out-and-return-on-first-success.
  • construct_signed_envelope: builds and signs the envelope from a proposer's signed block and a held payload, guarding against a missing held payload, a held-payload/bid block-hash mismatch, and a bid committing to a different builder_index than helix's configured identity.
  • GloasBuilderIdentity: helix's own Gloas builder identity (builder_index + key), signing under DOMAIN_BEACON_BUILDER — not the off-chain domain SignedBuilderBid uses. Reuses the relay's existing signing key; builder_index is a new RelayConfig field, defaulting to 0 as a placeholder until helix has a real on-chain builder registration.
  • Wires all of the above into submitSignedBeaconBlock: decodes the block, constructs and signs the envelope, and broadcasts it via MultiBeaconClient.
  • NoHeldPayloads: the GloasPayloadStore implementation used until step 3 lands a real one. Every real request currently gets a NoHeldPayloadForBlock error, which is correct: nothing has held a payload yet.

What this PR deliberately does not do

No real held-payload store yet (step 3). No support for external builders submitting their own signed bids/envelopes (deferred, see the issue's resolved design question).

Tests

Written before wiring, per the issue's tests-first convention:

  • BeaconClient::publish_execution_payload_envelope: correct headers/body, 200/202/error-response handling (httpmock).
  • MultiBeaconClient::publish_execution_payload_envelope: returns on first success, errors only if all clients fail.
  • construct_signed_envelope: correct construction, signature round-trip verification, and all three guard conditions.

Reviewer checklist

  • CI (lint, unit-test) is green
  • Matches the linked issue/step
  • No unexplained scope creep or unrelated files touched

Comment on lines +83 to +86
/// This relay's on-chain Gloas (ePBS) builder_index. Placeholder until helix has a real
/// on-chain builder registration; signs under the relay's own key in the meantime.
#[serde(default)]
pub gloas_builder_index: u64,

@ninaiiad ninaiiad Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we sure it will be better for the relay to have it's own builder identity as opposed to acting as a proxy?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we would want to support both. But to support the builder being the signer will require a lot more work.
In this first version I just want to get the minimum done to get the helix working on gloas.

For the builder to sign and helix to just proxy the bid I think we'll want to add new submission endpoints and so on.

Comment on lines +25 to +29
/// Looks up and consumes the payload held for a bid's committed block hash. Must not return
/// the same payload twice.
pub trait GloasPayloadStore: Send + Sync {
fn take_held_payload(&self, block_hash: B256) -> Option<HeldGloasPayload>;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it a trait?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'll fix this. Shouldn't be a trait.

Base automatically changed from od/gloas-spec-link-cleanup to develop September 3, 2026 17:14
@0w3n-d
0w3n-d force-pushed the od/gloas-step2-envelope-broadcast branch from 6c3aca0 to e9a8df7 Compare September 3, 2026 17:14
@0w3n-d
0w3n-d force-pushed the od/gloas-step2-envelope-broadcast branch from e9a8df7 to 552e72c Compare September 3, 2026 17:34
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.

2 participants