Skip to content

fix(ssv): send SSV node operator ID as numeric uint64#474

Open
dnstaked wants to merge 1 commit into
Commit-Boost:mainfrom
dnstaked:feature-ssv-api-fix
Open

fix(ssv): send SSV node operator ID as numeric uint64#474
dnstaked wants to merge 1 commit into
Commit-Boost:mainfrom
dnstaked:feature-ssv-api-fix

Conversation

@dnstaked

@dnstaked dnstaked commented Jun 8, 2026

Copy link
Copy Markdown

Problem

The SSV node /v1/validators API expects the operators field as []uint64, but request_ssv_pubkeys_from_ssv_node serialized the operator ID directly from an alloy U256. serde emits U256 as a hex string (e.g. "0x64"), so the request body was {"operators":["0x64"]}.

The SSV node rejects this with:

400 Bad Request: json: cannot unmarshal string into Go struct field ValidatorsRequest.operators of type uint64

PBS then logs a warning and silently falls back to the public api.ssv.network API, so registry muxes never actually use the configured local SSV node.

Fix

Narrow the operator ID to a u64 before building the JSON body so it serializes as a number ({"operators":[100]}). A bounds check guards against an out-of-range ID instead of panicking.

Testing

  • Added a regression test (ssv_node_request_serializes_operator_as_number) asserting the old U256 path emits "0x64" and the fixed path emits 100.
  • cargo test -p cb-common interop::ssv::utils passes.
  • Verified live against a Hoodi SSV node: {"operators":[100]} returns 200 with the validator list, where {"operators":["0x64"]} returns 400.

Made with Cursor

@dnstaked dnstaked requested a review from a team June 8, 2026 13:06
This was referenced Jun 8, 2026
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.

1 participant