sui icon indicating copy to clipboard operation
sui copied to clipboard

[GraphQL/MovePackage] Paginate by version

Open amnn opened this issue 1 year ago • 1 comments

Description

Introduce two new queries: Query.packageVersions and MovePackage.versions for iterating over all the different versions of a given package.

This kind of query is useful for understanding package history.

These were introduced as a separate query, instead of having a single query for iterating over packages that could optionally take a checkpoint bounds or version bounds because of how system packages interact with the packages table:

Because system packages are updated in-place, they only have one row in the packages table. This makes sense for paginating packages in bulk (e.g. by checkpoint) where the primary aim is to get a snapshot of the packages available at a certain point in time, but doesn't work for answering package version queries for system packages, and it prevents us from creating a combined query. A combined query would also allow someone to create a filter that bounds checkpoints and versions, but doesn't bound the package itself (or would require us to prevent that combination), which is complicated to implement efficiently and not particularly useful.

Test plan

New E2E tests:

sui$ cargo nextest run -p sui-graphql-e2e-tests \
  --features pg_integration                     \
  -- packages/versioning

& Testing against a read replica to make sure system package tests work well, and performance is reasonable.

Stack

  • #17686
  • #17687
  • #17688
  • #17689
  • #17691
  • #17694
  • #17695
  • #17542
  • #17690
  • #17543
  • #17692
  • #17693
  • #17696

Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • [ ] Protocol:
  • [ ] Nodes (Validators and Full nodes):
  • [ ] Indexer:
  • [ ] JSON-RPC:
  • [x] GraphQL: Introduces Query.packageVersions and MovePackage.versions for paginating over the versions of a particular package.
  • [ ] CLI:
  • [ ] Rust SDK:

amnn avatar May 13 '24 15:05 amnn

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
multisig-toolkit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 19, 2024 10:55am
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 19, 2024 10:55am
sui-kiosk ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 19, 2024 10:55am
sui-typescript-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 19, 2024 10:55am

vercel[bot] avatar May 13 '24 15:05 vercel[bot]