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

test(rpc-alt): factor out off-chain cluster #21160

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

amnn
Copy link
Contributor

@amnn amnn commented Feb 10, 2025

Description

Factor out the type -- OffchainCluster -- used by the transactional test runner to interact with sui-indexer-alt and sui-indexer-alt-jsonrpc and build a new type -- FullCluster -- that combines it with an instance of Simulacrum to support E2E tests that involve more granular set-up than is currently possible with transactional tests. This type will be used to build tests for SuiNS that require running some transactions to set-up chain state before the indexer can be configured and run.

As part of this change, we also make the implementation of wait_for_checkpoint more robust, by querying the indexer for the full list of pipelines it is going to populate and making sure it gets a response for each of those from the watermarks table.

We also rename the tests binary to transactional_tests in preparation for including more tests here.

Test plan

Existing tests:

sui$ cargo nextest run -p sui-indexer-alt-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.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

@amnn amnn requested review from emmazzz, gegaowp and wlmyng February 10, 2025 16:21
@amnn amnn self-assigned this Feb 10, 2025
Copy link

vercel bot commented Feb 10, 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 Feb 14, 2025 0:48am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Feb 14, 2025 0:48am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Feb 14, 2025 0:48am

@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env February 10, 2025 16:21 — with GitHub Actions Inactive
@amnn amnn mentioned this pull request Feb 10, 2025
7 tasks
@amnn amnn force-pushed the amnn/rpc-test-refactor branch from 6346807 to 7ba0aa9 Compare February 10, 2025 19:08
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env February 10, 2025 19:08 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env February 10, 2025 23:42 — with GitHub Actions Inactive
@amnn amnn force-pushed the amnn/clean-move-build branch from d596e6c to eba4d34 Compare February 12, 2025 15:48
@amnn amnn requested a review from stefan-mysten as a code owner February 12, 2025 15:48
@amnn amnn force-pushed the amnn/rpc-test-refactor branch from 1b0bcab to 24120c7 Compare February 12, 2025 15:48
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env February 12, 2025 15:48 — with GitHub Actions Inactive
@amnn amnn force-pushed the amnn/clean-move-build branch from eba4d34 to 96492d2 Compare February 12, 2025 22:38
@amnn amnn force-pushed the amnn/rpc-test-refactor branch from 24120c7 to a2dcf95 Compare February 12, 2025 22:39
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env February 12, 2025 22:40 — with GitHub Actions Inactive
@amnn amnn force-pushed the amnn/clean-move-build branch from 96492d2 to 7c4e5c1 Compare February 13, 2025 14:36
@amnn amnn force-pushed the amnn/rpc-test-refactor branch from a2dcf95 to a88ee51 Compare February 13, 2025 14:36
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env February 13, 2025 14:37 — with GitHub Actions Inactive
Base automatically changed from amnn/clean-move-build to amnn/rpc-owned-objs February 13, 2025 16:19
Base automatically changed from amnn/rpc-owned-objs to amnn/rpc-df February 13, 2025 16:19
Base automatically changed from amnn/rpc-df to amnn/rpc-query-tx February 13, 2025 16:20
Base automatically changed from amnn/rpc-query-tx to main February 13, 2025 17:02
amnn added 7 commits February 14, 2025 12:44
## Description

Generalize `Resolver::function_parameters` so that it returns the fully
resolved function signature. Previously this function was used to infer
transaction input layouts, but we also need roughly the same logic for
returning a normalized move function.

## Test plan
Updated package resolver tests:

```
sui$ cargo nextest run -p sui-package-resolver
```
## Description

Consistently use the canonical display format with prefix in error
messages from the package resolver.

## Test plan

Existing tests:

```
sui$ cargo nextest run         \
  -p sui-indexer-alt-e2e-tests \
  -p sui-graphql-e2e-tests     \
  -p sui-mvr-graphql-e2e-tests \
  -p sui-package-resolver
```
## Description
Fetch a function's signature. Note that this implementation uses the
package resolver, so unlike the current JSON-RPC, this will correctly
relocate package IDs for types that are introduced in upgraded packages.

## Test plan
New E2E tests:

```
sui$ cargo nextest run -p sui-indexer-alt-e2e-tests \
  -- move/functions
```
## Description

Pull out `OffChainCluster` from the transactional test runner set-up
code, so that it can be used for non-transactional tests.

## Test plan

Run existing tests:

```
sui$ cargo nextest run -p sui-indexer-alt-e2e-tests
```
## Description

Move the logic for waiting for a checkpoint into the extracted
`OffchainCluster` type. At the same time it can be made more robust in
two ways:

- The previously introduced special cases for pruner pipelines can be
  removed, now that those pruners are no longer classed as pipelines.
- A function has been added for the indexer to report which pipelines it
  is going to populate, so that the cluster can make sure all of those
  pipelines are reporting progress.

## Test plan

Existing E2E tests:

```
sui$ cargo nextest run -p sui-indexer-alt-e2e-tests
```
## Description
...in preparation for introducing more E2E tests in the same crate.

## Test plan
CI
## Description

Add a new type to the library supporting E2E tests that combines an
off-chain cluster with an instance of simulacrum. This can be used to
drive E2E tests that need to configure indexing and RPC to a greater
degree than is possible with transactional tests.

This type will be used to write tests for SuiNS-related JSONRPC-methods,
which require us to publish some code on-chain and extract some IDs from
that process before we set-up the indexer.

## Test plan

Will be used for writing tests in a follow-up change.
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.

1 participant