Skip to content

graphql-alt: ObjectKey.atCheckpoint fails on future time travel #22138

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

Conversation

amnn
Copy link
Contributor

@amnn amnn commented May 15, 2025

Description

Based on our discussion on Wednesday, this change makes it so that the atCheckpoint filter will produce an error if you attempt to time travel into the future relative to the current latest checkpoint.

Test plan

Updated E2E tests:

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

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 15, 2025 14:53
@amnn amnn self-assigned this May 15, 2025
Copy link

vercel bot commented May 15, 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:46pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview May 19, 2025 1:46pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview May 19, 2025 1:46pm

@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 15, 2025 14:53 — 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 adds error handling in the GraphQL API to ensure that queries attempting to fetch data at a future checkpoint fail with an appropriate error message. Key changes include:

  • Updated GraphQL schema and documentation comments to clarify the new behavior.
  • Adjustments in the scope and object processing logic to return an error when a future checkpoint is provided.
  • Corresponding updates in tests to verify the new error handling behavior.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/sui-indexer-alt-graphql/staging.graphql Updated doc comments on checkpoint usage.
crates/sui-indexer-alt-graphql/src/snapshots/*.snap Updated snapshots to verify the revised checkpoint error messages.
crates/sui-indexer-alt-graphql/src/scope.rs Modified function to return an Option based on checkpoint validity.
crates/sui-indexer-alt-graphql/src/api/types/object.rs Added error handling for future checkpoint values with a new error variant.
crates/sui-indexer-alt-graphql/src/api/types/checkpoint.rs Updated query() to return an error for future checkpoints.
crates/sui-indexer-alt-graphql/src/api/query.rs Updated comment to clarify new behavior.
crates/sui-indexer-alt-graphql/schema.graphql Synchronized documentation with the new error handling behavior.
crates/sui-indexer-alt-e2e-tests/* Updated tests to reflect the new error scenario for future checkpoints.

@amnn amnn force-pushed the amnn/rdr-sys-evict branch from 246367f to 32374fa Compare May 17, 2025 12:51
@amnn amnn force-pushed the amnn/gql-at-cp-future branch from 0340e95 to 00e120c Compare May 17, 2025 12:51
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 17, 2025 12:52 — with GitHub Actions Inactive
@amnn amnn force-pushed the amnn/gql-at-cp-future branch from 00e120c 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-sys-evict May 19, 2025
3 of 6 checks passed
@amnn amnn force-pushed the amnn/rdr-sys-evict branch from 32374fa to 4e311d0 Compare May 19, 2025 13:45
@amnn amnn deleted the amnn/gql-at-cp-future 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