Skip to content

feat(synapse-sdk): expose paginated client dataset queries in WarmStorageService#717

Merged
hugomrdias merged 2 commits into
FilOzone:masterfrom
Chaitu-Tatipamula:paginated-fwss-reads-sdk-part
Apr 14, 2026
Merged

feat(synapse-sdk): expose paginated client dataset queries in WarmStorageService#717
hugomrdias merged 2 commits into
FilOzone:masterfrom
Chaitu-Tatipamula:paginated-fwss-reads-sdk-part

Conversation

@Chaitu-Tatipamula
Copy link
Copy Markdown
Contributor

@Chaitu-Tatipamula Chaitu-Tatipamula commented Apr 2, 2026

Summary

Exposes the paginated client dataset actions from synapse-core (#698) in WarmStorageService, enabling consumers to use offset/limit for dataset queries.

Changes

packages/synapse-sdk/src/warm-storage/service.ts

  • getClientDataSets — Added optional offset/limit parameters to support paginated queries
  • getClientDataSetIds — New method wrapping getClientDataSetIds from synapse-core, returns dataset ID arrays with optional pagination
  • getClientDataSetsLength — New method wrapping getClientDataSetsLength from synapse-core, returns total dataset count for a client
  • getClientDataSetsWithDetails — Refactored to use getClientDataSetIds instead of raw readContract call

Related

with this in place
Closes #691

@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Apr 2, 2026
@Chaitu-Tatipamula Chaitu-Tatipamula force-pushed the paginated-fwss-reads-sdk-part branch from 8dcf2c0 to 2c4a880 Compare April 2, 2026 19:36
@BigLep BigLep moved this from 📌 Triage to 🔎 Awaiting review in FOC Apr 12, 2026
@BigLep BigLep requested a review from Copilot April 12, 2026 21:08
@BigLep BigLep added this to the M4.2: mainnet GA milestone Apr 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates WarmStorageService in synapse-sdk to expose the new paginated client dataset query actions added in synapse-core, enabling consumers to query client datasets using offset/limit and retrieve dataset counts/IDs.

Changes:

  • Extended getClientDataSets to accept optional offset/limit for paginated reads.
  • Added getClientDataSetsLength and getClientDataSetIds wrappers to expose total count and paginated ID reads.
  • Refactored getClientDataSetsWithDetails to fetch dataset IDs via the new core action instead of a direct readContract call.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/synapse-sdk/src/warm-storage/service.ts Outdated
Comment thread packages/synapse-sdk/src/warm-storage/service.ts Outdated
Comment thread packages/synapse-sdk/src/warm-storage/service.ts Outdated
Comment thread packages/synapse-sdk/src/warm-storage/service.ts Outdated
Comment thread packages/synapse-sdk/src/warm-storage/service.ts Outdated
Comment thread packages/synapse-sdk/src/warm-storage/service.ts
@rjan90
Copy link
Copy Markdown
Collaborator

rjan90 commented Apr 13, 2026

@hugomrdias can you review this PR?

@Chaitu-Tatipamula Chaitu-Tatipamula force-pushed the paginated-fwss-reads-sdk-part branch from 2c4a880 to 0b8b732 Compare April 13, 2026 18:08
- Fix JSDoc to use `0n` instead of `0` for bigint parameters
- Use OutputType aliases for return type consistency
- Implement chunked pagination in getClientDataSetsWithDetails to avoid unbounded response size
- Use wrapper method internally for consistency
- Add comprehensive tests for pagination methods
Comment on lines +165 to +183
const totalDataSets = await this.getClientDataSetsLength({ address })
if (totalDataSets === 0n) return []

// Fetch IDs in chunks to avoid unbounded response size
const pageSize = 100n
const ids: bigint[] = []

for (let offset = 0n; offset < totalDataSets; offset += pageSize) {
const remaining = totalDataSets - offset
const limit = remaining < pageSize ? remaining : pageSize
const pageIds = await this.getClientDataSetIds({
address,
offset,
limit,
})

if (pageIds.length === 0) break
ids.push(...pageIds)
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rvagg any reason we didnt use the hasMore pattern from pdp-verifier for these new methods ?

@github-project-automation github-project-automation Bot moved this from 🔎 Awaiting review to ✔️ Approved by reviewer in FOC Apr 14, 2026
@hugomrdias hugomrdias merged commit 0add8e0 into FilOzone:master Apr 14, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FOC Apr 14, 2026
anjor added a commit to anjor/pynapse that referenced this pull request Apr 18, 2026
Mirrors FilOzone/synapse-sdk#717.

- get_client_data_sets now accepts offset/limit and uses the paginated
  view overload. Default offset=0, limit=0 returns the full list.
- Adds get_client_data_set_ids(client, offset, limit) backed by the
  view contract's clientDataSets ID-only accessor.
- Adds get_client_data_sets_length(client) wrapping
  getClientDataSetsLength.

Available on both SyncWarmStorageService and AsyncWarmStorageService.
anjor added a commit to anjor/pynapse that referenced this pull request Apr 18, 2026
Mirrors FilOzone/synapse-sdk#717.

- get_client_data_sets now accepts offset/limit and uses the paginated
  view overload. Default offset=0, limit=0 returns the full list.
- Adds get_client_data_set_ids(client, offset, limit) backed by the
  view contract's clientDataSets ID-only accessor.
- Adds get_client_data_sets_length(client) wrapping
  getClientDataSetsLength.

Available on both SyncWarmStorageService and AsyncWarmStorageService.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

Support paginated client dataset reads from FWSS

5 participants