Skip to content
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

rpc-alt: suix_getLatestSuiSystemState #20990

Merged
merged 0 commits into from
Jan 28, 2025
Merged

Conversation

amnn
Copy link
Contributor

@amnn amnn commented Jan 28, 2025

Description

Implement suix_getLatestSuiSystemState from the governance API. This works by fetching the latest version of a particular object, using just the obj_versions table.

This would not work for arbitrary objects, because obj_versions is not updated when an object is deleted or wrapped. This means that when asking for the latest version of an object that is currently deleted or wrapped, we will see the version prior to the deletion/wrap. This should be fine for the system state wrapper and its inner object because these cannot be deleted or wrapped.

There are two more simplifications that have been undertaken here, by ignoring consistency and watermarking. Although we do need to implement both of these for GraphQL, we can get away with not doing that yet (for JSONRPC) because our current JSONRPC implementation does neither of these things, and so therefore this should not be a regression.

Test plan

New E2E tests show inspecting the system state after operations that would tweak it (staking, changing the epoch, withdrawing stake):

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

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, gegaowp and wlmyng January 28, 2025 00:32
@amnn amnn self-assigned this Jan 28, 2025
Copy link

vercel bot commented Jan 28, 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 Jan 28, 2025 9:45pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Jan 28, 2025 9:45pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Jan 28, 2025 9:45pm

@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env January 28, 2025 00:32 — with GitHub Actions Inactive
@amnn amnn mentioned this pull request Jan 28, 2025
7 tasks
Copy link
Contributor

@emmazzz emmazzz left a comment

Choose a reason for hiding this comment

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

Overall looks fine to me. I left some minor comments re naming and code reuse. I like how thorough the e2e test is. Thanks!

crates/sui-indexer-alt-jsonrpc/src/data/object_versions.rs Outdated Show resolved Hide resolved
crates/sui-indexer-alt-jsonrpc/src/api/governance.rs Outdated Show resolved Hide resolved
@amnn amnn force-pushed the amnn/idx-gov-state branch from 743b105 to e0dc2aa Compare January 28, 2025 14:16
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env January 28, 2025 14:16 — with GitHub Actions Inactive
@amnn amnn force-pushed the amnn/idx-gov-state branch from e0dc2aa to 000af89 Compare January 28, 2025 21:43
@amnn amnn requested review from a team and ronny-mysten as code owners January 28, 2025 21:43
@amnn amnn requested review from mystieanwaya and claykohut-mysten and removed request for a team January 28, 2025 21:43
@amnn amnn merged commit 000af89 into amnn/idx-tx-obj Jan 28, 2025
6 of 8 checks passed
@amnn amnn deleted the amnn/idx-gov-state branch January 28, 2025 21:43
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env January 28, 2025 21:44 — 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