From 0dce964c7bf561ec878900c130a7281a75916a1e Mon Sep 17 00:00:00 2001 From: Kurdistan Tech Ministry Date: Sun, 4 Jan 2026 12:00:19 +0300 Subject: [PATCH] fix(zombienet): Ed25519 detection for asset-hub-pezkuwichain Change Ed25519 AURA key detection from 'asset-hub-polkadot' to 'asset-hub-pezkuwi' to properly generate Ed25519 keys for asset-hub-pezkuwichain collators. This fixes the teyrchain collation issue where AURA keys were being generated with Sr25519 instead of Ed25519. Changes: - chain_spec.rs: Update chain ID check for Ed25519 detection - keystore.rs: Rename parameter for clarity - keystore_key_types.rs: Update function parameters and docs - spawner.rs: Update Ed25519 detection logic --- .../orchestrator/src/generators/chain_spec.rs | 8 +++---- .../orchestrator/src/generators/keystore.rs | 22 ++++++++--------- .../src/generators/keystore_key_types.rs | 24 +++++++++---------- .../crates/orchestrator/src/spawner.rs | 6 ++--- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/vendor/pezkuwi-zombienet-sdk/crates/orchestrator/src/generators/chain_spec.rs b/vendor/pezkuwi-zombienet-sdk/crates/orchestrator/src/generators/chain_spec.rs index 8052cedb..af636ac3 100644 --- a/vendor/pezkuwi-zombienet-sdk/crates/orchestrator/src/generators/chain_spec.rs +++ b/vendor/pezkuwi-zombienet-sdk/crates/orchestrator/src/generators/chain_spec.rs @@ -1349,16 +1349,16 @@ fn add_authorities( nodes: &[&NodeSpec], session_key: SessionKeyType, ) { - let asset_hub_polkadot = chain_spec_json + let is_asset_hub_pezkuwi = chain_spec_json .get("id") .and_then(|v| v.as_str()) - .map(|id| id.starts_with("asset-hub-polkadot")) + .map(|id| id.starts_with("asset-hub-pezkuwi")) .unwrap_or_default(); if let Some(val) = chain_spec_json.pointer_mut(runtime_config_ptr) { if let Some(session_keys) = val.pointer_mut("/session/keys") { let keys: Vec = nodes .iter() - .map(|node| get_node_keys(node, session_key, asset_hub_polkadot)) + .map(|node| get_node_keys(node, session_key, is_asset_hub_pezkuwi)) .collect(); *session_keys = json!(keys); } else { @@ -1891,7 +1891,7 @@ mod tests { } #[test] - fn get_node_keys_supports_asset_hub_polkadot() { + fn get_node_keys_supports_asset_hub_pezkuwi() { let mut name = String::from("luca"); let seed = format!("//{}{name}", name.remove(0).to_uppercase()); let accounts = diff --git a/vendor/pezkuwi-zombienet-sdk/crates/orchestrator/src/generators/keystore.rs b/vendor/pezkuwi-zombienet-sdk/crates/orchestrator/src/generators/keystore.rs index c79d3b57..7f91d17a 100644 --- a/vendor/pezkuwi-zombienet-sdk/crates/orchestrator/src/generators/keystore.rs +++ b/vendor/pezkuwi-zombienet-sdk/crates/orchestrator/src/generators/keystore.rs @@ -19,7 +19,7 @@ use crate::{ /// * `acc` - The node accounts containing the seed and public keys /// * `node_files_path` - The path where keystore files will be created /// * `scoped_fs` - The scoped filesystem for file operations -/// * `asset_hub_polkadot` - Whether this is for asset-hub-polkadot (affects aura key scheme) +/// * `is_asset_hub_pezkuwi` - Whether this is for asset-hub-pezkuwi (affects aura key scheme) /// * `keystore_key_types` - Optional list of key type specifications /// /// If `keystore_key_types` is empty, all default key types will be generated. @@ -28,7 +28,7 @@ pub async fn generate<'a, T>( acc: &NodeAccounts, node_files_path: impl AsRef, scoped_fs: &ScopedFilesystem<'a, T>, - asset_hub_polkadot: bool, + is_asset_hub_pezkuwi: bool, keystore_key_types: Vec<&str>, ) -> Result, GeneratorError> where @@ -39,7 +39,7 @@ where let mut filenames = vec![]; // Parse the key type specifications - let key_types = parse_keystore_key_types(&keystore_key_types, asset_hub_polkadot); + let key_types = parse_keystore_key_types(&keystore_key_types, is_asset_hub_pezkuwi); let futures: Vec<_> = key_types .iter() @@ -163,7 +163,7 @@ mod tests { struct TestCase { name: &'static str, key_types: Vec<&'static str>, - asset_hub_polkadot: bool, + is_asset_hub_pezkuwi: bool, expected_prefix: &'static str, expected_public_key: &'static str, } @@ -172,28 +172,28 @@ mod tests { TestCase { name: "explicit scheme override (gran_sr)", key_types: vec!["gran_sr"], - asset_hub_polkadot: false, + is_asset_hub_pezkuwi: false, expected_prefix: "6772616e", // "gran" in hex expected_public_key: "sr_public_key", }, TestCase { - name: "aura with asset_hub_polkadot uses ed", + name: "aura with is_asset_hub_pezkuwi uses ed", key_types: vec!["aura"], - asset_hub_polkadot: true, + is_asset_hub_pezkuwi: true, expected_prefix: "61757261", // "aura" in hex expected_public_key: "ed_public_key", }, TestCase { - name: "aura without asset_hub_polkadot uses sr", + name: "aura without is_asset_hub_pezkuwi uses sr", key_types: vec!["aura"], - asset_hub_polkadot: false, + is_asset_hub_pezkuwi: false, expected_prefix: "61757261", // "aura" in hex expected_public_key: "sr_public_key", }, TestCase { name: "custom key type with explicit ec scheme", key_types: vec!["cust_ec"], - asset_hub_polkadot: false, + is_asset_hub_pezkuwi: false, expected_prefix: "63757374", // "cust" in hex expected_public_key: "ec_public_key", }, @@ -206,7 +206,7 @@ mod tests { let key_types: Vec<&str> = tc.key_types.clone(); let res = - generate(&accounts, "node1", &scoped_fs, tc.asset_hub_polkadot, key_types).await; + generate(&accounts, "node1", &scoped_fs, tc.is_asset_hub_pezkuwi, key_types).await; assert!(res.is_ok(), "[{}] Expected Ok but got: {:?}", tc.name, res.err()); let filenames = res.unwrap(); diff --git a/vendor/pezkuwi-zombienet-sdk/crates/orchestrator/src/generators/keystore_key_types.rs b/vendor/pezkuwi-zombienet-sdk/crates/orchestrator/src/generators/keystore_key_types.rs index 8004705b..f0a32d17 100644 --- a/vendor/pezkuwi-zombienet-sdk/crates/orchestrator/src/generators/keystore_key_types.rs +++ b/vendor/pezkuwi-zombienet-sdk/crates/orchestrator/src/generators/keystore_key_types.rs @@ -63,12 +63,12 @@ impl KeystoreKeyType { } /// Returns the default predefined key schemes for known key types. -/// Special handling for `aura` when `is_asset_hub_polkadot` is true. -fn get_predefined_schemes(is_asset_hub_polkadot: bool) -> HashMap<&'static str, KeyScheme> { +/// Special handling for `aura` when `is_asset_hub_pezkuwi` is true. +fn get_predefined_schemes(is_asset_hub_pezkuwi: bool) -> HashMap<&'static str, KeyScheme> { let mut schemes = HashMap::new(); - // aura has special handling for asset-hub-polkadot - if is_asset_hub_polkadot { + // aura has special handling for asset-hub-pezkuwi + if is_asset_hub_pezkuwi { schemes.insert("aura", KeyScheme::Ed); } else { schemes.insert("aura", KeyScheme::Sr); @@ -130,9 +130,9 @@ fn parse_key_spec(spec: &str, predefined: &HashMap<&str, KeyScheme>) -> Option>( specs: &[T], - is_asset_hub_polkadot: bool, + is_asset_hub_pezkuwi: bool, ) -> Vec { - let predefined_schemes = get_predefined_schemes(is_asset_hub_polkadot); + let predefined_schemes = get_predefined_schemes(is_asset_hub_pezkuwi); let parsed: Vec = specs .iter() @@ -140,15 +140,15 @@ pub fn parse_keystore_key_types>( .collect(); if parsed.is_empty() { - get_default_keystore_key_types(is_asset_hub_polkadot) + get_default_keystore_key_types(is_asset_hub_pezkuwi) } else { parsed } } /// Returns the default keystore key types when none are specified. -pub fn get_default_keystore_key_types(is_asset_hub_polkadot: bool) -> Vec { - let predefined_schemes = get_predefined_schemes(is_asset_hub_polkadot); +pub fn get_default_keystore_key_types(is_asset_hub_pezkuwi: bool) -> Vec { + let predefined_schemes = get_predefined_schemes(is_asset_hub_pezkuwi); let default_keys = [ "aura", "babe", "imon", "gran", "audi", "asgn", "para", "beef", "nmbs", "rand", "rate", "mixn", "bcsv", "ftsv", @@ -236,15 +236,15 @@ mod tests { } #[test] - fn full_workflow_asset_hub_polkadot() { - // For asset-hub-polkadot, aura should default to ed + fn full_workflow_asset_hub_pezkuwi() { + // For asset-hub-pezkuwi, aura should default to ed let specs = vec!["aura".to_string(), "babe".to_string()]; let res = parse_keystore_key_types(&specs, true); assert_eq!(res.len(), 2); assert_eq!(res[0].key_type, "aura"); - assert_eq!(res[0].scheme, KeyScheme::Ed); // ed for asset-hub-polkadot + assert_eq!(res[0].scheme, KeyScheme::Ed); // ed for asset-hub-pezkuwi assert_eq!(res[1].key_type, "babe"); assert_eq!(res[1].scheme, KeyScheme::Sr); diff --git a/vendor/pezkuwi-zombienet-sdk/crates/orchestrator/src/spawner.rs b/vendor/pezkuwi-zombienet-sdk/crates/orchestrator/src/spawner.rs index 9c77835e..280eac0e 100644 --- a/vendor/pezkuwi-zombienet-sdk/crates/orchestrator/src/spawner.rs +++ b/vendor/pezkuwi-zombienet-sdk/crates/orchestrator/src/spawner.rs @@ -65,14 +65,14 @@ where // Generate keystore for node let node_files_path = if let Some(para) = ctx.parachain { para.id.to_string() } else { node.name.clone() }; - let asset_hub_polkadot = - ctx.parachain_id.map(|id| id.starts_with("asset-hub-polkadot")).unwrap_or_default(); + let is_asset_hub_pezkuwi = + ctx.parachain_id.map(|id| id.starts_with("asset-hub-pezkuwi")).unwrap_or_default(); let keystore_key_types = node.keystore_key_types.iter().map(String::as_str).collect(); let key_filenames = generators::generate_node_keystore( &node.accounts, &node_files_path, ctx.scoped_fs, - asset_hub_polkadot, + is_asset_hub_pezkuwi, keystore_key_types, ) .await