fix(ssv): send SSV node operator ID as numeric uint64#474
Open
dnstaked wants to merge 1 commit into
Open
Conversation
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.
Problem
The SSV node
/v1/validatorsAPI expects theoperatorsfield as[]uint64, butrequest_ssv_pubkeys_from_ssv_nodeserialized the operator ID directly from an alloyU256. serde emitsU256as a hex string (e.g."0x64"), so the request body was{"operators":["0x64"]}.The SSV node rejects this with:
PBS then logs a warning and silently falls back to the public
api.ssv.networkAPI, so registry muxes never actually use the configured local SSV node.Fix
Narrow the operator ID to a
u64before 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
ssv_node_request_serializes_operator_as_number) asserting the oldU256path emits"0x64"and the fixed path emits100.cargo test -p cb-common interop::ssv::utilspasses.{"operators":[100]}returns200with the validator list, where{"operators":["0x64"]}returns400.Made with Cursor