-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
6346807
to
7ba0aa9
Compare
d596e6c
to
eba4d34
Compare
1b0bcab
to
24120c7
Compare
eba4d34
to
96492d2
Compare
24120c7
to
a2dcf95
Compare
96492d2
to
7c4e5c1
Compare
a2dcf95
to
a88ee51
Compare
## 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.
a88ee51
to
4a958cb
Compare
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.
needs a rebase, but lgtm. now that transactional test runner just needs a way to interact with the offchain readers, these e2e tests are free to configure the test environment as they desire. very neat
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.
neat and left some minor comments
|
||
/// A simulation of the network, accompanied by off-chain services (database, indexer, RPC), | ||
/// connected by local data ingestion. | ||
pub struct FullCluster { |
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.
👍
.into_iter() | ||
.collect(); | ||
|
||
for pipeline in &self.pipelines { |
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.
would latest.len() != pipelines.len()
suffice to return None
pub async fn stopped(self) { | ||
self.cancel.cancel(); | ||
let _ = self.indexer.await; | ||
let _ = self.jsonrpc.await; |
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.
are _
s here possibly errors, will want to handle them if so
let checkpoint = self.executor.create_checkpoint(); | ||
self.offchain | ||
.wait_for_checkpoint(checkpoint.sequence_number, Duration::from_secs(10)) | ||
.await?; |
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.
in case of wait_for_checkpoint
error due to timeout, a retry of create_checkpoint
might occur and that would actually create more than 1 checkpoints when create_checkpoint
only succeeds once should we wait (with warnings in case it's slow) instead quick failure?
Description
Factor out the type --
OffchainCluster
-- used by the transactional test runner to interact withsui-indexer-alt
andsui-indexer-alt-jsonrpc
and build a new type --FullCluster
-- that combines it with an instance ofSimulacrum
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 totransactional_tests
in preparation for including more tests here.Test plan
Existing 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.