Skip to content

graphql-alt: Epoch.systemPackages #22090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 0 commits into from
May 19, 2025
Merged

graphql-alt: Epoch.systemPackages #22090

merged 0 commits into from
May 19, 2025

Conversation

amnn
Copy link
Contributor

@amnn amnn commented May 9, 2025

Description

API for fetching the system packages that were used during a given epoch.

Test plan

New E2E basic tests:

sui$ cargo nextest run         \
  -p sui-indexer-alt-e2e-tests \
  -- graphql/epochs

...but transactional testing does not support system package upgrades, so this change was also tested manually against the production DB.

Stack


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):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

@amnn amnn requested review from emmazzz, wlmyng and Copilot May 9, 2025 14:29
@amnn amnn self-assigned this May 9, 2025
Copy link

vercel bot commented May 9, 2025

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

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 19, 2025 1:51pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview May 19, 2025 1:51pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview May 19, 2025 1:51pm

@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 9, 2025 14:29 — with GitHub Actions Inactive
Copy link

@Copilot 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 implements an API for fetching system packages used during an epoch by updating pagination types and cursor encoding across several GraphQL types. Key changes include:

  • Replacing raw cursors (CVersion) with encoded cursor strings (via BcsCursor) in Connection types.
  • Adding a new pagination function for system packages in MovePackage.
  • Incorporating new workspace dependencies in Cargo.toml and updating related E2E tests.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/sui-indexer-alt-graphql/src/api/types/object.rs Updated connection types and cursor encoding for object version pagination.
crates/sui-indexer-alt-graphql/src/api/types/move_package.rs Updated connection types and added paginate_system_packages for system package retrieval.
crates/sui-indexer-alt-graphql/src/api/types/epoch.rs Added systemPackages field to the Epoch type.
crates/sui-indexer-alt-graphql/src/api/scalars/cursor.rs Introduced BcsCursor with BCS encoding for cursors.
crates/sui-indexer-alt-graphql/src/api/query.rs Adjusted connection types in query functions accordingly.
Cargo.toml Updated workspace dependencies.
E2E tests Added/updated snapshots and move tests for system packages.
Comments suppressed due to low confidence (1)

crates/sui-indexer-alt-graphql/src/api/types/object.rs:78

  • Replacing the raw cursor type with an encoded String in the Connection return type is a significant API change; please ensure this is properly documented for API consumers.
ty = "Result<Option<Connection<String, Object>>, RpcError<Error>>",

@amnn amnn force-pushed the amnn/rdr-query branch from 0c9c92c to c41095a Compare May 9, 2025 17:24
@amnn amnn force-pushed the amnn/gql-epoch-pkgs branch from bba5f8b to 48279e8 Compare May 9, 2025 17:24
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 9, 2025 17:25 — with GitHub Actions Inactive
Copy link
Contributor

@wlmyng wlmyng left a comment

Choose a reason for hiding this comment

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

all systems go

Comment on lines 526 to 539
checkpoint as i64,
pagination,
if page.is_from_front() {
query!("original_id")
} else {
query!("original_id DESC")
},
page.limit() as i64 + 2,
checkpoint as i64,
);
Copy link
Contributor

Choose a reason for hiding this comment

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

this was a fun one to read
do we prefer the macro over method chain?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I personally do, it makes it easier to keep track of bracketing etc.

@amnn amnn force-pushed the amnn/rdr-query branch from c41095a to 8adb958 Compare May 15, 2025 13:29
@amnn amnn force-pushed the amnn/gql-epoch-pkgs branch from 48279e8 to ee65586 Compare May 15, 2025 13:29
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 15, 2025 13:30 — with GitHub Actions Inactive
@amnn amnn force-pushed the amnn/rdr-query branch from 8adb958 to cca2519 Compare May 15, 2025 14:50
@amnn amnn force-pushed the amnn/gql-epoch-pkgs branch from ee65586 to cee04d8 Compare May 15, 2025 14:50
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 15, 2025 14:50 — with GitHub Actions Inactive
@amnn amnn force-pushed the amnn/rdr-query branch from cca2519 to ff10f0a Compare May 17, 2025 12:51
@amnn amnn force-pushed the amnn/gql-epoch-pkgs branch from cee04d8 to 3ee4496 Compare May 17, 2025 12:51
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 17, 2025 12:51 — with GitHub Actions Inactive
@amnn amnn force-pushed the amnn/gql-epoch-pkgs branch from 3ee4496 to 4e311d0 Compare May 19, 2025 13:45
@amnn amnn requested a review from mystenmark as a code owner May 19, 2025 13:45
@amnn amnn merged commit 4e311d0 into amnn/rdr-query May 19, 2025
5 of 8 checks passed
@amnn amnn force-pushed the amnn/rdr-query branch from ff10f0a to 4e311d0 Compare May 19, 2025 13:45
@amnn amnn deleted the amnn/gql-epoch-pkgs branch May 19, 2025 13:45
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:45 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:45 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:45 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:45 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:45 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:45 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:45 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:46 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:46 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:46 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:46 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:46 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:46 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:46 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:46 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:47 — with GitHub Actions Inactive
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.

2 participants