feat: implement publishExecutionPayloadBid api#9392
Conversation
|
this is already part of #9289 |
There was a problem hiding this comment.
Code Review
This pull request implements the publishExecutionPayloadBid endpoint, enabling the beacon node to broadcast signed execution payload bids to the network. The changes include updating the API definitions, adding validation logic, and integrating the gossip network publishing functionality. The review feedback suggests improving observability by logging the number of peers reached during publication and using the more idiomatic sszTypesFor(fork) helper for persisting invalid SSZ values to ensure future-proof fork compatibility.
| await network.publishExecutionPayloadBid(signedExecutionPayloadBid); | ||
|
|
||
| chain.emitter.emit(routes.events.EventType.executionPayloadBid, { | ||
| version: fork, | ||
| data: signedExecutionPayloadBid, | ||
| }); |
There was a problem hiding this comment.
It is recommended to log the number of peers the bid was successfully published to, consistent with the implementation of publishExecutionPayloadEnvelope. This improves observability and helps in debugging network propagation issues.
const sentPeers = await network.publishExecutionPayloadBid(signedExecutionPayloadBid);
chain.emitter.emit(routes.events.EventType.executionPayloadBid, {
version: fork,
data: signedExecutionPayloadBid,
});
chain.logger.info("Published execution payload bid", {...logCtx, sentPeers});| if (e instanceof ExecutionPayloadBidError && e.action === GossipAction.REJECT) { | ||
| chain.persistInvalidSszValue(ssz.gloas.SignedExecutionPayloadBid, signedExecutionPayloadBid, "api_reject"); | ||
| } |
There was a problem hiding this comment.
Using sszTypesFor(fork).SignedExecutionPayloadBid is more idiomatic in Lodestar and ensures that the correct fork-specific type is used for persistence, especially as the protocol evolves in future forks.
| if (e instanceof ExecutionPayloadBidError && e.action === GossipAction.REJECT) { | |
| chain.persistInvalidSszValue(ssz.gloas.SignedExecutionPayloadBid, signedExecutionPayloadBid, "api_reject"); | |
| } | |
| if (e instanceof ExecutionPayloadBidError && e.action === GossipAction.REJECT) { | |
| chain.persistInvalidSszValue(sszTypesFor(fork).SignedExecutionPayloadBid, signedExecutionPayloadBid, "api_reject"); | |
| } |
Performance Report✔️ no performance regression detected Full benchmark results
|
Motivation
Implement the
publishExecutionPayloadBidBeacon API endpoint so external builders can submit signed bids without running their own beacon node.Closes a
TODO GLOASgap in the oapi conformance test.Description
POST /eth/v1/beacon/execution_payload_bidroute + handler, mirroringpublishExecutionPayloadEnvelope.network.publishExecutionPayloadBidsymmetric topublishProposerPreferences.validateApiExecutionPayloadBid,ExecutionPayloadBidPool, error types, gossip topic, metrics, and SSE event.AI Assistance Disclosure
Used Claude Code.