57fef835e3
- Remove missing cli crate from workspace members - Fix TOML array syntax errors in pvf and benchmarking-cli Cargo.toml - Fix Rust import ordering with cargo fmt - Fix feature propagation with zepter (try-runtime, runtime-benchmarks, std)
79 lines
2.4 KiB
Rust
79 lines
2.4 KiB
Rust
// Copyright (C) Parity Technologies (UK) Ltd. and Dijital Kurdistan Tech Institute
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
// Test we are producing 12-second teyrchain blocks if using an old collator, pre async-backing.
|
|
|
|
use anyhow::anyhow;
|
|
|
|
use pezcumulus_zombienet_sdk_helpers::{assert_finality_lag, assert_para_throughput};
|
|
use pezkuwi_primitives::Id as ParaId;
|
|
use pezkuwi_zombienet_sdk::{
|
|
subxt::{OnlineClient, PezkuwiConfig},
|
|
NetworkConfigBuilder,
|
|
};
|
|
use serde_json::json;
|
|
|
|
#[tokio::test(flavor = "multi_thread")]
|
|
async fn sync_backing_test() -> Result<(), anyhow::Error> {
|
|
let _ = env_logger::try_init_from_env(
|
|
env_logger::Env::default().filter_or(env_logger::DEFAULT_FILTER_ENV, "info"),
|
|
);
|
|
|
|
let images = pezkuwi_zombienet_sdk::environment::get_images_from_env();
|
|
|
|
let config = NetworkConfigBuilder::new()
|
|
.with_relaychain(|r| {
|
|
let r = r
|
|
.with_chain("pezkuwichain-local")
|
|
.with_default_command("pezkuwi")
|
|
.with_default_image(images.pezkuwi())
|
|
.with_default_args(vec![("-lteyrchain=debug").into()])
|
|
.with_genesis_overrides(json!({
|
|
"configuration": {
|
|
"config": {
|
|
"scheduler_params": {
|
|
"group_rotation_frequency": 4,
|
|
},
|
|
}
|
|
}
|
|
}))
|
|
.with_validator(|node| node.with_name("validator-0"));
|
|
|
|
(1..5).fold(r, |acc, i| {
|
|
acc.with_validator(|node| node.with_name(&format!("validator-{i}")))
|
|
})
|
|
})
|
|
.with_teyrchain(|p| {
|
|
p.with_id(2500)
|
|
.with_default_command("test-teyrchain")
|
|
.with_default_image(images.pezcumulus())
|
|
.with_chain("sync-backing")
|
|
.with_default_args(vec![("-lteyrchain=debug,aura=debug").into()])
|
|
.with_collator(|n| n.with_name("collator-2500"))
|
|
})
|
|
.build()
|
|
.map_err(|e| {
|
|
let errs = e.into_iter().map(|e| e.to_string()).collect::<Vec<_>>().join(" ");
|
|
anyhow!("config errs: {errs}")
|
|
})?;
|
|
|
|
let spawn_fn = pezkuwi_zombienet_sdk::environment::get_spawn_fn();
|
|
let network = spawn_fn(config).await?;
|
|
|
|
let relay_node = network.get_node("validator-0")?;
|
|
let para_node = network.get_node("collator-2500")?;
|
|
|
|
let relay_client: OnlineClient<PezkuwiConfig> = relay_node.wait_client().await?;
|
|
|
|
assert_para_throughput(&relay_client, 15, [(ParaId::from(2500), 5..9)].into_iter().collect())
|
|
.await?;
|
|
|
|
// Assert the teyrchain finalized block height is also on par with the number of backed
|
|
// candidates.
|
|
assert_finality_lag(¶_node.wait_client().await?, 3).await?;
|
|
|
|
log::info!("Test finished successfully");
|
|
|
|
Ok(())
|
|
}
|