Skip to content

cl: fix Gloas bid selection, validation and publication - #23583

Open
yperbasis wants to merge 7 commits into
mainfrom
fix/gloas-external-bid-handling
Open

cl: fix Gloas bid selection, validation and publication#23583
yperbasis wants to merge 7 commits into
mainfrom
fix/gloas-external-bid-handling

Conversation

@yperbasis

@yperbasis yperbasis commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

Gloas ExecutionPayloadBid.value is denominated in Gwei, while execution-layer values and block-production metadata use Wei. Production compared the raw Gwei bid with the local Wei value, so external bids almost never won. It also narrowed execution values to uint64, which corrupted metadata above the Wei limit of that type.

Once external bid selection became reachable, a bid validated when it entered the pool could still become invalid against the production state. Parent execution requests can change builder eligibility before the current bid is processed. Selecting such a bid made the final state transition fail even though a valid self-built block was available. Gloas selection also ignored builder_boost_factor, retained local blob data after choosing an external bid, and made a legacy Builder API request whose result could not be used.

Consensus block value metadata was emitted in Gwei, while the beacon API requires Wei.

Changes

  • Keep execution values as exact big.Int Wei values through selection and response metadata.
  • Convert external Gloas bid values from Gwei to Wei before comparison and reporting.
  • Apply builder_boost_factor to Gloas external-bid selection.
  • Run the complete canonical ProcessBlock transition for a winning external bid on a production-state copy.
  • Reuse the successful candidate state and reward collector instead of replaying the transition.
  • Restore the self bid, value, blobs, and proofs and process it against the untouched state when the external transition fails.
  • Evict the rejected bid only after the self-build succeeds, and preserve a newer bid stored concurrently for the same key.
  • Clear local blobs and KZG proofs when an external bid wins.
  • Build local Gloas data-column sidecars only for self-built bids; external builders publish their payload data.
  • Skip the legacy Builder API getHeader request on Gloas, where external bids arrive through ePBS gossip.
  • Reject malformed, negative, and out-of-range Builder API block values before weighted comparison.
  • Convert consensus block value metadata from Gwei to Wei with overflow-safe arithmetic.
  • Log sidecars actually built by the node and avoid unused signed-header merkleization during Gloas publication.

The Gwei denomination follows the Gloas ExecutionPayloadBid specification.

Testing

  • go test ./cl/beacon/handler ./cl/pool ./cl/phase1/network/services -count=1
  • go test -race -timeout 10m ./cl/beacon/handler ./cl/pool ./cl/phase1/network/services -count=1
  • make test-short
  • make lint
  • make erigon integration

The behavior changes were developed with failing regression tests. Moving header merkleization into the branches that consume it was a pure refactor covered by the existing publication tests.

@yperbasis
yperbasis requested a balanced review from Copilot August 26, 2026 09:45
@yperbasis yperbasis added Glamsterdam https://eips.ethereum.org/EIPS/eip-7773 Caplin Caplin: Consensus Layer, Beacon API labels Aug 26, 2026
@yperbasis yperbasis added this to the 3.8.0 milestone Aug 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes Gloas bid valuation and publication by normalizing values to Wei and separating external-builder blob handling.

Changes:

  • Preserves execution values as big.Int.
  • Converts external bids from Gwei to Wei.
  • Skips local sidecar construction for external bids and adds focused tests.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
cl/cltypes/epbs_payload.go Documents Gloas bid value units.
cl/cltypes/block_production.go Documents execution value units.
cl/beacon/handler/block_production.go Fixes valuation, metadata, and sidecar publication.
cl/beacon/handler/block_production_test.go Adds valuation and publication tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cl/beacon/handler/block_production.go
@yperbasis
yperbasis marked this pull request as ready for review August 26, 2026 10:21
@yperbasis
yperbasis requested a balanced review from Copilot August 26, 2026 10:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@yperbasis
yperbasis marked this pull request as draft August 26, 2026 11:11
@yperbasis yperbasis changed the title cl: fix Gloas external bid value and publication cl: fix Gloas bid selection, validation and publication Aug 26, 2026
@yperbasis
yperbasis requested a balanced review from Copilot August 26, 2026 14:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread cl/beacon/handler/block_production.go
@yperbasis
yperbasis marked this pull request as ready for review August 27, 2026 10:41
@yperbasis
yperbasis requested a balanced review from Copilot August 27, 2026 10:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comment thread cl/beacon/builder/types.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Caplin Caplin: Consensus Layer, Beacon API Glamsterdam https://eips.ethereum.org/EIPS/eip-7773

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants