core/validatorapi: preserve sync selections response order - #4641
core/validatorapi: preserve sync selections response order#4641KaloyanTanev wants to merge 2 commits into
Conversation
Build the response by iterating the original request slice instead of the internal Go map, so response[i] corresponds to request[i]. Prysm matches aggregated selection proofs to requests by array index; random map iteration attached proofs to wrong subcommittees, causing "signature not verified" 500s on submit_contribution_and_proofs.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4641 +/- ##
=======================================
Coverage 58.16% 58.17%
=======================================
Files 247 247
Lines 34063 34065 +2
=======================================
+ Hits 19814 19816 +2
Misses 11774 11774
Partials 2475 2475 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Fixes incorrect ordering in SyncCommitteeSelections responses by avoiding Go map iteration order, ensuring validator clients that match responses by index (e.g., Prysm) receive proofs aligned to the original request order.
Changes:
- Build
SyncCommitteeSelectionsresponse by iterating the original request slice (preserving index order) rather than iterating the internal map. - Update existing tests to assert response order is preserved (instead of order-insensitive comparisons).
- Add a new regression test that submits subcommittee selections in reverse order to reliably detect ordering regressions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| core/validatorapi/validatorapi.go | Preserves request order when constructing the sync committee selections response. |
| core/validatorapi/validatorapi_test.go | Strengthens order assertions and adds a regression test for response ordering. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Avoid mutating shared package-level map state.
|



SyncCommitteeSelectionsbuilt its response by iterating a Go map, which randomizes order. Prysm matchesresponse[i]torequest[i]by array index, so shuffled order attaches proofs to wrong subcommittees -"signature not verified"500s onsubmit_contribution_and_proofs.Fix: build the response by iterating the original request slice instead of the map. Added a test that sends subcommittees in reverse order to catch this reliably.
category:bug
ticket:none