Skip to content

Conversation

@DSCmatter
Copy link

@DSCmatter DSCmatter commented Dec 13, 2025

This Closes #978

This PR updates the /blocks/at/{height} endpoint to return a structured response that explicitly distinguishes the best block from forked blocks at a given height. This removes ambiguity in the API response and makes fork handling explicit for API consumers.

Changes

API Logic

  • BlocksApiRoute.scala
    • Modified getHeaderIdsAtHeight to return:
      {
        "best": "blockId",
        "forks": ["forkId1", "forkId2"]
      }

BlocksApiRouteSpec.scala

  • Updated the get block at height test to assert the presence and correctness of the best and forks fields.

OpenAPI Specification

  • openapi.yaml
    • Updated the /blocks/at/{blockHeight} response schema to match the new structured format.

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.

Extract best block id in separate field in /blocks/at/{height} API method response.

1 participant