Skip to content

add get payload v2 #746

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

faheelsattar
Copy link

πŸ“ Summary

Introduces v2 blinded blocks endpoint which doesn't return the entire ExecutionPayload and BlobsBundle.

β›± Motivation and Context

Currently the /eth/v1/builder/blinded_blocks returns the entire ExecutionPayload and BlobsBundle. This can increase network bandwidth costs for the proposer and also the request time as we increase the number of Blobs. We therefore introduce a new v2 API endpoint, /eth/v2/builder/blinded_blocks which no longer returns the fully signed unblinded payload. Instead, it returns an empty response and relies on the relay to propagate the block.

πŸ“š References

ethereum/builder-specs#119
ethereum/builder-specs#123


βœ… I have run these commands

  • make lint
  • make test-race
  • go mod tidy
  • I have seen and agree to CONTRIBUTING.md

@faheelsattar faheelsattar marked this pull request as draft July 21, 2025 14:06
@faheelsattar
Copy link
Author

One thing to note here is that I have kept the naming to handleGetPayloadV2 even though we updated it for the mev-boost PR. There are some major changes if we also change the function name like mev-boost in mev-boost-relay. We can maybe discuss this how to move about it, whether to change the name for both mev-boost and mev-boost-relay or dont change it at all.

@@ -1343,6 +1345,7 @@ func (api *RelayAPI) checkProposerSignature(block *common.VersionedSignedBlinded
}
}

// Depreciated: Use handleGetPayloadV2. For more info visit: https://github.com/ethereum/builder-specs/issues/119

Choose a reason for hiding this comment

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

Suggested change
// Depreciated: Use handleGetPayloadV2. For more info visit: https://github.com/ethereum/builder-specs/issues/119
// Deprecated: Use handleGetPayloadV2. For more info visit: https://github.com/ethereum/builder-specs/issues/119

return
}

if api.isElectra(headSlot) && payload.Electra == nil {
Copy link

@bharath-123 bharath-123 Jul 22, 2025

Choose a reason for hiding this comment

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

we should rebase this PR from #745 to include fulu payloads.

Comment on lines +2099 to +2104
code, err := api.beaconClient.PublishBlock(signedBeaconBlock) // errors are logged inside
if err != nil || (code != http.StatusOK && code != http.StatusAccepted) {
log.WithError(err).WithField("code", code).Error("failed to publish block")
api.RespondError(w, http.StatusBadRequest, "failed to publish block")
return
}

Choose a reason for hiding this comment

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

Block publishing needs to be async. The API should return 202 success once we acknowledge the block is valid and do the block publishing async.

@@ -1752,6 +1755,401 @@ func (api *RelayAPI) handleGetPayload(w http.ResponseWriter, req *http.Request)
log.Info("execution payload delivered")
}

func (api *RelayAPI) handleGetPayloadV2(w http.ResponseWriter, req *http.Request) {

Choose a reason for hiding this comment

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

there is duplicate code here but I guess its fine since we will eventually remove V1 API in glamsterdam?

Copy link
Author

Choose a reason for hiding this comment

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

yeah the idea was that since we will be getting rid of it in glamsterdam we can introduce the duplication for time being for simiplicity.

@@ -1752,6 +1755,401 @@ func (api *RelayAPI) handleGetPayload(w http.ResponseWriter, req *http.Request)
log.Info("execution payload delivered")
}

func (api *RelayAPI) handleGetPayloadV2(w http.ResponseWriter, req *http.Request) {
api.getPayloadCallsInFlight.Add(1)

Choose a reason for hiding this comment

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

i am thinking whether we should allow concurrent runs of getPayloadV1 and getPayloadV2? whats the risk if someone calls both these APIs at the same time?

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