Skip to content

Commit

Permalink
rpc-alt: suix_getLatestSuiSystemState
Browse files Browse the repository at this point in the history
## 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
```
  • Loading branch information
amnn committed Jan 28, 2025
1 parent b347f98 commit e0dc2aa
Show file tree
Hide file tree
Showing 6 changed files with 696 additions and 4 deletions.
Loading

0 comments on commit e0dc2aa

Please sign in to comment.