Skip to content

rs-sdk: keep a paged read's next page at or after the block of the page before it #6081

Open

Description

@QuantumExplorer

Raised in the review of #6056.

rs-sdk's paged queries continue by a key boundary only. Examples: ContractModerationEntriesPageQuery::after, ContractDocumentRemovalsPageQuery::after and ContractTeamActionsPageQuery::after in packages/rs-sdk/src/platform/contract_moderation.rs, and the document listings work the same way.

The SDK's default height tolerance lets a response trail the newest height seen by one block. So a full first page answered at height H can be followed by a page answered at H-1. That second page leaves out a row added at H that sorts after the first page's cursor, and a host can read an empty or short page there as the end of the list.

Proposal:

  • carry the verified height of the page before in an SDK-owned continuation;
  • read the next page with the existing read_not_older_than (platform/documents/contest_vote_state.rs), as the contest vote state pages already do.

FFI and mobile bindings would pass the continuation through as an opaque value, with no comparison or retry policy of their own. This makes paging monotonic without promising a single-block snapshot.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions