Added SSZ support for validator balance responses - #10933
Merged
Conversation
Added SSZ support for validator balance responses using SszList<StateValidatorBalanceData>. Moved StateValidatorBalanceData into spec API schemas and added StateValidatorBalanceDataSchema. Updated GET/POST validator balances endpoints to advertise application/octet-stream and return 406 Not Acceptable when needed. Updated OpenAPI fixtures to include binary SSZ responses and a reusable ValidatorBalanceResponse schema. Added tests for SSZ response serialization and 406 metadata handling. Added StateValidatorBalances to the debug SSZ object types. Cleaned up formatting/import issues found during the build check.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 463cb93. Configure here.
gfukushima
approved these changes
Jul 3, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Added SSZ support for validator balance responses using SszList.
Moved StateValidatorBalanceData into spec API schemas and added StateValidatorBalanceDataSchema.
Updated GET/POST validator balances endpoints to advertise application/octet-stream and return 406 Not Acceptable when needed.
Updated OpenAPI fixtures to include binary SSZ responses and a reusable ValidatorBalanceResponse schema.
Added tests for SSZ response serialization and 406 metadata handling.
Added StateValidatorBalances to the debug SSZ object types.
Cleaned up formatting/import issues found during the build check.
Addresses ethereum/beacon-APIs#622
Fixes #10934
Documentation
doc-change-requiredlabel to this PR if updates are required.Changelog
Note
Medium Risk
Extends a widely used beacon REST API with new content negotiation and response shapes; JSON behavior should remain, but SSZ clients and metadata must stay aligned with the beacon-APIs spec.
Overview
Adds SSZ (
application/octet-stream) responses for GET and POST/eth/v1/beacon/states/{state_id}/validator_balances, alongside existing JSON. Clients that negotiate SSZ get serializedSszList<StateValidatorBalanceData>; unsupported negotiation can return 406 Not Acceptable.StateValidatorBalanceDatais moved fromapi.migratedintospec.schemas.apias an SSZ container (StateValidatorBalanceDataSchema/ValidatorBalanceResponse), andChainDataProvidernow builds balances viaSSZ_LIST_SCHEMAinstead of a plainList.OpenAPI fixtures gain
application/octet-stream, a sharedValidatorBalanceResponseschema, and 406 responses. Tests cover SSZ metadata serialization and 406 handling. The debug CLI accepts.sszinput and addsStateValidatorBalancesas an SSZ object type for pretty-printing.Reviewed by Cursor Bugbot for commit 64bd8a2. Bugbot is set up for automated code reviews on this repo. Configure here.