Skip to content

feat(api): add executionPayloadBid SSE event#17

Closed
lodekeeper wants to merge 3 commits intounstablefrom
feat/bid-sse-event
Closed

feat(api): add executionPayloadBid SSE event#17
lodekeeper wants to merge 3 commits intounstablefrom
feat/bid-sse-event

Conversation

@lodekeeper
Copy link
Copy Markdown
Owner

Summary

Adds the execution_payload_bid SSE event per beacon-APIs v5.0.0-alpha.1 event stream spec.

What it does

Emits an execution_payload_bid event when a SignedExecutionPayloadBid passes gossip validation on the execution_payload_bid topic. The event data follows the versioned wrapper pattern ({version, data}), consistent with payloadAttributes and other versioned events.

Changes

  • packages/api/src/beacon/routes/events.ts — New EventType.executionPayloadBid, event data type, and versioned SSZ codec
  • packages/beacon-node/src/network/processor/gossipHandlers.ts — Emit event after gossip validation and bid pool insertion
  • packages/api/test/unit/beacon/testData/events.ts — Test fixture for round-trip serialization

Spec reference

  • beacon-APIs v5.0.0-alpha.1: apis/eventstream/index.yaml

Emits an execution_payload_bid SSE event when a SignedExecutionPayloadBid
passes gossip validation. Follows the beacon-APIs v5.0.0-alpha.1 event
stream spec.

Changes:
- events.ts: New EventType.executionPayloadBid with versioned data
- gossipHandlers.ts: Emit event after bid pool insertion
- events test data: Add fixture for round-trip test
@lodekeeper lodekeeper closed this Apr 4, 2026
@lodekeeper lodekeeper reopened this Apr 4, 2026
executionPayloadGossip = "execution_payload_gossip",
/** The node has verified that the execution payload and blobs for a block are available and ready for payload attestation */
executionPayloadAvailable = "execution_payload_available",
/** The node has received a valid SignedExecutionPayloadBid (from P2P or API) that passes gossip validation on the execution_payload_bid topic */
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

does that match the spec exactly?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed — now matches the beacon-APIs spec verbatim: "The node has received a SignedExecutionPayloadBid (from P2P or API) that passes gossip validation on the execution_payload_bid topic"

const executionPayloadBid = sszDeserialize(topic, serializedData);
await validateGossipExecutionPayloadBid(chain, executionPayloadBid);

// Emit SSE event for valid gossip-validated bid
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

useless comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Removed.

@nflaig
Copy link
Copy Markdown

nflaig commented Apr 4, 2026

please make sure oapi spec tests are passing, and update to alpha.1, remove from ignore list

Address review feedback:
- JSDoc description now matches beacon-APIs spec verbatim
- Remove useless comment above emitter call
- update beacon oapi spec test to v5.0.0-alpha.1
- remove execution_payload_bid and data_column_sidecar from ignored topics
- align executionPayloadBid event fixture with the alpha.1 spec example
@lodekeeper
Copy link
Copy Markdown
Owner Author

Addressed.

  • bumped beacon oapi spec test from v5.0.0-alpha.0 -> v5.0.0-alpha.1
  • removed execution_payload_bid and data_column_sidecar from the ignored event list
  • aligned the executionPayloadBid event fixture with the alpha.1 spec example
  • verified packages/api/test/unit/beacon/oapiSpec.test.ts passes against alpha.1
  • lint + typecheck are green

Pushed in 19a4b5cbc3.

@nflaig
Copy link
Copy Markdown

nflaig commented Apr 5, 2026

@lodekeeper you can close this, I ported this to lodestar myself, thanks

@lodekeeper
Copy link
Copy Markdown
Owner Author

Closing as requested — thanks for porting this upstream! 🤖

@lodekeeper lodekeeper closed this Apr 5, 2026
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