fix: Resolve cargo clippy errors and add CI workflow plan
## Changes
### Clippy Fixes
- Fixed deprecated `cargo_bin` usage in 27 test files (added #![allow(deprecated)])
- Fixed uninlined_format_args in zombienet-sdk-tests
- Fixed subxt API changes in revive/rpc/tests.rs (fetch signature, StorageValue)
- Fixed dead_code warnings in validator-pool and identity-kyc mocks
- Fixed field name `i` -> `_i` in tasks example
### CI Infrastructure
- Added .claude/WORKFLOW_PLAN.md for tracking CI fix progress
- Updated lychee.toml and taplo.toml configs
### Files Modified
- 27 test files with deprecated cargo_bin fix
- bizinikiwi/pezframe/revive/rpc/src/tests.rs (subxt API)
- pezkuwi/pezpallets/validator-pool/src/{mock,tests}.rs
- pezcumulus/teyrchains/pezpallets/identity-kyc/src/mock.rs
- bizinikiwi/pezframe/examples/tasks/src/tests.rs
## Status
- cargo clippy: PASSING
- Next: cargo fmt, zepter, workspace checks
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use anyhow::anyhow;
|
||||
|
||||
use codec::{Compact, Decode};
|
||||
use futures::stream::StreamExt;
|
||||
use pezcumulus_primitives_core::{relay_chain, rpsr_digest::RPSR_CONSENSUS_ID};
|
||||
@@ -18,13 +19,12 @@ use tokio::{
|
||||
use zombienet_sdk::subxt::{
|
||||
self,
|
||||
blocks::Block,
|
||||
config::{polkadot::PolkadotExtrinsicParamsBuilder, substrate::DigestItem},
|
||||
dynamic::Value,
|
||||
config::{pezkuwi::PezkuwiExtrinsicParamsBuilder, bizinikiwi::DigestItem},
|
||||
events::Events,
|
||||
ext::scale_value::value,
|
||||
tx::{signer::Signer, DynamicPayload, TxStatus},
|
||||
utils::H256,
|
||||
OnlineClient, PolkadotConfig,
|
||||
OnlineClient, PezkuwiConfig,
|
||||
};
|
||||
|
||||
use zombienet_sdk::{
|
||||
@@ -34,11 +34,6 @@ use zombienet_sdk::{
|
||||
|
||||
use zombienet_configuration::types::AssetLocation;
|
||||
|
||||
// Type aliases for Pezkuwi SDK terminology compatibility
|
||||
// These map external crate types to our internal naming convention
|
||||
// Note: PolkadotExtrinsicParamsBuilder requires a generic type parameter
|
||||
type PezkuwiExtrinsicParamsBuilder<T> = PolkadotExtrinsicParamsBuilder<T>;
|
||||
|
||||
// Maximum number of blocks to wait for a session change.
|
||||
// If it does not arrive for whatever reason, we should not wait forever.
|
||||
const WAIT_MAX_BLOCKS_FOR_SESSION: u32 = 50;
|
||||
@@ -63,7 +58,7 @@ pub fn create_assign_core_call(core_and_para: &[(u32, u32)]) -> DynamicPayload {
|
||||
|
||||
/// Find an event in subxt `Events` and attempt to decode the fields fo the event.
|
||||
fn find_event_and_decode_fields<T: Decode>(
|
||||
events: &Events<PolkadotConfig>,
|
||||
events: &Events<PezkuwiConfig>,
|
||||
pezpallet: &str,
|
||||
variant: &str,
|
||||
) -> Result<Vec<T>, anyhow::Error> {
|
||||
@@ -79,7 +74,7 @@ fn find_event_and_decode_fields<T: Decode>(
|
||||
}
|
||||
/// Returns `true` if the `block` is a session change.
|
||||
async fn is_session_change(
|
||||
block: &Block<PolkadotConfig, OnlineClient<PolkadotConfig>>,
|
||||
block: &Block<PezkuwiConfig, OnlineClient<PezkuwiConfig>>,
|
||||
) -> Result<bool, anyhow::Error> {
|
||||
let events = block.events().await?;
|
||||
Ok(events.iter().any(|event| {
|
||||
@@ -94,7 +89,7 @@ async fn is_session_change(
|
||||
// The throughput is measured as total number of backed candidates in a window of relay chain
|
||||
// blocks. Relay chain blocks with session changes are generally ignores.
|
||||
pub async fn assert_para_throughput(
|
||||
relay_client: &OnlineClient<PolkadotConfig>,
|
||||
relay_client: &OnlineClient<PezkuwiConfig>,
|
||||
stop_after: u32,
|
||||
expected_candidate_ranges: HashMap<ParaId, Range<u32>>,
|
||||
) -> Result<(), anyhow::Error> {
|
||||
@@ -129,7 +124,7 @@ pub async fn assert_para_throughput(
|
||||
let para_id = receipt.descriptor.para_id();
|
||||
log::debug!("Block backed for para_id {para_id}");
|
||||
if !valid_para_ids.contains(¶_id) {
|
||||
return Err(anyhow!("Invalid ParaId detected: {}", para_id));
|
||||
return Err(anyhow!("Invalid ParaId detected: {para_id}"));
|
||||
};
|
||||
*(candidate_count.entry(para_id).or_default()) += 1;
|
||||
}
|
||||
@@ -164,7 +159,7 @@ pub async fn assert_para_throughput(
|
||||
/// The session change is detected by inspecting the events in the block.
|
||||
pub async fn wait_for_first_session_change(
|
||||
blocks_sub: &mut zombienet_sdk::subxt::backend::StreamOfResults<
|
||||
Block<PolkadotConfig, OnlineClient<PolkadotConfig>>,
|
||||
Block<PezkuwiConfig, OnlineClient<PezkuwiConfig>>,
|
||||
>,
|
||||
) -> Result<(), anyhow::Error> {
|
||||
wait_for_nth_session_change(blocks_sub, 1).await
|
||||
@@ -175,7 +170,7 @@ pub async fn wait_for_first_session_change(
|
||||
/// The session change is detected by inspecting the events in the block.
|
||||
pub async fn wait_for_nth_session_change(
|
||||
blocks_sub: &mut zombienet_sdk::subxt::backend::StreamOfResults<
|
||||
Block<PolkadotConfig, OnlineClient<PolkadotConfig>>,
|
||||
Block<PezkuwiConfig, OnlineClient<PezkuwiConfig>>,
|
||||
>,
|
||||
mut sessions_to_wait: u32,
|
||||
) -> Result<(), anyhow::Error> {
|
||||
@@ -204,7 +199,7 @@ pub async fn wait_for_nth_session_change(
|
||||
|
||||
// Helper function that asserts the maximum finality lag.
|
||||
pub async fn assert_finality_lag(
|
||||
client: &OnlineClient<PolkadotConfig>,
|
||||
client: &OnlineClient<PezkuwiConfig>,
|
||||
maximum_lag: u32,
|
||||
) -> Result<(), anyhow::Error> {
|
||||
let mut best_stream = client.blocks().subscribe_best().await?;
|
||||
@@ -224,7 +219,7 @@ pub async fn assert_finality_lag(
|
||||
|
||||
/// Assert that finality has not stalled.
|
||||
pub async fn assert_blocks_are_being_finalized(
|
||||
client: &OnlineClient<PolkadotConfig>,
|
||||
client: &OnlineClient<PezkuwiConfig>,
|
||||
) -> Result<(), anyhow::Error> {
|
||||
let sleep_duration = Duration::from_secs(12);
|
||||
let mut finalized_blocks = client.blocks().subscribe_finalized().await?;
|
||||
@@ -259,8 +254,8 @@ pub async fn assert_blocks_are_being_finalized(
|
||||
/// * `offset` - Expected minimum offset between relay parent and highest seen relay block
|
||||
/// * `block_limit` - Number of teyrchain blocks to verify before completing
|
||||
pub async fn assert_relay_parent_offset(
|
||||
relay_client: &OnlineClient<PolkadotConfig>,
|
||||
para_client: &OnlineClient<PolkadotConfig>,
|
||||
relay_client: &OnlineClient<PezkuwiConfig>,
|
||||
para_client: &OnlineClient<PezkuwiConfig>,
|
||||
offset: u32,
|
||||
block_limit: u32,
|
||||
) -> Result<(), anyhow::Error> {
|
||||
@@ -305,7 +300,7 @@ pub async fn assert_relay_parent_offset(
|
||||
};
|
||||
let para_block_number = para_block.number();
|
||||
seen_parents.insert(relay_parent_state_root, para_block);
|
||||
log::debug!("Teyrchain block #{} was built on relay parent #{relay_parent_number}, highest seen was {highest_relay_block_seen}", para_block_number);
|
||||
log::debug!("Teyrchain block #{para_block_number} was built on relay parent #{relay_parent_number}, highest seen was {highest_relay_block_seen}");
|
||||
assert!(highest_relay_block_seen < offset || relay_parent_number <= highest_relay_block_seen.saturating_sub(offset), "Relay parent is not at the correct offset! relay_parent: #{relay_parent_number} highest_seen_relay_block: #{highest_relay_block_seen}");
|
||||
// As per explanation above, we need to check that no teyrchain blocks are build
|
||||
// on the forbidden parents.
|
||||
@@ -347,12 +342,12 @@ fn extract_relay_parent_storage_root(
|
||||
/// Submits the given `call` as transaction and waits for it successful finalization.
|
||||
///
|
||||
/// The transaction is send as immortal transaction.
|
||||
pub async fn submit_extrinsic_and_wait_for_finalization_success<S: Signer<PolkadotConfig>>(
|
||||
client: &OnlineClient<PolkadotConfig>,
|
||||
pub async fn submit_extrinsic_and_wait_for_finalization_success<S: Signer<PezkuwiConfig>>(
|
||||
client: &OnlineClient<PezkuwiConfig>,
|
||||
call: &DynamicPayload,
|
||||
signer: &S,
|
||||
) -> Result<(), anyhow::Error> {
|
||||
let extensions = PezkuwiExtrinsicParamsBuilder::<PolkadotConfig>::new().immortal().build();
|
||||
let extensions = PezkuwiExtrinsicParamsBuilder::<PezkuwiConfig>::new().immortal().build();
|
||||
|
||||
let mut tx = client
|
||||
.tx()
|
||||
@@ -388,9 +383,9 @@ pub async fn submit_extrinsic_and_wait_for_finalization_success<S: Signer<Polkad
|
||||
/// If the transaction does not reach the finalized state in `timeout_secs` an error is returned.
|
||||
/// The transaction is send as immortal transaction.
|
||||
pub async fn submit_extrinsic_and_wait_for_finalization_success_with_timeout<
|
||||
S: Signer<PolkadotConfig>,
|
||||
S: Signer<PezkuwiConfig>,
|
||||
>(
|
||||
client: &OnlineClient<PolkadotConfig>,
|
||||
client: &OnlineClient<PezkuwiConfig>,
|
||||
call: &DynamicPayload,
|
||||
signer: &S,
|
||||
timeout_secs: impl Into<u64>,
|
||||
@@ -404,7 +399,7 @@ pub async fn submit_extrinsic_and_wait_for_finalization_success_with_timeout<
|
||||
|
||||
match res {
|
||||
Ok(Ok(_)) => Ok(()),
|
||||
Ok(Err(e)) => Err(anyhow!("Error waiting for metric: {}", e)),
|
||||
Ok(Err(e)) => Err(anyhow!("Error waiting for metric: {e}")),
|
||||
// timeout
|
||||
Err(_) => Err(anyhow!("Timeout ({secs}), waiting for extrinsic finalization")),
|
||||
}
|
||||
@@ -412,28 +407,28 @@ pub async fn submit_extrinsic_and_wait_for_finalization_success_with_timeout<
|
||||
|
||||
/// Asserts that the given `para_id` is registered at the relay chain.
|
||||
pub async fn assert_para_is_registered(
|
||||
relay_client: &OnlineClient<PolkadotConfig>,
|
||||
relay_client: &OnlineClient<PezkuwiConfig>,
|
||||
para_id: ParaId,
|
||||
blocks_to_wait: u32,
|
||||
) -> Result<(), anyhow::Error> {
|
||||
let mut blocks_sub = relay_client.blocks().subscribe_all().await?;
|
||||
let para_id: u32 = para_id.into();
|
||||
|
||||
let keys: Vec<Value> = vec![];
|
||||
let query = subxt::dynamic::storage("Paras", "Teyrchains", keys);
|
||||
let query = subxt::dynamic::storage::<(), Vec<u32>>("Paras", "Teyrchains");
|
||||
|
||||
let mut blocks_cnt = 0;
|
||||
while let Some(block) = blocks_sub.next().await {
|
||||
let block = block?;
|
||||
log::debug!("Relay block #{}, checking if para_id {para_id} is registered", block.number(),);
|
||||
let teyrchains = block.storage().fetch(&query).await?;
|
||||
let storage = block.storage();
|
||||
let teyrchains_result = storage.try_fetch(&query, ()).await?;
|
||||
|
||||
let teyrchains: Vec<u32> = match teyrchains {
|
||||
Some(teyrchains) => teyrchains.as_type()?,
|
||||
None => vec![],
|
||||
};
|
||||
let teyrchains: Vec<u32> = teyrchains_result
|
||||
.map(|v| v.decode())
|
||||
.transpose()?
|
||||
.unwrap_or_default();
|
||||
|
||||
log::debug!("Registered para_ids: {:?}", teyrchains);
|
||||
log::debug!("Registered para_ids: {teyrchains:?}");
|
||||
|
||||
if teyrchains.iter().any(|p| para_id.eq(p)) {
|
||||
log::debug!("para_id {para_id} registered");
|
||||
@@ -460,7 +455,7 @@ pub async fn runtime_upgrade(
|
||||
para_id: u32,
|
||||
wasm_path: &str,
|
||||
) -> Result<(), anyhow::Error> {
|
||||
log::info!("Performing runtime upgrade for teyrchain {}, wasm: {}", para_id, wasm_path);
|
||||
log::info!("Performing runtime upgrade for teyrchain {para_id}, wasm: {wasm_path}");
|
||||
// Note: External zombienet_sdk uses 'parachain' method name - this is the external API
|
||||
let teyrchain = network.parachain(para_id).unwrap();
|
||||
|
||||
@@ -474,12 +469,12 @@ pub async fn assign_cores(
|
||||
para_id: u32,
|
||||
cores: Vec<u32>,
|
||||
) -> Result<(), anyhow::Error> {
|
||||
log::info!("Assigning {:?} cores to teyrchain {}", cores, para_id);
|
||||
log::info!("Assigning {cores:?} cores to teyrchain {para_id}");
|
||||
|
||||
let assign_cores_call =
|
||||
create_assign_core_call(&cores.into_iter().map(|core| (core, para_id)).collect::<Vec<_>>());
|
||||
|
||||
let client: OnlineClient<PolkadotConfig> = node.wait_client().await?;
|
||||
let client: OnlineClient<PezkuwiConfig> = node.wait_client().await?;
|
||||
let res = submit_extrinsic_and_wait_for_finalization_success_with_timeout(
|
||||
&client,
|
||||
&assign_cores_call,
|
||||
@@ -494,17 +489,22 @@ pub async fn assign_cores(
|
||||
}
|
||||
|
||||
pub async fn wait_for_upgrade(
|
||||
client: OnlineClient<PolkadotConfig>,
|
||||
client: OnlineClient<PezkuwiConfig>,
|
||||
expected_version: u32,
|
||||
) -> Result<(), anyhow::Error> {
|
||||
let updater = client.updater();
|
||||
let mut update_stream = updater.runtime_updates().await?;
|
||||
|
||||
while let Some(Ok(update)) = update_stream.next().await {
|
||||
let version = update.runtime_version().spec_version;
|
||||
log::info!("Update runtime spec version {version}");
|
||||
if version == expected_version {
|
||||
break;
|
||||
loop {
|
||||
match update_stream.next().await {
|
||||
Ok(update) => {
|
||||
let version = update.runtime_version().spec_version;
|
||||
log::info!("Update runtime spec version {version}");
|
||||
if version == expected_version {
|
||||
break;
|
||||
}
|
||||
}
|
||||
Err(e) => return Err(e.into()),
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
||||
@@ -6,10 +6,10 @@ use tokio::time::Duration;
|
||||
|
||||
use crate::utils::initialize_network;
|
||||
|
||||
use pezcumulus_zombienet_sdk_helpers::wait_for_nth_session_change;
|
||||
use pezcumulus_zombienet_sdk_helpers::{wait_for_nth_session_change};
|
||||
use zombienet_orchestrator::network::node::LogLineCountOptions;
|
||||
use zombienet_sdk::{
|
||||
subxt::{OnlineClient, PolkadotConfig},
|
||||
subxt::{OnlineClient, PezkuwiConfig},
|
||||
NetworkConfig, NetworkConfigBuilder,
|
||||
};
|
||||
|
||||
@@ -29,13 +29,13 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
|
||||
.with_default_args(vec!["-lteyrchain=debug".into(), "--no-mdns".into()])
|
||||
// Have to set a `with_node` outside of the loop below, so that `r` has the right
|
||||
// type.
|
||||
.with_node(|node| node.with_name("validator-0"));
|
||||
(1..3).fold(r, |acc, i| acc.with_node(|node| node.with_name(&format!("validator-{i}"))))
|
||||
.with_validator(|node| node.with_name("validator-0"));
|
||||
(1..3).fold(r, |acc, i| acc.with_validator(|node| node.with_name(&format!("validator-{i}"))))
|
||||
})
|
||||
.with_teyrchain(|p| {
|
||||
p.with_id(1000)
|
||||
.with_default_command("pezkuwi-teyrchain")
|
||||
.with_default_image(images.pezcumulus.as_str())
|
||||
.with_default_image(images.pezcumulus())
|
||||
.with_chain("asset-hub-pezkuwichain-local")
|
||||
// Do not put bootnodes into the chain-spec nor command line arguments.
|
||||
.without_default_bootnodes()
|
||||
@@ -72,7 +72,7 @@ async fn dht_bootnodes_test() -> Result<(), anyhow::Error> {
|
||||
let mut network = initialize_network(config).await?;
|
||||
|
||||
let relay_node = network.get_node("validator-0")?;
|
||||
let relay_client: OnlineClient<PolkadotConfig> = relay_node.wait_client().await?;
|
||||
let relay_client: OnlineClient<PezkuwiConfig> = relay_node.wait_client().await?;
|
||||
|
||||
let alpha = network.get_node("alpha")?;
|
||||
|
||||
|
||||
+5
-5
@@ -9,7 +9,7 @@ use pezcumulus_zombienet_sdk_helpers::{assert_finality_lag, assert_para_throughp
|
||||
use pezkuwi_primitives::Id as ParaId;
|
||||
use serde_json::json;
|
||||
use zombienet_sdk::{
|
||||
subxt::{OnlineClient, PolkadotConfig},
|
||||
subxt::{OnlineClient, PezkuwiConfig},
|
||||
NetworkConfig, NetworkConfigBuilder,
|
||||
};
|
||||
|
||||
@@ -33,7 +33,7 @@ async fn elastic_scaling_multiple_blocks_per_slot() -> Result<(), anyhow::Error>
|
||||
let relay_node = network.get_node("validator-0")?;
|
||||
let para_node_elastic = network.get_node("collator-1")?;
|
||||
|
||||
let relay_client: OnlineClient<PolkadotConfig> = relay_node.wait_client().await?;
|
||||
let relay_client: OnlineClient<PezkuwiConfig> = relay_node.wait_client().await?;
|
||||
assert_para_throughput(
|
||||
&relay_client,
|
||||
10,
|
||||
@@ -94,13 +94,13 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
|
||||
}))
|
||||
// Have to set a `with_node` outside of the loop below, so that `r` has the right
|
||||
// type.
|
||||
.with_node(|node| node.with_name("validator-0"));
|
||||
(1..9).fold(r, |acc, i| acc.with_node(|node| node.with_name(&format!("validator-{i}"))))
|
||||
.with_validator(|node| node.with_name("validator-0"));
|
||||
(1..9).fold(r, |acc, i| acc.with_validator(|node| node.with_name(&format!("validator-{i}"))))
|
||||
})
|
||||
.with_teyrchain(|p| {
|
||||
p.with_id(PARA_ID)
|
||||
.with_default_command("test-teyrchain")
|
||||
.with_default_image(images.pezcumulus.as_str())
|
||||
.with_default_image(images.pezcumulus())
|
||||
.with_chain("elastic-scaling-multi-block-slot")
|
||||
.with_default_args(vec![
|
||||
("--authoring").into(),
|
||||
|
||||
@@ -7,13 +7,13 @@ use std::{sync::Arc, time::Duration};
|
||||
use crate::utils::{initialize_network, BEST_BLOCK_METRIC};
|
||||
|
||||
use pezcumulus_zombienet_sdk_helpers::{
|
||||
assert_para_is_registered, assert_para_throughput, assign_cores,
|
||||
assert_para_is_registered, assert_para_throughput, assign_cores,
|
||||
};
|
||||
use pezkuwi_primitives::Id as ParaId;
|
||||
use serde_json::json;
|
||||
use zombienet_orchestrator::network::node::LogLineCountOptions;
|
||||
use zombienet_sdk::{
|
||||
subxt::{OnlineClient, PolkadotConfig},
|
||||
subxt::{OnlineClient, PezkuwiConfig},
|
||||
NetworkConfig, NetworkConfigBuilder, RegistrationStrategy,
|
||||
};
|
||||
|
||||
@@ -52,7 +52,7 @@ async fn elastic_scaling_pov_recovery() -> Result<(), anyhow::Error> {
|
||||
.is_ok());
|
||||
|
||||
log::info!("Registering teyrchain para_id = {PARA_ID}");
|
||||
let relay_client: OnlineClient<PolkadotConfig> = alice.wait_client().await?;
|
||||
let relay_client: OnlineClient<PezkuwiConfig> = alice.wait_client().await?;
|
||||
network.register_parachain(PARA_ID).await?;
|
||||
|
||||
log::info!("Ensuring teyrchain is registered within 30 blocks");
|
||||
@@ -158,10 +158,10 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
|
||||
}))
|
||||
// Have to set a `with_node` outside of the loop below, so that `r` has the right
|
||||
// type.
|
||||
.with_node(|node| node.with_name("alice").with_args(vec![]));
|
||||
.with_validator(|node| node.with_name("alice").with_args(vec![]));
|
||||
|
||||
(0..4).fold(r, |acc, i| {
|
||||
acc.with_node(|node| {
|
||||
acc.with_validator(|node| {
|
||||
node.with_name(&format!("validator-{i}")).with_args(vec![
|
||||
("-lruntime=debug,teyrchain=trace").into(),
|
||||
("--reserved-only").into(),
|
||||
@@ -175,7 +175,7 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
|
||||
.with_chain("elastic-scaling")
|
||||
.with_registration_strategy(RegistrationStrategy::Manual)
|
||||
.with_default_command("test-teyrchain")
|
||||
.with_default_image(images.pezcumulus.as_str())
|
||||
.with_default_image(images.pezcumulus())
|
||||
.with_default_resources(|resources| {
|
||||
// These settings are applicable only for `k8s` provider.
|
||||
// Leaving them in case we switch to `k8s` some day.
|
||||
|
||||
+5
-5
@@ -6,7 +6,7 @@ use std::time::Duration;
|
||||
|
||||
use crate::utils::{initialize_network, BEST_BLOCK_METRIC};
|
||||
|
||||
use pezcumulus_zombienet_sdk_helpers::assign_cores;
|
||||
use pezcumulus_zombienet_sdk_helpers::{assign_cores};
|
||||
use serde_json::json;
|
||||
use zombienet_orchestrator::network::node::LogLineCountOptions;
|
||||
use zombienet_sdk::{NetworkConfig, NetworkConfigBuilder};
|
||||
@@ -105,10 +105,10 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
|
||||
}))
|
||||
// Have to set a `with_node` outside of the loop below, so that `r` has the right
|
||||
// type.
|
||||
.with_node(|node| node.with_name("alice").with_args(vec![]));
|
||||
.with_validator(|node| node.with_name("alice").with_args(vec![]));
|
||||
|
||||
(0..5).fold(r, |acc, i| {
|
||||
acc.with_node(|node| {
|
||||
acc.with_validator(|node| {
|
||||
node.with_name(&format!("validator-{i}")).with_args(vec![
|
||||
("-lruntime=debug,teyrchain=trace").into(),
|
||||
])
|
||||
@@ -119,7 +119,7 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
|
||||
p.with_id(PARA_ID_1)
|
||||
.with_chain("elastic-scaling")
|
||||
.with_default_command("test-teyrchain")
|
||||
.with_default_image(images.pezcumulus.as_str())
|
||||
.with_default_image(images.pezcumulus())
|
||||
.with_collator(|n|
|
||||
n.with_name("collator-elastic")
|
||||
.with_args(vec![
|
||||
@@ -131,7 +131,7 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
|
||||
.with_teyrchain(|p| {
|
||||
p.with_id(PARA_ID_2)
|
||||
.with_default_command("test-teyrchain")
|
||||
.with_default_image(images.pezcumulus.as_str())
|
||||
.with_default_image(images.pezcumulus())
|
||||
.with_collator(|n|
|
||||
n.with_name("collator-single-core")
|
||||
.with_args(vec![
|
||||
|
||||
+5
-5
@@ -8,7 +8,7 @@ use anyhow::anyhow;
|
||||
use pezcumulus_zombienet_sdk_helpers::{assert_relay_parent_offset, assign_cores};
|
||||
use serde_json::json;
|
||||
use zombienet_sdk::{
|
||||
subxt::{OnlineClient, PolkadotConfig},
|
||||
subxt::{OnlineClient, PezkuwiConfig},
|
||||
NetworkConfigBuilder,
|
||||
};
|
||||
|
||||
@@ -42,14 +42,14 @@ async fn elastic_scaling_slot_based_relay_parent_offset_test() -> Result<(), any
|
||||
}))
|
||||
// Have to set a `with_node` outside of the loop below, so that `r` has the right
|
||||
// type.
|
||||
.with_node(|node| node.with_name("validator-0"));
|
||||
.with_validator(|node| node.with_name("validator-0"));
|
||||
|
||||
(1..6).fold(r, |acc, i| acc.with_node(|node| node.with_name(&format!("validator-{i}"))))
|
||||
(1..6).fold(r, |acc, i| acc.with_validator(|node| node.with_name(&format!("validator-{i}"))))
|
||||
})
|
||||
.with_teyrchain(|p| {
|
||||
p.with_id(2400)
|
||||
.with_default_command("test-teyrchain")
|
||||
.with_default_image(images.pezcumulus.as_str())
|
||||
.with_default_image(images.pezcumulus())
|
||||
.with_chain("relay-parent-offset")
|
||||
.with_default_args(vec![
|
||||
"--authoring=slot-based".into(),
|
||||
@@ -71,7 +71,7 @@ async fn elastic_scaling_slot_based_relay_parent_offset_test() -> Result<(), any
|
||||
let network = spawn_fn(config).await?;
|
||||
|
||||
let relay_node = network.get_node("validator-0")?;
|
||||
let relay_client: OnlineClient<PolkadotConfig> = relay_node.wait_client().await?;
|
||||
let relay_client: OnlineClient<PezkuwiConfig> = relay_node.wait_client().await?;
|
||||
|
||||
let para_node_rp_offset = network.get_node("collator-rp-offset")?;
|
||||
|
||||
|
||||
+10
-13
@@ -8,12 +8,12 @@ use std::time::Duration;
|
||||
use crate::utils::initialize_network;
|
||||
|
||||
use pezcumulus_zombienet_sdk_helpers::{
|
||||
assert_para_throughput, assign_cores, runtime_upgrade, wait_for_upgrade,
|
||||
assert_para_throughput, assign_cores, runtime_upgrade, wait_for_upgrade,
|
||||
};
|
||||
use pezkuwi_primitives::Id as ParaId;
|
||||
use rstest::rstest;
|
||||
use zombienet_sdk::{
|
||||
subxt::{OnlineClient, PolkadotConfig},
|
||||
subxt::{OnlineClient, PezkuwiConfig},
|
||||
NetworkConfig, NetworkConfigBuilder,
|
||||
};
|
||||
|
||||
@@ -44,7 +44,7 @@ async fn elastic_scaling_upgrade_to_3_cores(
|
||||
let network = initialize_network(config).await?;
|
||||
|
||||
let alice = network.get_node("validator0")?;
|
||||
let alice_client: OnlineClient<PolkadotConfig> = alice.wait_client().await?;
|
||||
let alice_client: OnlineClient<PezkuwiConfig> = alice.wait_client().await?;
|
||||
|
||||
assign_cores(alice, PARA_ID, vec![0]).await?;
|
||||
|
||||
@@ -69,7 +69,7 @@ async fn elastic_scaling_upgrade_to_3_cores(
|
||||
assign_cores(alice, PARA_ID, vec![1, 2]).await?;
|
||||
let timeout_secs: u64 = 250;
|
||||
let collator0 = network.get_node("collator0")?;
|
||||
let collator0_client: OnlineClient<PolkadotConfig> = collator0.wait_client().await?;
|
||||
let collator0_client: OnlineClient<PezkuwiConfig> = collator0.wait_client().await?;
|
||||
|
||||
let current_spec_version =
|
||||
collator0_client.backend().current_runtime_version().await?.spec_version;
|
||||
@@ -81,13 +81,10 @@ async fn elastic_scaling_upgrade_to_3_cores(
|
||||
runtime_upgrade(&network, collator0, PARA_ID, wasm).await?;
|
||||
|
||||
let collator1 = network.get_node("collator1")?;
|
||||
let collator1_client: OnlineClient<PolkadotConfig> = collator1.wait_client().await?;
|
||||
let collator1_client: OnlineClient<PezkuwiConfig> = collator1.wait_client().await?;
|
||||
let expected_spec_version = current_spec_version + 1;
|
||||
|
||||
log::info!(
|
||||
"Waiting (up to {timeout_secs}s) for teyrchain runtime upgrade to version {}",
|
||||
expected_spec_version
|
||||
);
|
||||
log::info!("Waiting (up to {timeout_secs}s) for teyrchain runtime upgrade to version {expected_spec_version}");
|
||||
tokio::time::timeout(
|
||||
Duration::from_secs(timeout_secs),
|
||||
wait_for_upgrade(collator1_client, expected_spec_version),
|
||||
@@ -145,16 +142,16 @@ async fn build_network_config(async_backing: bool) -> Result<NetworkConfig, anyh
|
||||
.with_default_command("pezkuwi")
|
||||
.with_default_image(images.polkadot.as_str())
|
||||
.with_default_args(vec![("-lteyrchain=debug").into()])
|
||||
.with_node(|node| node.with_name("validator0"))
|
||||
.with_node(|node| node.with_name("validator1"))
|
||||
.with_node(|node| node.with_name("validator2"))
|
||||
.with_validator(|node| node.with_name("validator0"))
|
||||
.with_validator(|node| node.with_name("validator1"))
|
||||
.with_validator(|node| node.with_name("validator2"))
|
||||
})
|
||||
.with_teyrchain(|p| {
|
||||
p.with_id(PARA_ID)
|
||||
.with_default_command("test-teyrchain")
|
||||
.onboard_as_teyrchain(false)
|
||||
.with_chain(chain)
|
||||
.with_default_image(images.pezcumulus.as_str())
|
||||
.with_default_image(images.pezcumulus())
|
||||
.with_collator(|n| {
|
||||
n.with_name("collator0").validator(true).with_args(vec![
|
||||
"--authoring=slot-based".into(),
|
||||
|
||||
@@ -6,11 +6,11 @@ use tokio::time::Duration;
|
||||
|
||||
use crate::utils::{initialize_network, BEST_BLOCK_METRIC};
|
||||
|
||||
use pezcumulus_zombienet_sdk_helpers::assert_para_throughput;
|
||||
use pezcumulus_zombienet_sdk_helpers::{assert_para_throughput};
|
||||
use pezkuwi_primitives::Id as ParaId;
|
||||
use zombienet_orchestrator::network::node::LogLineCountOptions;
|
||||
use zombienet_sdk::{
|
||||
subxt::{OnlineClient, PolkadotConfig},
|
||||
subxt::{OnlineClient, PezkuwiConfig},
|
||||
NetworkConfig, NetworkConfigBuilder,
|
||||
};
|
||||
|
||||
@@ -29,7 +29,7 @@ async fn full_node_catching_up() -> Result<(), anyhow::Error> {
|
||||
let network = initialize_network(config).await?;
|
||||
|
||||
let relay_alice = network.get_node("alice")?;
|
||||
let relay_client: OnlineClient<PolkadotConfig> = relay_alice.wait_client().await?;
|
||||
let relay_client: OnlineClient<PezkuwiConfig> = relay_alice.wait_client().await?;
|
||||
|
||||
log::info!("Ensuring teyrchain making progress");
|
||||
assert_para_throughput(
|
||||
@@ -84,13 +84,13 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
|
||||
.with_default_command("pezkuwi")
|
||||
.with_default_image(images.polkadot.as_str())
|
||||
.with_default_args(vec![("-lteyrchain=debug").into()])
|
||||
.with_node(|node| node.with_name("alice"))
|
||||
.with_node(|node| node.with_name("bob"))
|
||||
.with_validator(|node| node.with_name("alice"))
|
||||
.with_validator(|node| node.with_name("bob"))
|
||||
})
|
||||
.with_teyrchain(|p| {
|
||||
p.with_id(PARA_ID)
|
||||
.with_default_command("test-teyrchain")
|
||||
.with_default_image(images.pezcumulus.as_str())
|
||||
.with_default_image(images.pezcumulus())
|
||||
.with_collator(|n| {
|
||||
n.with_name("charlie")
|
||||
.validator(true)
|
||||
|
||||
@@ -116,9 +116,9 @@ use anyhow::anyhow;
|
||||
use pezkuwi_primitives::Id as ParaId;
|
||||
|
||||
use crate::utils::{initialize_network, BEST_BLOCK_METRIC};
|
||||
use pezcumulus_zombienet_sdk_helpers::assert_para_is_registered;
|
||||
use pezcumulus_zombienet_sdk_helpers::{assert_para_is_registered};
|
||||
use zombienet_sdk::{
|
||||
subxt::{OnlineClient, PolkadotConfig},
|
||||
subxt::{OnlineClient, PezkuwiConfig},
|
||||
NetworkConfig, NetworkConfigBuilder,
|
||||
};
|
||||
|
||||
@@ -138,7 +138,7 @@ async fn full_node_warp_sync() -> Result<(), anyhow::Error> {
|
||||
let network = initialize_network(config).await?;
|
||||
|
||||
let alice = network.get_node("alice")?;
|
||||
let alice_client: OnlineClient<PolkadotConfig> = alice.wait_client().await?;
|
||||
let alice_client: OnlineClient<PezkuwiConfig> = alice.wait_client().await?;
|
||||
|
||||
log::info!("Ensuring teyrchain is registered");
|
||||
assert_para_is_registered(&alice_client, ParaId::from(PARA_ID), 10).await?;
|
||||
@@ -180,12 +180,12 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
|
||||
.with_default_image(images.polkadot.as_str())
|
||||
.with_chain_spec_path("tests/zombie_ci/warp-sync-relaychain-spec.json")
|
||||
.with_default_args(vec![("-lteyrchain=debug").into()])
|
||||
.with_node(|node| node.with_name("alice").with_db_snapshot(DB_SNAPSHOT_RELAYCHAIN))
|
||||
.with_node(|node| node.with_name("bob").with_db_snapshot(DB_SNAPSHOT_RELAYCHAIN))
|
||||
.with_node(|node| {
|
||||
.with_validator(|node| node.with_name("alice").with_db_snapshot(DB_SNAPSHOT_RELAYCHAIN))
|
||||
.with_validator(|node| node.with_name("bob").with_db_snapshot(DB_SNAPSHOT_RELAYCHAIN))
|
||||
.with_validator(|node| {
|
||||
node.with_name("charlie").with_db_snapshot(DB_SNAPSHOT_RELAYCHAIN)
|
||||
})
|
||||
.with_node(|node| {
|
||||
.with_validator(|node| {
|
||||
node.with_name("dave").with_args(vec![
|
||||
("-lteyrchain=debug").into(),
|
||||
("--no-beefy").into(),
|
||||
@@ -206,7 +206,7 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
|
||||
.with_teyrchain(|p| {
|
||||
p.with_id(PARA_ID)
|
||||
.with_default_command("test-teyrchain")
|
||||
.with_default_image(images.pezcumulus.as_str())
|
||||
.with_default_image(images.pezcumulus())
|
||||
.with_chain_spec_path("tests/zombie_ci/warp-sync-teyrchain-spec.json")
|
||||
.with_default_args(vec![("-lteyrchain=debug").into()])
|
||||
.with_collator(|n| n.with_name("eve").with_db_snapshot(DB_SNAPSHOT_TEYRCHAIN))
|
||||
|
||||
@@ -7,11 +7,11 @@ use std::{path::Path, str::FromStr};
|
||||
|
||||
use crate::utils::{initialize_network, BEST_BLOCK_METRIC};
|
||||
|
||||
use pezcumulus_zombienet_sdk_helpers::assert_para_throughput;
|
||||
use pezcumulus_zombienet_sdk_helpers::{assert_para_throughput};
|
||||
use pezkuwi_primitives::Id as ParaId;
|
||||
use pezsp_core::{hexdisplay::AsBytesRef, Bytes};
|
||||
use zombienet_sdk::{
|
||||
subxt::{self, dynamic::Value, tx::DynamicPayload, OnlineClient, PolkadotConfig},
|
||||
subxt::{self, dynamic::Value, tx::DynamicPayload, OnlineClient, PezkuwiConfig},
|
||||
subxt_signer::sr25519::dev,
|
||||
NetworkConfig, NetworkConfigBuilder, RegistrationStrategy,
|
||||
};
|
||||
@@ -44,7 +44,7 @@ async fn migrate_solo_to_para() -> Result<(), anyhow::Error> {
|
||||
let network = initialize_network(config).await?;
|
||||
|
||||
let alice = network.get_node("alice")?;
|
||||
let alice_client: OnlineClient<PolkadotConfig> = alice.wait_client().await?;
|
||||
let alice_client: OnlineClient<PezkuwiConfig> = alice.wait_client().await?;
|
||||
|
||||
log::info!("Ensuring teyrchain making progress");
|
||||
assert_para_throughput(
|
||||
@@ -74,7 +74,7 @@ async fn migrate_solo_to_para() -> Result<(), anyhow::Error> {
|
||||
log::info!("Migrating solo to para");
|
||||
let base_dir = network.base_dir().ok_or(anyhow!("failed to get base dir"))?;
|
||||
let call = create_migrate_solo_to_para_call(base_dir, "2000-1").await?;
|
||||
let dave_client: OnlineClient<PolkadotConfig> = dave.wait_client().await?;
|
||||
let dave_client: OnlineClient<PezkuwiConfig> = dave.wait_client().await?;
|
||||
|
||||
// Don't wait for finalization. dave will be disconnected after transaction success and it won't
|
||||
// be able to get its status
|
||||
@@ -124,14 +124,14 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
|
||||
.with_default_command("pezkuwi")
|
||||
.with_default_image(images.polkadot.as_str())
|
||||
.with_default_args(vec![("-lteyrchain=debug").into()])
|
||||
.with_node(|node| node.with_name("alice"))
|
||||
.with_node(|node| node.with_name("bob"))
|
||||
.with_validator(|node| node.with_name("alice"))
|
||||
.with_validator(|node| node.with_name("bob"))
|
||||
})
|
||||
.with_teyrchain(|p| {
|
||||
// teyrchain A
|
||||
p.with_id(PARA_ID)
|
||||
.with_default_command("test-teyrchain")
|
||||
.with_default_image(images.pezcumulus.as_str())
|
||||
.with_default_image(images.pezcumulus())
|
||||
.with_collator(|n| {
|
||||
n.with_name("dave").with_args(vec![("-lteyrchain=debug").into()])
|
||||
})
|
||||
@@ -141,7 +141,7 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
|
||||
p.with_id(PARA_ID)
|
||||
.with_registration_strategy(RegistrationStrategy::Manual)
|
||||
.with_default_command("test-teyrchain")
|
||||
.with_default_image(images.pezcumulus.as_str())
|
||||
.with_default_image(images.pezcumulus())
|
||||
// modify genesis to produce different teyrchain header than for teyrchain A
|
||||
.with_genesis_overrides(json!({
|
||||
"sudo": {
|
||||
|
||||
@@ -13,7 +13,7 @@ use zombienet_configuration::types::Arg;
|
||||
use zombienet_orchestrator::network::node::LogLineCountOptions;
|
||||
use zombienet_sdk::{
|
||||
environment::Provider,
|
||||
subxt::{OnlineClient, PolkadotConfig},
|
||||
subxt::{OnlineClient, PezkuwiConfig},
|
||||
NetworkConfig, NetworkConfigBuilder, RegistrationStrategy,
|
||||
};
|
||||
|
||||
@@ -48,7 +48,7 @@ async fn pov_recovery() -> Result<(), anyhow::Error> {
|
||||
network.register_parachain(PARA_ID).await?;
|
||||
|
||||
let validator = network.get_node("validator-0")?;
|
||||
let validator_client: OnlineClient<PolkadotConfig> = validator.wait_client().await?;
|
||||
let validator_client: OnlineClient<PezkuwiConfig> = validator.wait_client().await?;
|
||||
|
||||
log::info!("Ensuring teyrchain is registered within 30 blocks");
|
||||
assert_para_is_registered(&validator_client, ParaId::from(PARA_ID), 30).await?;
|
||||
@@ -156,14 +156,14 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
|
||||
}
|
||||
}
|
||||
}))
|
||||
.with_node(|node| {
|
||||
.with_validator(|node| {
|
||||
node.with_name("validator-0").validator(true).with_args(vec![
|
||||
("-lteyrchain::availability=trace,sync=info,teyrchain=debug,libp2p_mdns=debug,info").into(),
|
||||
])
|
||||
});
|
||||
|
||||
(1..validator_cnt).fold(r, |acc, i| {
|
||||
acc.with_node(|node| {
|
||||
acc.with_validator(|node| {
|
||||
node.with_name(&format!("validator-{i}")).with_args(vec![
|
||||
("-lteyrchain::availability=trace,sync=debug,teyrchain=debug,libp2p_mdns=debug").into(),
|
||||
("--reserved-only").into(),
|
||||
@@ -176,7 +176,7 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
|
||||
p.with_id(PARA_ID)
|
||||
.with_registration_strategy(RegistrationStrategy::Manual)
|
||||
.with_default_command("test-teyrchain")
|
||||
.with_default_image(images.pezcumulus.as_str())
|
||||
.with_default_image(images.pezcumulus())
|
||||
.with_collator(|c| {
|
||||
c.with_name("bob")
|
||||
.validator(true)
|
||||
|
||||
@@ -6,11 +6,11 @@ use std::time::Duration;
|
||||
|
||||
use crate::utils::{initialize_network, BEST_BLOCK_METRIC};
|
||||
|
||||
use pezcumulus_zombienet_sdk_helpers::assert_para_throughput;
|
||||
use pezcumulus_zombienet_sdk_helpers::{assert_para_throughput};
|
||||
use pezkuwi_primitives::Id as ParaId;
|
||||
use zombienet_orchestrator::network::node::LogLineCountOptions;
|
||||
use zombienet_sdk::{
|
||||
subxt::{OnlineClient, PolkadotConfig},
|
||||
subxt::{OnlineClient, PezkuwiConfig},
|
||||
NetworkConfig, NetworkConfigBuilder,
|
||||
};
|
||||
|
||||
@@ -28,7 +28,7 @@ async fn rpc_collator_builds_blocks() -> Result<(), anyhow::Error> {
|
||||
let network = initialize_network(config).await?;
|
||||
|
||||
let alice = network.get_node("alice")?;
|
||||
let alice_client: OnlineClient<PolkadotConfig> = alice.wait_client().await?;
|
||||
let alice_client: OnlineClient<PezkuwiConfig> = alice.wait_client().await?;
|
||||
|
||||
log::info!("Ensuring teyrchain making progress");
|
||||
assert_para_throughput(
|
||||
@@ -113,17 +113,17 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
|
||||
.with_default_command("pezkuwi")
|
||||
.with_default_image(images.polkadot.as_str())
|
||||
.with_default_args(vec![("-lteyrchain=debug").into()])
|
||||
.with_node(|node| node.with_name("alice"))
|
||||
.with_node(|node| node.with_name("bob"))
|
||||
.with_node(|node| node.with_name("charlie"))
|
||||
.with_node(|node| node.with_name("one").validator(false))
|
||||
.with_node(|node| node.with_name("two").validator(false))
|
||||
.with_node(|node| node.with_name("three").validator(false))
|
||||
.with_validator(|node| node.with_name("alice"))
|
||||
.with_validator(|node| node.with_name("bob"))
|
||||
.with_validator(|node| node.with_name("charlie"))
|
||||
.with_validator(|node| node.with_name("one").validator(false))
|
||||
.with_validator(|node| node.with_name("two").validator(false))
|
||||
.with_validator(|node| node.with_name("three").validator(false))
|
||||
})
|
||||
.with_teyrchain(|p| {
|
||||
p.with_id(PARA_ID)
|
||||
.with_default_command("test-teyrchain")
|
||||
.with_default_image(images.pezcumulus.as_str())
|
||||
.with_default_image(images.pezcumulus())
|
||||
.with_default_args(vec![
|
||||
("-lteyrchain=trace,blockchain-rpc-client=debug").into(),
|
||||
(
|
||||
|
||||
@@ -10,7 +10,7 @@ use pezcumulus_zombienet_sdk_helpers::{assert_para_throughput, wait_for_upgrade}
|
||||
use pezkuwi_primitives::Id as ParaId;
|
||||
use zombienet_configuration::types::AssetLocation;
|
||||
use zombienet_sdk::{
|
||||
subxt::{OnlineClient, PolkadotConfig},
|
||||
subxt::{OnlineClient, PezkuwiConfig},
|
||||
tx_helper::{ChainUpgrade, RuntimeUpgradeOptions},
|
||||
NetworkConfig, NetworkConfigBuilder,
|
||||
};
|
||||
@@ -32,7 +32,7 @@ async fn runtime_upgrade() -> Result<(), anyhow::Error> {
|
||||
let network = initialize_network(config).await?;
|
||||
|
||||
let alice = network.get_node("alice")?;
|
||||
let alice_client: OnlineClient<PolkadotConfig> = alice.wait_client().await?;
|
||||
let alice_client: OnlineClient<PezkuwiConfig> = alice.wait_client().await?;
|
||||
|
||||
log::info!("Ensuring teyrchain making progress");
|
||||
assert_para_throughput(
|
||||
@@ -44,7 +44,7 @@ async fn runtime_upgrade() -> Result<(), anyhow::Error> {
|
||||
|
||||
let timeout_secs: u64 = 250;
|
||||
let charlie = network.get_node("charlie")?;
|
||||
let charlie_client: OnlineClient<PolkadotConfig> = charlie.wait_client().await?;
|
||||
let charlie_client: OnlineClient<PezkuwiConfig> = charlie.wait_client().await?;
|
||||
|
||||
let current_spec_version =
|
||||
charlie_client.backend().current_runtime_version().await?.spec_version;
|
||||
@@ -61,13 +61,10 @@ async fn runtime_upgrade() -> Result<(), anyhow::Error> {
|
||||
.await?;
|
||||
|
||||
let dave = network.get_node("dave")?;
|
||||
let dave_client: OnlineClient<PolkadotConfig> = dave.wait_client().await?;
|
||||
let dave_client: OnlineClient<PezkuwiConfig> = dave.wait_client().await?;
|
||||
let expected_spec_version = current_spec_version + 1;
|
||||
|
||||
log::info!(
|
||||
"Waiting (up to {timeout_secs}s) for teyrchain runtime upgrade to version {}",
|
||||
expected_spec_version
|
||||
);
|
||||
log::info!("Waiting (up to {timeout_secs}s) for teyrchain runtime upgrade to version {expected_spec_version}");
|
||||
tokio::time::timeout(
|
||||
Duration::from_secs(timeout_secs),
|
||||
wait_for_upgrade(dave_client, expected_spec_version),
|
||||
@@ -100,13 +97,13 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
|
||||
.with_default_command("pezkuwi")
|
||||
.with_default_image(images.polkadot.as_str())
|
||||
.with_default_args(vec![("-lteyrchain=debug").into()])
|
||||
.with_node(|node| node.with_name("alice"))
|
||||
.with_node(|node| node.with_name("bob"))
|
||||
.with_validator(|node| node.with_name("alice"))
|
||||
.with_validator(|node| node.with_name("bob"))
|
||||
})
|
||||
.with_teyrchain(|p| {
|
||||
p.with_id(PARA_ID)
|
||||
.with_default_command("test-teyrchain")
|
||||
.with_default_image(images.pezcumulus.as_str())
|
||||
.with_default_image(images.pezcumulus())
|
||||
.with_collator(|n| {
|
||||
n.with_name("charlie")
|
||||
.validator(true)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
use anyhow::anyhow;
|
||||
use pezsp_core::{Bytes, Encode};
|
||||
use zombienet_sdk::{subxt::ext::subxt_rpcs::rpc_params, NetworkConfigBuilder};
|
||||
use zombienet_sdk::{subxt::ext::pezkuwi_subxt_rpcs::rpc_params, NetworkConfigBuilder};
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn statement_store() -> Result<(), anyhow::Error> {
|
||||
@@ -25,14 +25,14 @@ async fn statement_store() -> Result<(), anyhow::Error> {
|
||||
.with_default_args(vec!["-lteyrchain=debug".into()])
|
||||
// Have to set a `with_node` outside of the loop below, so that `r` has the right
|
||||
// type.
|
||||
.with_node(|node| node.with_name("validator-0"));
|
||||
.with_validator(|node| node.with_name("validator-0"));
|
||||
|
||||
(1..6).fold(r, |acc, i| acc.with_node(|node| node.with_name(&format!("validator-{i}"))))
|
||||
(1..6).fold(r, |acc, i| acc.with_validator(|node| node.with_name(&format!("validator-{i}"))))
|
||||
})
|
||||
.with_teyrchain(|p| {
|
||||
p.with_id(2400)
|
||||
.with_default_command("pezkuwi-teyrchain")
|
||||
.with_default_image(images.pezcumulus.as_str())
|
||||
.with_default_image(images.pezcumulus())
|
||||
.with_chain("people-zagros-local")
|
||||
.with_default_args(vec![
|
||||
"--force-authoring".into(),
|
||||
|
||||
@@ -12,7 +12,7 @@ use pezsp_statement_store::{Channel, Statement, Topic};
|
||||
use std::{cell::Cell, collections::HashMap, time::Duration};
|
||||
use tokio::time::timeout;
|
||||
use zombienet_sdk::{
|
||||
subxt::{backend::rpc::RpcClient, ext::subxt_rpcs::rpc_params},
|
||||
subxt::{backend::rpc::RpcClient, ext::pezkuwi_subxt_rpcs::rpc_params},
|
||||
LocalFileSystem, Network, NetworkConfigBuilder,
|
||||
};
|
||||
|
||||
@@ -46,12 +46,12 @@ async fn statement_store_one_pez_node_bench() -> Result<(), anyhow::Error> {
|
||||
let collator_names = ["alice", "bob"];
|
||||
let network = spawn_network(&collator_names).await?;
|
||||
|
||||
info!("Starting statement store benchmark with {} participants", PARTICIPANT_SIZE);
|
||||
info!("Starting statement store benchmark with {PARTICIPANT_SIZE} participants");
|
||||
|
||||
let target_node = collator_names[0];
|
||||
let node = network.get_node(target_node)?;
|
||||
let rpc_client = node.rpc().await?;
|
||||
info!("Created single RPC client for target node: {}", target_node);
|
||||
info!("Created single RPC client for target node: {target_node}");
|
||||
|
||||
let mut participants = Vec::with_capacity(PARTICIPANT_SIZE as usize);
|
||||
for i in 0..(PARTICIPANT_SIZE) as usize {
|
||||
@@ -96,7 +96,7 @@ async fn statement_store_many_nodes_bench() -> Result<(), anyhow::Error> {
|
||||
let collator_names = ["alice", "bob", "charlie", "dave", "eve", "ferdie"];
|
||||
let network = spawn_network(&collator_names).await?;
|
||||
|
||||
info!("Starting statement store benchmark with {} participants", PARTICIPANT_SIZE);
|
||||
info!("Starting statement store benchmark with {PARTICIPANT_SIZE} participants");
|
||||
|
||||
let mut rpc_clients = Vec::new();
|
||||
for &name in &collator_names {
|
||||
@@ -104,19 +104,17 @@ async fn statement_store_many_nodes_bench() -> Result<(), anyhow::Error> {
|
||||
let rpc_client = node.rpc().await?;
|
||||
rpc_clients.push(rpc_client);
|
||||
}
|
||||
info!("Created RPC clients for {} collator nodes", rpc_clients.len());
|
||||
let rpc_clients_len = rpc_clients.len();
|
||||
info!("Created RPC clients for {rpc_clients_len} collator nodes");
|
||||
|
||||
let mut participants = Vec::with_capacity(PARTICIPANT_SIZE as usize);
|
||||
for i in 0..(PARTICIPANT_SIZE) as usize {
|
||||
let client_idx = i % collator_names.len();
|
||||
participants.push(Participant::new(i as u32, rpc_clients[client_idx].clone()));
|
||||
}
|
||||
info!(
|
||||
"{} participants were distributed across {} nodes: {} participants per node",
|
||||
PARTICIPANT_SIZE,
|
||||
collator_names.len(),
|
||||
PARTICIPANT_SIZE as usize / collator_names.len()
|
||||
);
|
||||
let collator_count = collator_names.len();
|
||||
let participants_per_node = PARTICIPANT_SIZE as usize / collator_names.len();
|
||||
info!("{PARTICIPANT_SIZE} participants were distributed across {collator_count} nodes: {participants_per_node} participants per node");
|
||||
|
||||
let handles: Vec<_> = participants
|
||||
.into_iter()
|
||||
@@ -159,7 +157,7 @@ async fn statement_store_memory_stress_bench() -> Result<(), anyhow::Error> {
|
||||
let target_node = collator_names[0];
|
||||
let node = network.get_node(target_node)?;
|
||||
let rpc_client = node.rpc().await?;
|
||||
info!("Created single RPC client for target node: {}", target_node);
|
||||
info!("Created single RPC client for target node: {target_node}");
|
||||
|
||||
let total_tasks = 64 * 1024;
|
||||
let payload_size = 1024;
|
||||
@@ -170,8 +168,7 @@ async fn statement_store_memory_stress_bench() -> Result<(), anyhow::Error> {
|
||||
let propogation_capacity = submit_capacity * (num_collators - 1); // 5x per node
|
||||
let start_time = std::time::Instant::now();
|
||||
|
||||
info!("Starting memory stress benchmark with {} tasks, each submitting {} statements of {}B payload, total submit capacity per node: {}, total propagation capacity: {}",
|
||||
total_tasks, statements_per_task, payload_size, submit_capacity, propogation_capacity);
|
||||
info!("Starting memory stress benchmark with {total_tasks} tasks, each submitting {statements_per_task} statements of {payload_size}B payload, total submit capacity per node: {submit_capacity}, total propagation capacity: {propogation_capacity}");
|
||||
|
||||
for _ in 0..total_tasks {
|
||||
let rpc_client = rpc_client.clone();
|
||||
@@ -200,13 +197,12 @@ async fn statement_store_memory_stress_bench() -> Result<(), anyhow::Error> {
|
||||
};
|
||||
|
||||
if err.to_string().contains("Statement store error: Store is full") {
|
||||
info!("Statement store is full, {}/{} statements submitted, `statements_per_task` overestimated", statement_count, statements_per_task);
|
||||
info!("Statement store is full, {statement_count}/{statements_per_task} statements submitted, `statements_per_task` overestimated");
|
||||
break;
|
||||
}
|
||||
|
||||
info!(
|
||||
"Failed to submit statement, retrying in {}ms: {:?}",
|
||||
RETRY_DELAY_MS, err
|
||||
"Failed to submit statement, retrying in {RETRY_DELAY_MS}ms: {err:?}"
|
||||
);
|
||||
tokio::time::sleep(Duration::from_millis(RETRY_DELAY_MS)).await;
|
||||
}
|
||||
@@ -214,7 +210,8 @@ async fn statement_store_memory_stress_bench() -> Result<(), anyhow::Error> {
|
||||
});
|
||||
}
|
||||
|
||||
info!("All {} tasks spawned in {:.2}s", total_tasks, start_time.elapsed().as_secs_f64());
|
||||
let spawn_elapsed = start_time.elapsed().as_secs_f64();
|
||||
info!("All {total_tasks} tasks spawned in {spawn_elapsed:.2}s");
|
||||
|
||||
let mut prev_submitted: HashMap<&str, u64> = HashMap::new();
|
||||
let mut prev_propagated: HashMap<&str, u64> = HashMap::new();
|
||||
@@ -276,7 +273,7 @@ async fn statement_store_memory_stress_bench() -> Result<(), anyhow::Error> {
|
||||
prev_propagated.insert(name, count);
|
||||
}
|
||||
|
||||
info!("[{:>3}s] Statements submitted propagated", elapsed);
|
||||
info!("[{elapsed:>3}s] Statements submitted propagated");
|
||||
for i in 0..collator_names.len() {
|
||||
let (sub_name, sub_count, sub_rate) = submitted_metrics[i];
|
||||
let (prop_name, prop_count, prop_rate) = propagated_metrics[i];
|
||||
@@ -286,20 +283,13 @@ async fn statement_store_memory_stress_bench() -> Result<(), anyhow::Error> {
|
||||
let prop_percentage = prop_count * 100 / propogation_capacity;
|
||||
|
||||
info!(
|
||||
" {:<8} {:>8} {:>3}% {:>8}/s {:>8} {:>3}% {:>8}/s",
|
||||
sub_name,
|
||||
sub_count,
|
||||
sub_percentage,
|
||||
sub_rate,
|
||||
prop_count,
|
||||
prop_percentage,
|
||||
prop_rate
|
||||
" {sub_name:<8} {sub_count:>8} {sub_percentage:>3}% {sub_rate:>8}/s {prop_count:>8} {prop_percentage:>3}% {prop_rate:>8}/s"
|
||||
);
|
||||
}
|
||||
|
||||
let total_submitted: u64 = submitted_metrics.iter().map(|(_, count, _)| *count).sum();
|
||||
if total_submitted == submit_capacity * num_collators {
|
||||
info!("Reached total submit capacity of {} statements per node in {}s, benchmark completed successfully", submit_capacity, elapsed);
|
||||
info!("Reached total submit capacity of {submit_capacity} statements per node in {elapsed}s, benchmark completed successfully");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -318,14 +308,14 @@ async fn spawn_network(collators: &[&str]) -> Result<Network<LocalFileSystem>, a
|
||||
.with_default_command("pezkuwi")
|
||||
.with_default_image(images.polkadot.as_str())
|
||||
.with_default_args(vec!["-lteyrchain=debug".into()])
|
||||
.with_node(|node| node.with_name("validator-0"))
|
||||
.with_node(|node| node.with_name("validator-1"))
|
||||
.with_validator(|node| node.with_name("validator-0"))
|
||||
.with_validator(|node| node.with_name("validator-1"))
|
||||
})
|
||||
.with_teyrchain(|p| {
|
||||
let p = p
|
||||
.with_id(2400)
|
||||
.with_default_command("pezkuwi-teyrchain")
|
||||
.with_default_image(images.pezcumulus.as_str())
|
||||
.with_default_image(images.pezcumulus())
|
||||
.with_chain_spec_path("tests/zombie_ci/people-pezkuwichain-spec.json")
|
||||
.with_default_args(vec![
|
||||
"--force-authoring".into(),
|
||||
@@ -457,7 +447,7 @@ impl Participant {
|
||||
}
|
||||
|
||||
fn new(idx: u32, rpc_client: RpcClient) -> Self {
|
||||
debug!(target: &format!("participant_{idx}"), "Initializing participant {}", idx);
|
||||
debug!(target: &format!("participant_{idx}"), "Initializing participant {idx}");
|
||||
let (keyring, _) = sr25519::Pair::generate();
|
||||
let (session_key, _) = sr25519::Pair::generate();
|
||||
|
||||
@@ -483,12 +473,14 @@ impl Participant {
|
||||
|
||||
async fn wait_for_retry(&mut self) -> Result<(), anyhow::Error> {
|
||||
if self.retry_count >= MAX_RETRIES {
|
||||
return Err(anyhow!("No more retry attempts for participant {}", self.idx));
|
||||
let idx = self.idx;
|
||||
return Err(anyhow!("No more retry attempts for participant {idx}"));
|
||||
}
|
||||
|
||||
self.retry_count += 1;
|
||||
if self.retry_count % 10 == 0 {
|
||||
debug!(target: &self.log_target(), "Retry attempt {}", self.retry_count);
|
||||
if self.retry_count.is_multiple_of(10) {
|
||||
let retry_count = self.retry_count;
|
||||
debug!(target: &self.log_target(), "Retry attempt {retry_count}");
|
||||
}
|
||||
tokio::time::sleep(tokio::time::Duration::from_millis(RETRY_DELAY_MS)).await;
|
||||
|
||||
@@ -496,7 +488,7 @@ impl Participant {
|
||||
}
|
||||
|
||||
async fn wait_for_propagation(&mut self) {
|
||||
trace!(target: &self.log_target(), "Waiting {}ms for propagation", PROPAGATION_DELAY_MS);
|
||||
trace!(target: &self.log_target(), "Waiting {PROPAGATION_DELAY_MS}ms for propagation");
|
||||
tokio::time::sleep(tokio::time::Duration::from_millis(PROPAGATION_DELAY_MS)).await;
|
||||
}
|
||||
|
||||
@@ -508,7 +500,8 @@ impl Participant {
|
||||
.await?;
|
||||
|
||||
self.sent_count += 1;
|
||||
trace!(target: &self.log_target(), "Submitted statement (counter: {})", self.sent_count);
|
||||
let sent_count = self.sent_count;
|
||||
trace!(target: &self.log_target(), "Submitted statement (counter: {sent_count})");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -600,7 +593,7 @@ impl Participant {
|
||||
}
|
||||
},
|
||||
res => {
|
||||
debug!(target: &self.log_target(), "No statements received for idx {:?}: {:?}", idx, res);
|
||||
debug!(target: &self.log_target(), "No statements received for idx {idx:?}: {res:?}");
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -609,7 +602,8 @@ impl Participant {
|
||||
if pending.is_empty() {
|
||||
break;
|
||||
}
|
||||
trace!(target: &self.log_target(), "Session keys left to receive: {:?}, waiting {}ms for retry", pending.len(), RETRY_DELAY_MS);
|
||||
let pending_len = pending.len();
|
||||
trace!(target: &self.log_target(), "Session keys left to receive: {pending_len:?}, waiting {RETRY_DELAY_MS}ms for retry");
|
||||
self.wait_for_retry().await?;
|
||||
}
|
||||
|
||||
@@ -673,7 +667,7 @@ impl Participant {
|
||||
}
|
||||
},
|
||||
res => {
|
||||
debug!(target: &self.log_target(), "No statements received for sender {:?}: {:?}", sender_idx, res);
|
||||
debug!(target: &self.log_target(), "No statements received for sender {sender_idx:?}: {res:?}");
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -682,7 +676,8 @@ impl Participant {
|
||||
if pending.is_empty() {
|
||||
break;
|
||||
}
|
||||
trace!(target: &self.log_target(), "Messages left to receive: {:?}, waiting {}ms for retry", pending.len(), RETRY_DELAY_MS);
|
||||
let pending_len = pending.len();
|
||||
trace!(target: &self.log_target(), "Messages left to receive: {pending_len:?}, waiting {RETRY_DELAY_MS}ms for retry");
|
||||
self.wait_for_retry().await?;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ use anyhow::anyhow;
|
||||
|
||||
use crate::utils::{initialize_network, BEST_BLOCK_METRIC};
|
||||
|
||||
use pezcumulus_zombienet_sdk_helpers::assert_para_throughput;
|
||||
use pezcumulus_zombienet_sdk_helpers::{assert_para_throughput};
|
||||
use pezkuwi_primitives::Id as ParaId;
|
||||
use zombienet_sdk::{
|
||||
subxt::{OnlineClient, PolkadotConfig},
|
||||
subxt::{OnlineClient, PezkuwiConfig},
|
||||
NetworkConfig, NetworkConfigBuilder,
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@ async fn sync_blocks_from_tip_without_connected_collator() -> Result<(), anyhow:
|
||||
|
||||
let relay_alice = network.get_node("alice")?;
|
||||
|
||||
let relay_client: OnlineClient<PolkadotConfig> = relay_alice.wait_client().await?;
|
||||
let relay_client: OnlineClient<PezkuwiConfig> = relay_alice.wait_client().await?;
|
||||
|
||||
log::info!("Ensuring teyrchain making progress");
|
||||
assert_para_throughput(
|
||||
@@ -83,13 +83,13 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
|
||||
// Leaving them in case we switch to `k8s` some day.
|
||||
resources.with_request_cpu(2).with_request_memory("2G")
|
||||
})
|
||||
.with_node(|node| node.with_name("alice"))
|
||||
.with_node(|node| node.with_name("bob"))
|
||||
.with_validator(|node| node.with_name("alice"))
|
||||
.with_validator(|node| node.with_name("bob"))
|
||||
})
|
||||
.with_teyrchain(|p| {
|
||||
p.with_id(PARA_ID)
|
||||
.with_default_command("test-teyrchain")
|
||||
.with_default_image(images.pezcumulus.as_str())
|
||||
.with_default_image(images.pezcumulus())
|
||||
.with_default_args(vec![("-lteyrchain=debug").into()])
|
||||
.with_collator(|n| n.with_name("dave").validator(false))
|
||||
.with_collator(|n| n.with_name("charlie").validator(true))
|
||||
|
||||
+6
-6
@@ -5,10 +5,10 @@ use anyhow::anyhow;
|
||||
use tokio::time::Duration;
|
||||
|
||||
use crate::utils::{initialize_network, BEST_BLOCK_METRIC};
|
||||
use pezcumulus_zombienet_sdk_helpers::submit_extrinsic_and_wait_for_finalization_success_with_timeout;
|
||||
use pezcumulus_zombienet_sdk_helpers::{submit_extrinsic_and_wait_for_finalization_success_with_timeout};
|
||||
use zombienet_orchestrator::network::node::{LogLineCount, LogLineCountOptions};
|
||||
use zombienet_sdk::{
|
||||
subxt::{self, dynamic::Value, OnlineClient, PolkadotConfig},
|
||||
subxt::{self, dynamic::Value, OnlineClient, PezkuwiConfig},
|
||||
subxt_signer::sr25519::dev,
|
||||
NetworkConfig, NetworkConfigBuilder,
|
||||
};
|
||||
@@ -105,7 +105,7 @@ async fn teyrchain_extrinsic_gets_finalized() -> Result<(), anyhow::Error> {
|
||||
|
||||
log::info!("Ensuring teyrchain extrinsic gets finalized");
|
||||
let call = subxt::dynamic::tx("System", "remark", vec![Value::from_bytes("xxx".as_bytes())]);
|
||||
let charlie_client: OnlineClient<PolkadotConfig> = charlie.wait_client().await?;
|
||||
let charlie_client: OnlineClient<PezkuwiConfig> = charlie.wait_client().await?;
|
||||
|
||||
let res = submit_extrinsic_and_wait_for_finalization_success_with_timeout(
|
||||
&charlie_client,
|
||||
@@ -140,14 +140,14 @@ async fn build_network_config() -> Result<NetworkConfig, anyhow::Error> {
|
||||
r.with_chain("pezkuwichain-local")
|
||||
.with_default_command("pezkuwi")
|
||||
.with_default_image(images.polkadot.as_str())
|
||||
.with_node(|node| node.with_name("alice"))
|
||||
.with_node(|node| node.with_name("bob"))
|
||||
.with_validator(|node| node.with_name("alice"))
|
||||
.with_validator(|node| node.with_name("bob"))
|
||||
})
|
||||
.with_teyrchain(|p| {
|
||||
p.with_id(PARA_ID)
|
||||
.with_chain("asset-hub-pezkuwichain-local")
|
||||
.with_default_command("pezkuwi-teyrchain")
|
||||
.with_default_image(images.pezcumulus.as_str())
|
||||
.with_default_image(images.pezcumulus())
|
||||
.with_collator(|n| {
|
||||
n.with_name("charlie").validator(true).with_args(vec![
|
||||
("--force-authoring").into(),
|
||||
|
||||
Reference in New Issue
Block a user