Skip to content

fix(server): match getPayload SSZ preference by relay URL string - #909

Open
SashaMIT wants to merge 1 commit into
flashbots:developfrom
SashaMIT:fix/getpayload-ssz-relay-match
Open

fix(server): match getPayload SSZ preference by relay URL string#909
SashaMIT wants to merge 1 commit into
flashbots:developfrom
SashaMIT:fix/getpayload-ssz-relay-match

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Aug 8, 2026

Copy link
Copy Markdown

Summary

  • processBid stores RelayEntry.Copy() (new *url.URL) when recording which relays delivered a bid and whether they spoke SSZ.
  • innerGetPayload compared relay.URL == originalBidRelay.URL by pointer, so the match always failed after a real getHeader → getPayload path.
  • Result: SupportsSSZ was ignored and SSZ proposer bodies were always converted to JSON for every relay (extra latency on the critical path; breaks SSZ-only relays).
  • Fix: compare relays with RelayEntry.String() (same identity key used elsewhere). Unit test reproduces the Copy() path.

Test plan

  • go test ./server/ -count=1 -run 'TestGetPayload$/SSZ preference'
  • go test ./server/ -count=1
  • go build ./...

Made with Cursor

processBid stores RelayEntry.Copy(), which allocates a new *url.URL.
Pointer equality therefore never matched live relay configs, so SupportsSSZ
was always treated as false and SSZ getPayload bodies were converted to JSON.
Copilot AI lite review requested due to automatic review settings August 8, 2026 03:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes SSZ encoding preference selection in getPayload by avoiding pointer equality on copied *url.URL values; ensures relays that support SSZ continue to receive SSZ proposer bodies on the critical path.

Changes:

  • Compare relays by RelayEntry.String() (URL string) instead of *url.URL pointer equality when determining SupportsSSZ.
  • Replace slices.Contains logging with a precomputed relayProvidedBid derived from the same matching logic.
  • Add a unit test that reproduces the RelayEntry.Copy() path and asserts the winning SSZ relay receives SSZ.

Reviewed changes

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

File Description
server/get_payload.go Fix relay matching for SSZ preference by comparing relays via URL string and adjust related logging.
server/service_test.go Add regression test ensuring SSZ preference survives RelayEntry.Copy() in the bid cache.

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

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