refactor(slots_v1): switch slot endpoint pagination from start_slot to page number#566
Merged
barnabasbusa merged 10 commits intomasterfrom Feb 10, 2026
Merged
refactor(slots_v1): switch slot endpoint pagination from start_slot to page number#566barnabasbusa merged 10 commits intomasterfrom
barnabasbusa merged 10 commits intomasterfrom
Conversation
…o page number The pagination logic for the `/api/v1/slots` endpoint changes from using `start_slot` to explicitly using a `page` query parameter. This change improves the clarity and usability of the API by: 1. Replacing `start_slot` with `page` (0-indexed). 2. Updating the response structure to include `page` and `next_page` instead of `next_slot`. 3. Removing complex, slot-based calculation for determining the page index. This aligns the slot endpoint with standard page-based pagination patterns used elsewhere.
… in slots V1 endpoint Add support for filtering slots up to a maximum slot number (`max_slot`) in the slots V1 API. This change introduces: 1. Adding `max_slot` to `APISlotsData` struct. 2. Documenting `max_slot` in the OpenAPI specification. 3. Parsing `max_slot` from query parameters and applying it as a filter (`blockFilter.MaxSlot`). 4. Calculating `NextSlot` when results are paginated beyond the limit, using the slot number of the first block on the next page (or the first block excluded from the current page if it exceeds the limit). This provides a more robust cursor for pagination when dealing with slot numbers, especially when combined with `max_slot` filtering.
…ovided in filter The `cacheStartSlot` was being initialized to `*filter.MaxSlot + 1`, which caused the query to potentially skip the block at `MaxSlot` when retrieving blocks from the cache. By changing it to `*filter.MaxSlot`, the query now correctly includes the block corresponding to the maximum slot specified in the filter.
The maximum number of results allowed in a single API response for slots is increased from 100 to 1000. This change allows users to fetch more slots in a single request, reducing the need for excessive pagination when a larger dataset is expected.
…slots Adds the `min_slot` query parameter to the `/api/v1/slots` endpoint. This allows consumers to specify the minimum slot number (inclusive) they wish to retrieve, improving filtering capabilities for slot data. Documentation is also updated to reflect this new parameter.
…to bbusa/orphaned-pages
This change introduces a step in the shared CI workflow that automatically checks if the generated API documentation files in the `docs/` directory are up-to-date. It runs `make api-docs` and then uses `git status` to ensure no documentation files have been modified locally but not committed. If the docs are stale, the check fails and outputs the specific changes, forcing contributors to generate and commit updated documentation. This ensures documentation always reflects the current state of the API.
pk910
approved these changes
Feb 10, 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 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.
The pagination logic for the
/api/v1/slotsendpoint changes from usingstart_slotto explicitly using apagequery parameter.This change improves the clarity and usability of the API by:
start_slotwithpage(0-indexed).pageandnext_pageinstead ofnext_slot.This aligns the slot endpoint with standard page-based pagination patterns used elsewhere.