-
Notifications
You must be signed in to change notification settings - Fork 11.6k
graphql-alt: latest Epochs and Protocol Configs #22006
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
There was a problem hiding this 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 support for fetching the latest epoch and protocol configuration when no explicit identifiers are provided. Key changes include:
- Adding the QueryableByName derive for StoredEpochStart in the schema.
- Implementing a new DataLoader for CheckpointBoundedEpochStartKey to support fetching epochs based on checkpoint.
- Updating GraphQL resolvers and associated types to handle optional epoch IDs and protocol config version parameters.
Reviewed Changes
Copilot reviewed 5 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/sui-indexer-alt-schema/src/epochs.rs | Added new derive for query operations on StoredEpochStart. |
| crates/sui-indexer-alt-reader/src/epochs.rs | Introduced a new DataLoader implementation for checkpoint-bound epoch fetching. |
| crates/sui-indexer-alt-graphql/src/api/types/protocol_configs.rs | Added a function to fetch the latest protocol config based on scope. |
| crates/sui-indexer-alt-graphql/src/api/types/epoch.rs | Updated epoch fetching logic to support optional epoch IDs. |
| crates/sui-indexer-alt-graphql/src/api/query.rs | Adjusted query endpoints for epochs and protocol configs to use optional parameters. |
Files not reviewed (8)
- crates/sui-indexer-alt-e2e-tests/tests/graphql/epochs/protocol_configs.move: Language not supported
- crates/sui-indexer-alt-e2e-tests/tests/graphql/epochs/protocol_configs.snap: Language not supported
- crates/sui-indexer-alt-e2e-tests/tests/graphql/epochs/query.move: Language not supported
- crates/sui-indexer-alt-e2e-tests/tests/graphql/epochs/query.snap: Language not supported
- crates/sui-indexer-alt-graphql/schema.graphql: Language not supported
- crates/sui-indexer-alt-graphql/src/snapshots/sui_indexer_alt_graphql__tests__schema.graphql.snap: Language not supported
- crates/sui-indexer-alt-graphql/src/snapshots/sui_indexer_alt_graphql__tests__staging.graphql.snap: Language not supported
- crates/sui-indexer-alt-graphql/staging.graphql: Language not supported
Comments suppressed due to low confidence (1)
crates/sui-indexer-alt-graphql/src/api/types/epoch.rs:189
- [nitpick] Consider renaming the variable 'load' to a more descriptive name such as 'stored_epoch_result' to improve readability.
let load = if let Some(id) = epoch_id {
crates/sui-indexer-alt-graphql/src/api/types/protocol_configs.rs
Outdated
Show resolved
Hide resolved
da60754 to
8ec89a9
Compare
8ec89a9 to
d2e0262
Compare
d2e0262 to
ad91f3f
Compare
ad91f3f to
b150a41
Compare
b150a41 to
da6e940
Compare
da6e940 to
7dde784
Compare
7dde784 to
4e311d0
Compare
Description
Support calling
Query.epochwithout an ID to fetch the latest epoch and fetch the latest protocol config in scope if no protocol version is provided.Test plan
Updated E2E tests:
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.