-
Notifications
You must be signed in to change notification settings - Fork 11.5k
graphql-alt: Epoch.coinDenyList #22005
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
base: amnn/gql-protocol
Are you sure you want to change the base?
Conversation
## Description Fetch the state of `0x403` at the start of the epoch. This object can be modified during the epoch, but reads in that epoch will not be affected by writes in the same epoch, so it is always safe to treat all reads in an epoch as coming from this version of the object. ## Test plan New E2E tests: ``` sui$ cargo nextest run \ -p sui-indexer-alt-e2e-tests \ -- graphql/epochs/coin_deny_list ```
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
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 adds the ability to fetch the state of the Coin DenyList object (0x403) at the start of an epoch, ensuring that reads within the epoch are consistent with the checkpoint's state. Key changes include:
- Introducing a new GraphQL field (coin_deny_list) on EpochStart to return the object state.
- Refactoring the storage of the scope by moving it from Epoch to EpochStart.
- Updating related fetch functions to use the new scope structure and SUI_DENY_LIST_OBJECT_ID.
Files not reviewed (6)
- crates/sui-indexer-alt-e2e-tests/tests/graphql/epochs/coin_deny_list.move: Language not supported
- crates/sui-indexer-alt-e2e-tests/tests/graphql/epochs/coin_deny_list.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
@@ -61,6 +61,12 @@ type Epoch { | |||
""" | |||
epochId: UInt53! | |||
""" | |||
State of the Coin DenyList object (0x403) at the start of this epoch. | |||
|
|||
The DenyList controls access to Regulated Coins. Writes to the DenyList are accumulated and only take effect on the next epoch boundary. Subsequently, it's possible to determine the state of the DenyList for a transaction by reading it at the start of the epoch the transaction is in. |
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.
The DenyList controls access to Regulated Coins. Writes to the DenyList are accumulated and only take effect on the next epoch boundary. Subsequently, it's possible to determine the state of the DenyList for a transaction by reading it at the start of the epoch the transaction is in. | |
The DenyList controls access to Regulated Coins. Writes to the DenyList are accumulated and only take effect on the next epoch boundary. Consequently, it's possible to determine the state of the DenyList for a transaction by reading it at the start of the epoch the transaction is in. |
|
||
pub(crate) struct Epoch { | ||
pub(crate) epoch_id: u64, | ||
pub(crate) scope: Scope, |
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.
Now that I'm revisiting this, why not have
Epoch {
epoch_id
scope
}
fn start -> EpochStart::fetch
fn end -> EpochEnd::fetch
Not sure if we need the EpochStart
because it's basically the scope
and epoch_id
before fetching contents, and the contents from db are only used on EpochStart
Description
Fetch the state of
0x403
at the start of the epoch. This object can be modified during the epoch, but reads in that epoch will not be affected by writes in the same epoch, so it is always safe to treat all reads in an epoch as coming from this version of the object.Test plan
New 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.