fix(server): match getPayload SSZ preference by relay URL string - #909
Open
SashaMIT wants to merge 1 commit into
Open
fix(server): match getPayload SSZ preference by relay URL string#909SashaMIT wants to merge 1 commit into
SashaMIT wants to merge 1 commit into
Conversation
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.
There was a problem hiding this comment.
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.URLpointer equality when determiningSupportsSSZ. - Replace
slices.Containslogging with a precomputedrelayProvidedBidderived 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
processBidstoresRelayEntry.Copy()(new*url.URL) when recording which relays delivered a bid and whether they spoke SSZ.innerGetPayloadcomparedrelay.URL == originalBidRelay.URLby pointer, so the match always failed after a real getHeader → getPayload path.SupportsSSZwas ignored and SSZ proposer bodies were always converted to JSON for every relay (extra latency on the critical path; breaks SSZ-only relays).RelayEntry.String()(same identity key used elsewhere). Unit test reproduces theCopy()path.Test plan
go test ./server/ -count=1 -run 'TestGetPayload$/SSZ preference'go test ./server/ -count=1go build ./...Made with Cursor