-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
decouple transactional test runner from indexer and graphql flavor #20373
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Skipped Deployments
|
@@ -73,6 +75,12 @@ pub struct SuiInitArgs { | |||
/// the indexer. | |||
#[clap(long = "epochs-to-keep")] | |||
pub epochs_to_keep: Option<u64>, | |||
/// TODO (wlmyng): doc comment | |||
#[clap(long = "data-ingestion-path")] |
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.
No need to name the long as the field data_ingestion_path
will be data-ingestion-path
as an option. I see that the rest of the code is like that, so probably it's better to keep the style the same, but just FYI.
impl Default for AdapterInitConfig { | ||
fn default() -> Self { | ||
Self { | ||
additional_mapping: BTreeMap::new(), | ||
account_names: BTreeSet::new(), | ||
protocol_config: ProtocolConfig::get_for_max_version_UNSAFE(), | ||
is_simulator: false, | ||
custom_validator_account: false, | ||
reference_gas_price: None, | ||
default_gas_price: None, | ||
flavor: None, | ||
offchain_config: None, | ||
} | ||
} | ||
} | ||
|
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.
If ProtocolConfig
has a Default
, then we could just slap a #[derive(Default)]
on AdapterInitConfig
.
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.
while that's fair, i think i'll keep it like this just so it's explicitly clear the unsafe
bit
… the latter is a convenience fn
… may consider making this generic as well..
… simulacrum. creating a rest-api, and hooking into the indexer and graphql, should be deferred to the crate caller. but this is probably not the correct approach, because by adding to SuiInitArgs -> Offchain extensions we still have a dependency on the crates...
…apshot state checking functionality, and a few things like configuring graphql based on what we passed into SuiInitArgs. I think we need to figure out a way to take the reader-specific args from SuiInitArgs and handle them in tests.rs. and maybe we hsould have a readerclient? or at least pass in the db url. or the adapter can return a tempdb for the indexer to write to...
…f init args were being instantiated
… this also means that we can actually use the result of serve_executor, with some arc magic I suppose. Now, the workflow is to start the adapter first to instantiate the simulacrum, extract the offchain_config, start the indexer and graphql services, and pass in some sort of offchain reader for the adapter. Make sure to clean up resources by reclaiming the arc
6a04673
to
c9e0869
Compare
Description
With mvr and alt coming up, we want our transactional test runner to be more agnostic to the off chain indexing flavor. This PR attempts to address it by largely limiting the adapter to instantiating the simulacrum or executor with what is needed to bootstrap the network, and then defer to the test caller. Test caller implements a trait so the adapter knows how to inspect off chain state.
Test plan
How did you test the new or updated feature?
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.