Skip to content

Conversation

@faheelsattar
Copy link
Collaborator

@faheelsattar faheelsattar commented Nov 4, 2025

📝 Summary

This PR allows sending getPayloadV2 endpoint to all relays by allowing relay requests to continue in the background after receiving the first successful response.

This PR also involves improving the logging around MEV-Boost:

  1. We add color to the logs to improve readability
  2. in the GetPayload request handle, we ensure that we log the url and the errorBody upon response if there is an error.

✅ I have run these commands

  • make lint
  • make test-race
  • go mod tidy

// Create a context with a timeout as configured in the http client
requestCtx, requestCtxCancel := context.WithTimeout(context.Background(), m.httpClientGetPayload.Timeout)
defer requestCtxCancel()
originalVersionToUse := versionToUse
Copy link
Collaborator

@bharath-123 bharath-123 Nov 10, 2025

Choose a reason for hiding this comment

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

don't use an originalVersionToUse here. Each relay request is a separate go-routine and we need to handle each separately.
I think we just don't call requestCtxCancel at this point and let the other requests run.

@faheelsattar faheelsattar force-pushed the faheel/v2-payload-send-all branch from 08b7326 to 6011a60 Compare November 10, 2025 08:33
// falling back to the V1 API, falling back to the V1 API in the case of any error
// can be beneficial to the proposer to avoid a missed slot.
if resp.StatusCode >= http.StatusBadRequest && url == relay.GetURI(params.PathGetPayloadV2) {
log.Warn("relay may not support V2 API, Retrying with V1 API")
Copy link
Collaborator

Choose a reason for hiding this comment

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

The capitalized "Retrying" word should be lowercase.

Suggested change
log.Warn("relay may not support V2 API, Retrying with V1 API")
log.Warn("relay may not support V2 endpoint, retrying with V1 endpoint")

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or this if you prefer:

Suggested change
log.Warn("relay may not support V2 API, Retrying with V1 API")
log.Warn("relay may not support getPayloadV2, retrying with getPayloadV1")

// can be beneficial to the proposer to avoid a missed slot.
if resp.StatusCode >= http.StatusBadRequest && url == relay.GetURI(params.PathGetPayloadV2) {
log.Warn("relay may not support V2 API, Retrying with V1 API")
// retry with v1 api
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just a nit, you say "V1 API" (uppercase) in the comments above. A bit consistent.

Copy link
Collaborator

@jtraglia jtraglia left a comment

Choose a reason for hiding this comment

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

LGTM, but maybe fix the little warning message nit.

@bharath-123 bharath-123 merged commit 943bac8 into flashbots:develop Nov 10, 2025
2 checks passed
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.

3 participants