Skip to content

SSZ-QL: Add endpoints (BeaconState/BeaconBlock)#15888

Merged
rkapka merged 19 commits intoOffchainLabs:developfrom
syjn99:feat/ssz-query-api
Oct 20, 2025
Merged

SSZ-QL: Add endpoints (BeaconState/BeaconBlock)#15888
rkapka merged 19 commits intoOffchainLabs:developfrom
syjn99:feat/ssz-query-api

Conversation

@syjn99
Copy link
Contributor

@syjn99 syjn99 commented Oct 17, 2025

What type of PR is this?

Feature

What does this PR do? Why is it needed?

This PR adds those endpoints:

  • /prysm/v1/beacon/states/{state_id}/query
  • /prysm/v1/beacon/blocks/{block_id}/query
    which follows the endpoint specification.

I added three SSZ containers for response:

class SSZQueryProof(Container):
    leaf: Bytes32
    gindex: uint64
    proofs: List[Bytes32, SSZ_QUERY_MAX_TREE_DEPTH]

class SSZQueryResponse(Container):
    root: Bytes32
    result: ByteList[SSZ_QUERY_MAX_RESULT_LENGTH]
    
class SSZQueryResponseWithProof(Container):
    root: Bytes32
    result: ByteList[SSZ_QUERY_MAX_RESULT_LENGTH]
    proof: Proof

Which issues(s) does this PR fix?

Part of #15587: Expose SSZ-QL as a new endpoint.

Other notes for review

  • After discussion with @rkapka, we decided to 1) return in SSZ encoded bytes and 2) only support a single query at this moment.
  • The existing containers for testing (e.g., VariableTestContainer) were moved to a new package (github.com/OffchainLabs/prysm/v6/proto/ssz_query/testing) that only has test-only containers. (which results in big LOC 😅)
  • sszInfo is modifed to be public, as it is also used in RPC package.
  • include_proof is not yet implemented, so the flag is ignored and always return the response without proof.
  • Spec document must be helpful to review this PR. Examples will give some real-world examples.

Acknowledgements

@syjn99 syjn99 requested a review from rkapka October 20, 2025 13:36
@rkapka rkapka enabled auto-merge October 20, 2025 15:18
@rkapka rkapka added this pull request to the merge queue Oct 20, 2025
Merged via the queue into OffchainLabs:develop with commit 5a897df Oct 20, 2025
15 checks passed
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.

2 participants

Comments