From a17e00586680ac21fbfae283c8ac2385d6f2cf92 Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Fri, 12 Dec 2025 08:07:28 +0100 Subject: [PATCH 01/27] add matrix test --- .github/workflows/ci_matrix_test.yml | 151 +++++++++++++++++++++++++++ crates/sdk/tests/matrix-native.rs | 61 +++++++++++ 2 files changed, 212 insertions(+) create mode 100644 .github/workflows/ci_matrix_test.yml create mode 100644 crates/sdk/tests/matrix-native.rs diff --git a/.github/workflows/ci_matrix_test.yml b/.github/workflows/ci_matrix_test.yml new file mode 100644 index 000000000..6913f0475 --- /dev/null +++ b/.github/workflows/ci_matrix_test.yml @@ -0,0 +1,151 @@ +name: Zombienet Compatibility Matrix + +on: + workflow_dispatch: + inputs: + runtime_pattern: + description: "Pattern for runtime artifact" + default: "asset-hub-polkadot_runtime-*.compact.compressed.wasm" + required: true + override_versions: + description: "Space separated list of versions to test (leave empty to auto-detect 2 latest stable)" + required: false + default: "" + +env: + BASE_IMAGE: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 + RUST_LOG: "zombienet_orchestrator=debug,zombienet_provider=debug" + CARGO_TARGET_DIR: /tmp/target + +jobs: + prepare-matrix: + runs-on: parity-default + container: + image: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + versions: ${{ steps.get-versions.outputs.versions }} + steps: + - name: Get Versions + id: get-versions + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if [ -n "${{ inputs.override_versions }}" ]; then + VERSIONS=(${{ inputs.override_versions }}) + else + # Fetch tags, filter for polkadot-stable, sort desc, take top 2 unique + RAW_TAGS=$(gh api graphql -F owner='paritytech' -F name='polkadot-sdk' -f query=' + query($name: String!, $owner: String!) { + repository(owner: $owner, name: $name) { + releases(first: 20, orderBy: {field: CREATED_AT, direction: DESC}) { + nodes { tagName } + } + } + }' --jq '.data.repository.releases.nodes[].tagName') + VERSIONS=($(echo "$RAW_TAGS" | grep -E "^polkadot-stable[0-9]{4}(-[0-9]+)?$" | head -n 2)) + fi + + echo "Selected versions: ${VERSIONS[@]}" + echo "versions=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${VERSIONS[@]}")" >> $GITHUB_OUTPUT + + - name: Generate Matrix + id: set-matrix + run: | + # Read the JSON array of versions + VERSIONS='${{ steps.get-versions.outputs.versions }}' + + # Generate combinations: + # We need a matrix that looks like: [{relay: v1, para: v1}, {relay: v1, para: v2}, {relay: v2, para: v1}, {relay: v2, para: v2}] + + MATRIX=$(echo $VERSIONS | jq -c ' + . as $v | + [ + combinations(2) | + { + polkadot: .[0], + cumulus: .[1], + } + ] + ') + + echo "Generated Matrix: $MATRIX" + echo "matrix=$MATRIX" >> $GITHUB_OUTPUT + + run-compatibility-test: + needs: prepare-matrix + runs-on: parity-default + container: + image: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 + strategy: + fail-fast: false + matrix: + cfg: ${{ fromJson(needs.prepare-matrix.outputs.matrix) }} + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Download Runtime + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + mkdir -p artifacts + echo "Fetching latest runtime from polkadot-fellows/runtimes..." + + gh release download -R polkadot-fellows/runtimes \ + -p "${{ inputs.runtime_pattern }}" \ + --output artifacts/test_runtime.wasm + + if [ ! -f artifacts/test_runtime.wasm ]; then + echo "::error::Runtime was not downloaded. Check the pattern or repo permissions." + exit 1 + fi + echo "Runtime downloaded to $(pwd)/artifacts/test_runtime.wasm" + + - name: Download Binaries + shell: bash + run: | + RELAY_VER="${{ matrix.cfg.polkadot }}" + PARA_VER="${{ matrix.cfg.cumulus }}" + + NODE_BINS=("polkadot" "polkadot-execute-worker" "polkadot-prepare-worker") + PARA_BINS=("polkadot-parachain") + + mkdir -p ./bin + + # Helper function to download + download_bin() { + local BIN=$1 + local VER=$2 + echo "Downloading $BIN for $VER..." + curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$VER/$BIN" -o "./bin/$BIN" + chmod +x "./bin/$BIN" + } + + # Download Relay Chain Binaries + for bin in "${NODE_BINS[@]}"; do + download_bin "$bin" "$RELAY_VER" + done + + # Download Parachain Binaries + for bin in "${PARA_BINS[@]}"; do + download_bin "$bin" "$PARA_VER" + done + + echo "$PWD/bin" >> $GITHUB_PATH + + ls -lrt ./bin/ + + - name: Run Compatibility Test for polkadot-${{ matrix.cfg.polkadot }} with polkadot-parachain-${{ matrix.cfg.cumulus }} + env: + RUNTIME_PATH: ${{ github.workspace }}/artifacts/test_runtime.wasm + ZOMBIE_PROVIDER: native + PATH: ${{ github.workspace }}/bin:${{ env.PATH }} + run: | + echo "Running Compatibility Test..." + echo "Relay: ${{ matrix.cfg.polkadot }}" + echo "Cumulus: ${{ matrix.cfg.cumulus }}" + + cargo test --test matrix-native -- --nocapture + \ No newline at end of file diff --git a/crates/sdk/tests/matrix-native.rs b/crates/sdk/tests/matrix-native.rs new file mode 100644 index 000000000..68b109286 --- /dev/null +++ b/crates/sdk/tests/matrix-native.rs @@ -0,0 +1,61 @@ +use std::{env, path::PathBuf}; + +use configuration::{NetworkConfig, NetworkConfigBuilder}; +use subxt::{ext::futures::StreamExt, OnlineClient, PolkadotConfig}; +use zombienet_sdk::NetworkConfigExt; + +fn small_network() -> NetworkConfig { + let runtime_path = PathBuf::from(env::var("RUNTIME_PATH").unwrap()); + + NetworkConfigBuilder::new() + .with_relaychain(|r| { + r.with_chain("polkadot-local") + .with_default_command("polkadot") + .with_default_args(vec!["-lparachain=debug,runtime=debug".into()]) + .with_validator(|node| node.with_name("alice")) + .with_validator(|node| node.with_name("bob")) + }) + .with_parachain(|p| { + p.with_id(3000) + .cumulus_based(true) + .with_chain_spec_runtime(runtime_path, None) + .with_collator(|n| n.with_name("collator").with_command("polkadot-parachain")) + }) + .build() + .unwrap() +} + +#[tokio::test(flavor = "multi_thread")] +async fn ci_native_smoke_should_works() { + tracing_subscriber::fmt::init(); + let config = small_network(); + let network = config.spawn_native().await.unwrap(); + + let alice = network.get_node("alice").unwrap(); + let alice_client: OnlineClient = alice.wait_client().await.unwrap(); + + let mut blocks = alice_client + .blocks() + .subscribe_finalized() + .await + .unwrap() + .take(10); + + while let Some(block) = blocks.next().await { + println!("Block #{}", block.unwrap().header().number); + } + + let collator = network.get_node("collator").unwrap(); + let collator_client: OnlineClient = collator.wait_client().await.unwrap(); + + let mut blocks = collator_client + .blocks() + .subscribe_finalized() + .await + .unwrap() + .take(10); + + while let Some(block) = blocks.next().await { + println!("Parachain Block #{}", block.unwrap().header().number); + } +} From a40a4724e734137e48707090ca043ff3876b235c Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Fri, 12 Dec 2025 08:08:30 +0100 Subject: [PATCH 02/27] clippy --- crates/cli/src/reproduce.rs | 16 ++++++++-------- crates/examples/examples/keystore_key_types.rs | 10 +++++----- crates/orchestrator/src/generators/keystore.rs | 3 +-- .../src/generators/keystore_key_types.rs | 2 +- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/crates/cli/src/reproduce.rs b/crates/cli/src/reproduce.rs index d5618fde7..9e0a77424 100644 --- a/crates/cli/src/reproduce.rs +++ b/crates/cli/src/reproduce.rs @@ -139,7 +139,7 @@ fn validate_archive_path(path: &str, require_extension: &str) -> Result let canonical = p .canonicalize() - .with_context(|| format!("Failed to resolve path: {}", path))?; + .with_context(|| format!("Failed to resolve path: {path}"))?; let meta = std::fs::metadata(&canonical) .with_context(|| format!("Failed to stat path: {}", canonical.display()))?; @@ -215,7 +215,7 @@ impl ArtifactDownloader { let pattern = self .artifact_pattern .as_ref() - .map(|f| format!("*{}*", f)) + .map(|f| format!("*{f}*")) .unwrap_or_else(|| DEFAULT_ARTIFACT_PATTERN.to_string()); println!( @@ -223,7 +223,7 @@ impl ArtifactDownloader { self.run_id, self.repo ); if let Some(filter) = &self.artifact_pattern { - println!(" Using filter pattern: *{}*", filter); + println!(" Using filter pattern: *{filter}*"); } let output = Command::new("gh") @@ -579,7 +579,7 @@ impl TestRunner { fn print_archive_header(&self, current: usize, total: usize) { println!("═══════════════════════════════════════════════════════════════"); - println!("Running archive {}/{}", current, total); + println!("Running archive {current}/{total}"); println!("═══════════════════════════════════════════════════════════════\n"); } @@ -591,7 +591,7 @@ impl TestRunner { test_filter: Option<&Vec>, ) -> Result<()> { let archive_name = archive_path.file_name().unwrap().to_string_lossy(); - println!("🚀 Running tests from: {}", archive_name); + println!("🚀 Running tests from: {archive_name}"); let inner_cmd = build_nextest_command(self.binaries_dir.as_ref(), skip_tests, test_filter); let mut cmd = build_docker_command( @@ -617,7 +617,7 @@ impl TestRunner { ); anyhow::bail!("Test execution failed"); } else { - println!("✅ Tests from {} completed successfully\n", archive_name); + println!("✅ Tests from {archive_name} completed successfully\n"); } Ok(()) @@ -691,9 +691,9 @@ fn build_docker_command( archive_path.display(), DOCKER_ARCHIVE_MOUNT_PATH ); - let workspace_mount = format!("{}:{}", workspace_path, DOCKER_WORKSPACE_MOUNT_PATH); + let workspace_mount = format!("{workspace_path}:{DOCKER_WORKSPACE_MOUNT_PATH}"); let docker_image = get_docker_image(workspace_path).unwrap_or_else(|e| { - eprintln!("Warning: {}", e); + eprintln!("Warning: {e}"); DEFAULT_DOCKER_IMAGE.to_string() }); diff --git a/crates/examples/examples/keystore_key_types.rs b/crates/examples/examples/keystore_key_types.rs index 0b9e4fddb..727bec056 100644 --- a/crates/examples/examples/keystore_key_types.rs +++ b/crates/examples/examples/keystore_key_types.rs @@ -53,10 +53,10 @@ fn verify_keystore_keys( let expected_hex: HashSet = expected_key_types.iter().map(hex::encode).collect(); let actual_hex = get_keystore_key_types(keystore_path) - .map_err(|e| format!("Failed to read keystore for {}: {}", node_name, e))?; + .map_err(|e| format!("Failed to read keystore for {node_name}: {e}"))?; if expected_hex != actual_hex { - return Err(format!("Keystore mismatch for {}:\n", node_name,)); + return Err(format!("Keystore mismatch for {node_name}:\n",)); } Ok(()) @@ -95,7 +95,7 @@ async fn main() -> Result<(), Box> { .base_dir() .ok_or("Failed to get network base directory")?; - println!("📁 Network base directory: {}", base_dir); + println!("📁 Network base directory: {base_dir}"); println!(); println!("🔑 Verifying keystore key types..."); @@ -116,10 +116,10 @@ async fn main() -> Result<(), Box> { match verify_keystore_keys(&path, expected_keys, node_name) { Ok(()) => { - println!(" ✅ Verified: {:?}", expected_keys); + println!(" ✅ Verified: {expected_keys:?}"); }, Err(err) => { - println!(" ❌ {}", err); + println!(" ❌ {err}"); }, } } diff --git a/crates/orchestrator/src/generators/keystore.rs b/crates/orchestrator/src/generators/keystore.rs index 2a04d56be..e225d3d1a 100644 --- a/crates/orchestrator/src/generators/keystore.rs +++ b/crates/orchestrator/src/generators/keystore.rs @@ -72,8 +72,7 @@ fn generate_keystore_filename(key_type: &KeystoreKeyType, acc: &NodeAccounts) -> .accounts .get(account_key) .expect(&format!( - "Key '{}' should be set for node {THIS_IS_A_BUG}", - account_key + "Key '{account_key}' should be set for node {THIS_IS_A_BUG}" )) .public_key .as_str(); diff --git a/crates/orchestrator/src/generators/keystore_key_types.rs b/crates/orchestrator/src/generators/keystore_key_types.rs index 324f6a502..bd9b32eb0 100644 --- a/crates/orchestrator/src/generators/keystore_key_types.rs +++ b/crates/orchestrator/src/generators/keystore_key_types.rs @@ -42,7 +42,7 @@ impl TryFrom<&str> for KeyScheme { "sr" => Ok(KeyScheme::Sr), "ed" => Ok(KeyScheme::Ed), "ec" => Ok(KeyScheme::Ec), - _ => Err(format!("Unsupported key scheme: {}", value)), + _ => Err(format!("Unsupported key scheme: {value}")), } } } From 1ae136fe2831a102d6fbf0bc6e77d6b0df448004 Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Fri, 12 Dec 2025 08:30:32 +0100 Subject: [PATCH 03/27] temporary trigger --- .github/workflows/ci_matrix_test.yml | 36 ++++++++++++++++------------ 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci_matrix_test.yml b/.github/workflows/ci_matrix_test.yml index 6913f0475..79e3c8040 100644 --- a/.github/workflows/ci_matrix_test.yml +++ b/.github/workflows/ci_matrix_test.yml @@ -1,16 +1,18 @@ name: Zombienet Compatibility Matrix on: - workflow_dispatch: - inputs: - runtime_pattern: - description: "Pattern for runtime artifact" - default: "asset-hub-polkadot_runtime-*.compact.compressed.wasm" - required: true - override_versions: - description: "Space separated list of versions to test (leave empty to auto-detect 2 latest stable)" - required: false - default: "" + pull_request: + branches: [main] + # workflow_dispatch: + # inputs: + # runtime_pattern: + # description: "Pattern for runtime artifact" + # default: "asset-hub-polkadot_runtime-*.compact.compressed.wasm" + # required: true + # override_versions: + # description: "Space separated list of versions to test (leave empty to auto-detect 2 latest stable)" + # required: false + # default: "" env: BASE_IMAGE: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 @@ -31,9 +33,9 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - if [ -n "${{ inputs.override_versions }}" ]; then - VERSIONS=(${{ inputs.override_versions }}) - else + # if [ -n "${{ inputs.override_versions }}" ]; then + # VERSIONS=(${{ inputs.override_versions }}) + # else # Fetch tags, filter for polkadot-stable, sort desc, take top 2 unique RAW_TAGS=$(gh api graphql -F owner='paritytech' -F name='polkadot-sdk' -f query=' query($name: String!, $owner: String!) { @@ -44,7 +46,7 @@ jobs: } }' --jq '.data.repository.releases.nodes[].tagName') VERSIONS=($(echo "$RAW_TAGS" | grep -E "^polkadot-stable[0-9]{4}(-[0-9]+)?$" | head -n 2)) - fi + # fi echo "Selected versions: ${VERSIONS[@]}" echo "versions=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${VERSIONS[@]}")" >> $GITHUB_OUTPUT @@ -93,8 +95,12 @@ jobs: mkdir -p artifacts echo "Fetching latest runtime from polkadot-fellows/runtimes..." + # gh release download -R polkadot-fellows/runtimes \ + # -p "${{ inputs.runtime_pattern }}" \ + # --output artifacts/test_runtime.wasm + gh release download -R polkadot-fellows/runtimes \ - -p "${{ inputs.runtime_pattern }}" \ + -p "asset-hub-polkadot_runtime-*.compact.compressed.wasm" \ --output artifacts/test_runtime.wasm if [ ! -f artifacts/test_runtime.wasm ]; then From bd07f463913b41e6d74a4de1270e4944914c8656 Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Fri, 12 Dec 2025 08:43:41 +0100 Subject: [PATCH 04/27] specify bash --- .github/workflows/ci_matrix_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci_matrix_test.yml b/.github/workflows/ci_matrix_test.yml index 79e3c8040..38787428f 100644 --- a/.github/workflows/ci_matrix_test.yml +++ b/.github/workflows/ci_matrix_test.yml @@ -30,6 +30,7 @@ jobs: steps: - name: Get Versions id: get-versions + shell: bash env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | From b74452a72ef30e0390c701c8acfab0bf0074d3b0 Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Fri, 12 Dec 2025 09:07:36 +0100 Subject: [PATCH 05/27] add relay runtime --- .github/workflows/ci_matrix_test.yml | 29 ++++++++++++++++++++-------- crates/sdk/tests/matrix-native.rs | 8 +++++--- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci_matrix_test.yml b/.github/workflows/ci_matrix_test.yml index 38787428f..7f70e363f 100644 --- a/.github/workflows/ci_matrix_test.yml +++ b/.github/workflows/ci_matrix_test.yml @@ -89,26 +89,38 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 - - name: Download Runtime + - name: Download Runtimes env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | mkdir -p artifacts - echo "Fetching latest runtime from polkadot-fellows/runtimes..." + echo "Fetching latest relay runtime from polkadot-fellows/runtimes..." + + gh release download -R polkadot-fellows/runtimes \ + -p "polkadot_runtime-*.compact.compressed.wasm" \ + --output artifacts/relay_runtime.wasm + + if [ ! -f artifacts/relay_runtime.wasm ]; then + echo "::error::Relay runtime was not downloaded." + exit 1 + fi + echo "Relay runtime downloaded to $(pwd)/artifacts/relay_runtime.wasm" + echo "Fetching latest para runtime from polkadot-fellows/runtimes..." + # gh release download -R polkadot-fellows/runtimes \ # -p "${{ inputs.runtime_pattern }}" \ - # --output artifacts/test_runtime.wasm + # --output artifacts/para_runtime.wasm gh release download -R polkadot-fellows/runtimes \ -p "asset-hub-polkadot_runtime-*.compact.compressed.wasm" \ - --output artifacts/test_runtime.wasm + --output artifacts/para_runtime.wasm - if [ ! -f artifacts/test_runtime.wasm ]; then - echo "::error::Runtime was not downloaded. Check the pattern or repo permissions." + if [ ! -f artifacts/para_runtime.wasm ]; then + echo "::error::Para runtime was not downloaded." exit 1 fi - echo "Runtime downloaded to $(pwd)/artifacts/test_runtime.wasm" + echo "Para runtime downloaded to $(pwd)/artifacts/para_runtime.wasm" - name: Download Binaries shell: bash @@ -146,7 +158,8 @@ jobs: - name: Run Compatibility Test for polkadot-${{ matrix.cfg.polkadot }} with polkadot-parachain-${{ matrix.cfg.cumulus }} env: - RUNTIME_PATH: ${{ github.workspace }}/artifacts/test_runtime.wasm + PARA_RUNTIME_PATH: ${{ github.workspace }}/artifacts/para_runtime.wasm + RELAY_RUNTIME_PATH: ${{ github.workspace }}/artifacts/relay_runtime.wasm ZOMBIE_PROVIDER: native PATH: ${{ github.workspace }}/bin:${{ env.PATH }} run: | diff --git a/crates/sdk/tests/matrix-native.rs b/crates/sdk/tests/matrix-native.rs index 68b109286..4f28cd98b 100644 --- a/crates/sdk/tests/matrix-native.rs +++ b/crates/sdk/tests/matrix-native.rs @@ -1,24 +1,26 @@ use std::{env, path::PathBuf}; use configuration::{NetworkConfig, NetworkConfigBuilder}; -use subxt::{ext::futures::StreamExt, OnlineClient, PolkadotConfig}; +use subxt::{OnlineClient, PolkadotConfig, ext::futures::StreamExt}; use zombienet_sdk::NetworkConfigExt; fn small_network() -> NetworkConfig { - let runtime_path = PathBuf::from(env::var("RUNTIME_PATH").unwrap()); + let para_runtime_path = PathBuf::from(env::var("PARA_RUNTIME_PATH").unwrap()); + let relay_runtime_path = PathBuf::from(env::var("RELAY_RUNTIME_PATH").unwrap()); NetworkConfigBuilder::new() .with_relaychain(|r| { r.with_chain("polkadot-local") .with_default_command("polkadot") .with_default_args(vec!["-lparachain=debug,runtime=debug".into()]) + .with_chain_spec_runtime(relay_runtime_path, None) .with_validator(|node| node.with_name("alice")) .with_validator(|node| node.with_name("bob")) }) .with_parachain(|p| { p.with_id(3000) .cumulus_based(true) - .with_chain_spec_runtime(runtime_path, None) + .with_chain_spec_runtime(para_runtime_path, None) .with_collator(|n| n.with_name("collator").with_command("polkadot-parachain")) }) .build() From f38886b6a669eef7b579096bc3d4e5ead53fb2d3 Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Fri, 9 Jan 2026 13:08:14 +0100 Subject: [PATCH 06/27] add client-runtime action --- .github/workflows/ci_client_runtime_test.yml | 99 ++++++++++ .github/workflows/ci_matrix_test.yml | 171 ------------------ .../{matrix-native.rs => client-runtime.rs} | 21 --- 3 files changed, 99 insertions(+), 192 deletions(-) create mode 100644 .github/workflows/ci_client_runtime_test.yml delete mode 100644 .github/workflows/ci_matrix_test.yml rename crates/sdk/tests/{matrix-native.rs => client-runtime.rs} (64%) diff --git a/.github/workflows/ci_client_runtime_test.yml b/.github/workflows/ci_client_runtime_test.yml new file mode 100644 index 000000000..e0b78c7ce --- /dev/null +++ b/.github/workflows/ci_client_runtime_test.yml @@ -0,0 +1,99 @@ +name: Zombienet Client-Runtime Compatibility Test + +on: + pull_request: + branches: [main] + workflow_dispatch: + +env: + BASE_IMAGE: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 + RUST_LOG: "zombienet_orchestrator=debug,zombienet_provider=debug" + CARGO_TARGET_DIR: /tmp/target + +jobs: + prepare-matrix: + runs-on: parity-default + container: + image: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 + outputs: + runtime_matrix: ${{ steps.set-matrix.outputs.runtime_matrix }} + binary_tag: ${{ steps.set-matrix.outputs.binary_tag }} + steps: + - name: Fetch Versions + id: set-matrix + shell: bash + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Fetch 3 latest runtime tags from fellows/runtimes (v2.0.4, v2.0.3, etc) + RUNTIMES=$(gh api graphql -f query=' + query { + repository(owner: "polkadot-fellows", name: "runtimes") { + releases(first: 3, orderBy: {field: CREATED_AT, direction: DESC}) { + nodes { tagName } + } + } + }' --jq '.data.repository.releases.nodes[].tagName' | grep -E "^v[0-9]+" | head -n 3 | jq -R . | jq -s -c .) + + # Fetch latest stable binary tag from paritytech/polkadot-sdk + BINARY_TAG=$(gh api graphql -f query=' + query { + repository(owner: "paritytech", name: "polkadot-sdk") { + releases(first: 10, orderBy: {field: CREATED_AT, direction: DESC}) { + nodes { tagName } + } + } + }' --jq '.data.repository.releases.nodes[].tagName' | grep -E "^polkadot-stable[0-9]+" | head -n 1) + + echo "runtime_matrix=$RUNTIMES" >> $GITHUB_OUTPUT + echo "binary_tag=$BINARY_TAG" >> $GITHUB_OUTPUT + + test-runtime: + needs: prepare-matrix + runs-on: parity-default + name: "Test Runtime: ${{ matrix.runtime_tag }} with binary: ${{ needs.prepare-matrix.outputs.binary_tag }}" + container: + image: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 + strategy: + fail-fast: false + matrix: + runtime_tag: ${{ fromJson(needs.prepare-matrix.outputs.runtime_matrix) }} + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Download Latest Binaries + shell: bash + run: | + BIN_TAG="${{ needs.prepare-matrix.outputs.binary_tag }}" + mkdir -p ./bin + NODE_BINS=("polkadot" "polkadot-execute-worker" "polkadot-prepare-worker") + for bin in "${NODE_BINS[@]}"; do + echo "Downloading $bin @ $BIN_TAG" + curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$BIN_TAG/$bin" -o "./bin/$bin" + chmod +x "./bin/$bin" + done + echo "$PWD/bin" >> $GITHUB_PATH + + - name: Download Specific Runtime + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + mkdir -p artifacts + TAG="${{ matrix.runtime_tag }}" + + echo "Downloading Runtimes for $TAG..." + + gh release download "$TAG" -R polkadot-fellows/runtimes \ + -p "polkadot_runtime-*.compact.compressed.wasm" \ + --output artifacts/relay_runtime.wasm + + - name: Run Compatibility Test + env: + RELAY_RUNTIME_PATH: ${{ github.workspace }}/artifacts/relay_runtime.wasm + ZOMBIE_PROVIDER: native + PATH: ${{ github.workspace }}/bin:${{ env.PATH }} + run: | + echo "Testing Binary ${{ needs.prepare-matrix.outputs.binary_tag }} against Runtime ${{ matrix.runtime_tag }}" + cargo test --test client-runtime -- --nocapture \ No newline at end of file diff --git a/.github/workflows/ci_matrix_test.yml b/.github/workflows/ci_matrix_test.yml deleted file mode 100644 index 7f70e363f..000000000 --- a/.github/workflows/ci_matrix_test.yml +++ /dev/null @@ -1,171 +0,0 @@ -name: Zombienet Compatibility Matrix - -on: - pull_request: - branches: [main] - # workflow_dispatch: - # inputs: - # runtime_pattern: - # description: "Pattern for runtime artifact" - # default: "asset-hub-polkadot_runtime-*.compact.compressed.wasm" - # required: true - # override_versions: - # description: "Space separated list of versions to test (leave empty to auto-detect 2 latest stable)" - # required: false - # default: "" - -env: - BASE_IMAGE: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 - RUST_LOG: "zombienet_orchestrator=debug,zombienet_provider=debug" - CARGO_TARGET_DIR: /tmp/target - -jobs: - prepare-matrix: - runs-on: parity-default - container: - image: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - versions: ${{ steps.get-versions.outputs.versions }} - steps: - - name: Get Versions - id: get-versions - shell: bash - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # if [ -n "${{ inputs.override_versions }}" ]; then - # VERSIONS=(${{ inputs.override_versions }}) - # else - # Fetch tags, filter for polkadot-stable, sort desc, take top 2 unique - RAW_TAGS=$(gh api graphql -F owner='paritytech' -F name='polkadot-sdk' -f query=' - query($name: String!, $owner: String!) { - repository(owner: $owner, name: $name) { - releases(first: 20, orderBy: {field: CREATED_AT, direction: DESC}) { - nodes { tagName } - } - } - }' --jq '.data.repository.releases.nodes[].tagName') - VERSIONS=($(echo "$RAW_TAGS" | grep -E "^polkadot-stable[0-9]{4}(-[0-9]+)?$" | head -n 2)) - # fi - - echo "Selected versions: ${VERSIONS[@]}" - echo "versions=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${VERSIONS[@]}")" >> $GITHUB_OUTPUT - - - name: Generate Matrix - id: set-matrix - run: | - # Read the JSON array of versions - VERSIONS='${{ steps.get-versions.outputs.versions }}' - - # Generate combinations: - # We need a matrix that looks like: [{relay: v1, para: v1}, {relay: v1, para: v2}, {relay: v2, para: v1}, {relay: v2, para: v2}] - - MATRIX=$(echo $VERSIONS | jq -c ' - . as $v | - [ - combinations(2) | - { - polkadot: .[0], - cumulus: .[1], - } - ] - ') - - echo "Generated Matrix: $MATRIX" - echo "matrix=$MATRIX" >> $GITHUB_OUTPUT - - run-compatibility-test: - needs: prepare-matrix - runs-on: parity-default - container: - image: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 - strategy: - fail-fast: false - matrix: - cfg: ${{ fromJson(needs.prepare-matrix.outputs.matrix) }} - - steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - name: Download Runtimes - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - mkdir -p artifacts - echo "Fetching latest relay runtime from polkadot-fellows/runtimes..." - - gh release download -R polkadot-fellows/runtimes \ - -p "polkadot_runtime-*.compact.compressed.wasm" \ - --output artifacts/relay_runtime.wasm - - if [ ! -f artifacts/relay_runtime.wasm ]; then - echo "::error::Relay runtime was not downloaded." - exit 1 - fi - echo "Relay runtime downloaded to $(pwd)/artifacts/relay_runtime.wasm" - - echo "Fetching latest para runtime from polkadot-fellows/runtimes..." - - # gh release download -R polkadot-fellows/runtimes \ - # -p "${{ inputs.runtime_pattern }}" \ - # --output artifacts/para_runtime.wasm - - gh release download -R polkadot-fellows/runtimes \ - -p "asset-hub-polkadot_runtime-*.compact.compressed.wasm" \ - --output artifacts/para_runtime.wasm - - if [ ! -f artifacts/para_runtime.wasm ]; then - echo "::error::Para runtime was not downloaded." - exit 1 - fi - echo "Para runtime downloaded to $(pwd)/artifacts/para_runtime.wasm" - - - name: Download Binaries - shell: bash - run: | - RELAY_VER="${{ matrix.cfg.polkadot }}" - PARA_VER="${{ matrix.cfg.cumulus }}" - - NODE_BINS=("polkadot" "polkadot-execute-worker" "polkadot-prepare-worker") - PARA_BINS=("polkadot-parachain") - - mkdir -p ./bin - - # Helper function to download - download_bin() { - local BIN=$1 - local VER=$2 - echo "Downloading $BIN for $VER..." - curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$VER/$BIN" -o "./bin/$BIN" - chmod +x "./bin/$BIN" - } - - # Download Relay Chain Binaries - for bin in "${NODE_BINS[@]}"; do - download_bin "$bin" "$RELAY_VER" - done - - # Download Parachain Binaries - for bin in "${PARA_BINS[@]}"; do - download_bin "$bin" "$PARA_VER" - done - - echo "$PWD/bin" >> $GITHUB_PATH - - ls -lrt ./bin/ - - - name: Run Compatibility Test for polkadot-${{ matrix.cfg.polkadot }} with polkadot-parachain-${{ matrix.cfg.cumulus }} - env: - PARA_RUNTIME_PATH: ${{ github.workspace }}/artifacts/para_runtime.wasm - RELAY_RUNTIME_PATH: ${{ github.workspace }}/artifacts/relay_runtime.wasm - ZOMBIE_PROVIDER: native - PATH: ${{ github.workspace }}/bin:${{ env.PATH }} - run: | - echo "Running Compatibility Test..." - echo "Relay: ${{ matrix.cfg.polkadot }}" - echo "Cumulus: ${{ matrix.cfg.cumulus }}" - - cargo test --test matrix-native -- --nocapture - \ No newline at end of file diff --git a/crates/sdk/tests/matrix-native.rs b/crates/sdk/tests/client-runtime.rs similarity index 64% rename from crates/sdk/tests/matrix-native.rs rename to crates/sdk/tests/client-runtime.rs index 4f28cd98b..28f6fbcc8 100644 --- a/crates/sdk/tests/matrix-native.rs +++ b/crates/sdk/tests/client-runtime.rs @@ -5,7 +5,6 @@ use subxt::{OnlineClient, PolkadotConfig, ext::futures::StreamExt}; use zombienet_sdk::NetworkConfigExt; fn small_network() -> NetworkConfig { - let para_runtime_path = PathBuf::from(env::var("PARA_RUNTIME_PATH").unwrap()); let relay_runtime_path = PathBuf::from(env::var("RELAY_RUNTIME_PATH").unwrap()); NetworkConfigBuilder::new() @@ -17,12 +16,6 @@ fn small_network() -> NetworkConfig { .with_validator(|node| node.with_name("alice")) .with_validator(|node| node.with_name("bob")) }) - .with_parachain(|p| { - p.with_id(3000) - .cumulus_based(true) - .with_chain_spec_runtime(para_runtime_path, None) - .with_collator(|n| n.with_name("collator").with_command("polkadot-parachain")) - }) .build() .unwrap() } @@ -46,18 +39,4 @@ async fn ci_native_smoke_should_works() { while let Some(block) = blocks.next().await { println!("Block #{}", block.unwrap().header().number); } - - let collator = network.get_node("collator").unwrap(); - let collator_client: OnlineClient = collator.wait_client().await.unwrap(); - - let mut blocks = collator_client - .blocks() - .subscribe_finalized() - .await - .unwrap() - .take(10); - - while let Some(block) = blocks.next().await { - println!("Parachain Block #{}", block.unwrap().header().number); - } } From d322d1d34f46c969789b97740c75eb98c593dea6 Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Fri, 9 Jan 2026 13:26:55 +0100 Subject: [PATCH 07/27] sort versions --- .github/workflows/ci_client_runtime_test.yml | 2 +- crates/sdk/tests/client-runtime.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_client_runtime_test.yml b/.github/workflows/ci_client_runtime_test.yml index e0b78c7ce..2215ba79a 100644 --- a/.github/workflows/ci_client_runtime_test.yml +++ b/.github/workflows/ci_client_runtime_test.yml @@ -43,7 +43,7 @@ jobs: nodes { tagName } } } - }' --jq '.data.repository.releases.nodes[].tagName' | grep -E "^polkadot-stable[0-9]+" | head -n 1) + }' --jq '.data.repository.releases.nodes[].tagName' | grep -E "^polkadot-stable[0-9]+" | sort -Vr | head -n 1) echo "runtime_matrix=$RUNTIMES" >> $GITHUB_OUTPUT echo "binary_tag=$BINARY_TAG" >> $GITHUB_OUTPUT diff --git a/crates/sdk/tests/client-runtime.rs b/crates/sdk/tests/client-runtime.rs index 28f6fbcc8..ab46816d1 100644 --- a/crates/sdk/tests/client-runtime.rs +++ b/crates/sdk/tests/client-runtime.rs @@ -1,7 +1,7 @@ use std::{env, path::PathBuf}; use configuration::{NetworkConfig, NetworkConfigBuilder}; -use subxt::{OnlineClient, PolkadotConfig, ext::futures::StreamExt}; +use subxt::{ext::futures::StreamExt, OnlineClient, PolkadotConfig}; use zombienet_sdk::NetworkConfigExt; fn small_network() -> NetworkConfig { From 642089c60ff9dc31e55fa1954f9950f509256eae Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Fri, 9 Jan 2026 13:34:34 +0100 Subject: [PATCH 08/27] exclude rc versions --- .github/workflows/ci_client_runtime_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_client_runtime_test.yml b/.github/workflows/ci_client_runtime_test.yml index 2215ba79a..54381ae5d 100644 --- a/.github/workflows/ci_client_runtime_test.yml +++ b/.github/workflows/ci_client_runtime_test.yml @@ -39,11 +39,11 @@ jobs: BINARY_TAG=$(gh api graphql -f query=' query { repository(owner: "paritytech", name: "polkadot-sdk") { - releases(first: 10, orderBy: {field: CREATED_AT, direction: DESC}) { + releases(first: 20, orderBy: {field: CREATED_AT, direction: DESC}) { nodes { tagName } } } - }' --jq '.data.repository.releases.nodes[].tagName' | grep -E "^polkadot-stable[0-9]+" | sort -Vr | head -n 1) + }' --jq '.data.repository.releases.nodes[].tagName' | grep -E "^polkadot-stable[0-9]+" | grep -v "\-rc" | sort -Vr | head -n 1) echo "runtime_matrix=$RUNTIMES" >> $GITHUB_OUTPUT echo "binary_tag=$BINARY_TAG" >> $GITHUB_OUTPUT From 029a8c8f59486e3c6495e5de8ba233b160678bc2 Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Fri, 9 Jan 2026 13:47:02 +0100 Subject: [PATCH 09/27] optimize a bit --- .github/workflows/ci_client_runtime_test.yml | 90 ++++++++++++-------- 1 file changed, 55 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci_client_runtime_test.yml b/.github/workflows/ci_client_runtime_test.yml index 54381ae5d..4d51a80bf 100644 --- a/.github/workflows/ci_client_runtime_test.yml +++ b/.github/workflows/ci_client_runtime_test.yml @@ -8,92 +8,112 @@ on: env: BASE_IMAGE: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 RUST_LOG: "zombienet_orchestrator=debug,zombienet_provider=debug" - CARGO_TARGET_DIR: /tmp/target + CARGO_TARGET_DIR: ${{ github.workspace }}/target jobs: - prepare-matrix: + build-and-setup: runs-on: parity-default container: - image: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 + image: ${{ env.BASE_IMAGE }} outputs: runtime_matrix: ${{ steps.set-matrix.outputs.runtime_matrix }} binary_tag: ${{ steps.set-matrix.outputs.binary_tag }} steps: - - name: Fetch Versions + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Fetch and Sort Versions id: set-matrix shell: bash env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - # Fetch 3 latest runtime tags from fellows/runtimes (v2.0.4, v2.0.3, etc) + # 1. Fetch Runtimes (Latest 3) RUNTIMES=$(gh api graphql -f query=' query { repository(owner: "polkadot-fellows", name: "runtimes") { - releases(first: 3, orderBy: {field: CREATED_AT, direction: DESC}) { + releases(first: 20, orderBy: {field: CREATED_AT, direction: DESC}) { nodes { tagName } } } }' --jq '.data.repository.releases.nodes[].tagName' | grep -E "^v[0-9]+" | head -n 3 | jq -R . | jq -s -c .) - - # Fetch latest stable binary tag from paritytech/polkadot-sdk - BINARY_TAG=$(gh api graphql -f query=' + + # 2. Fetch Binaries (Version Sort, Exclude RCs) + RAW_BINARIES=$(gh api graphql -f query=' query { repository(owner: "paritytech", name: "polkadot-sdk") { releases(first: 20, orderBy: {field: CREATED_AT, direction: DESC}) { nodes { tagName } } } - }' --jq '.data.repository.releases.nodes[].tagName' | grep -E "^polkadot-stable[0-9]+" | grep -v "\-rc" | sort -Vr | head -n 1) + }' --jq '.data.repository.releases.nodes[].tagName') + + BINARY_TAG=$(echo "$RAW_BINARIES" | grep -E "^polkadot-stable[0-9]+" | grep -v "\-rc" | sort -Vr | head -n 1) echo "runtime_matrix=$RUNTIMES" >> $GITHUB_OUTPUT echo "binary_tag=$BINARY_TAG" >> $GITHUB_OUTPUT + - name: Download Binaries + shell: bash + run: | + mkdir -p ./shared-bin + BIN_TAG="${{ steps.set-matrix.outputs.binary_tag }}" + NODE_BINS=("polkadot" "polkadot-execute-worker" "polkadot-prepare-worker") + + for bin in "${NODE_BINS[@]}"; do + curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$BIN_TAG/$bin" -o "./shared-bin/$bin" + chmod +x "./shared-bin/$bin" + done + + - name: Compile Tests + run: | + cargo test --test client-runtime --no-run + + - name: Upload Workspace Artifacts + uses: actions/upload-artifact@v4 + with: + name: compiled-test-and-bins + path: | + ./shared-bin/ + ${{ env.CARGO_TARGET_DIR }}/debug/deps/client_runtime-* + ${{ env.CARGO_TARGET_DIR }}/debug/client-runtime + test-runtime: - needs: prepare-matrix + needs: build-and-setup runs-on: parity-default - name: "Test Runtime: ${{ matrix.runtime_tag }} with binary: ${{ needs.prepare-matrix.outputs.binary_tag }}" + name: "Test Runtime: ${{ matrix.runtime_tag }} with binary ${{ needs.build-and-setup.outputs.binary_tag }}" container: - image: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 + image: ${{ env.BASE_IMAGE }} strategy: fail-fast: false matrix: - runtime_tag: ${{ fromJson(needs.prepare-matrix.outputs.runtime_matrix) }} + runtime_tag: ${{ fromJson(needs.build-and-setup.outputs.runtime_matrix) }} steps: - name: Checkout Code uses: actions/checkout@v4 - - name: Download Latest Binaries - shell: bash - run: | - BIN_TAG="${{ needs.prepare-matrix.outputs.binary_tag }}" - mkdir -p ./bin - NODE_BINS=("polkadot" "polkadot-execute-worker" "polkadot-prepare-worker") - for bin in "${NODE_BINS[@]}"; do - echo "Downloading $bin @ $BIN_TAG" - curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$BIN_TAG/$bin" -o "./bin/$bin" - chmod +x "./bin/$bin" - done - echo "$PWD/bin" >> $GITHUB_PATH + - name: Download Workspace Artifacts + uses: actions/download-artifact@v4 + with: + name: compiled-test-and-bins + path: . - name: Download Specific Runtime env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | mkdir -p artifacts - TAG="${{ matrix.runtime_tag }}" - - echo "Downloading Runtimes for $TAG..." - - gh release download "$TAG" -R polkadot-fellows/runtimes \ + gh release download "${{ matrix.runtime_tag }}" -R polkadot-fellows/runtimes \ -p "polkadot_runtime-*.compact.compressed.wasm" \ --output artifacts/relay_runtime.wasm - - name: Run Compatibility Test + - name: Run Pre-compiled Test env: RELAY_RUNTIME_PATH: ${{ github.workspace }}/artifacts/relay_runtime.wasm ZOMBIE_PROVIDER: native - PATH: ${{ github.workspace }}/bin:${{ env.PATH }} + PATH: ${{ github.workspace }}/shared-bin:${{ env.PATH }} run: | - echo "Testing Binary ${{ needs.prepare-matrix.outputs.binary_tag }} against Runtime ${{ matrix.runtime_tag }}" - cargo test --test client-runtime -- --nocapture \ No newline at end of file + chmod +x ./shared-bin/* + TEST_BIN=$(find ./target/debug/ -maxdepth 1 -name "client-runtime" -type f -executable | head -n 1) + $TEST_BIN --nocapture \ No newline at end of file From 44ff30f5850a3a99bda6c9a3ac003528934db461 Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Fri, 9 Jan 2026 14:07:51 +0100 Subject: [PATCH 10/27] Revert "optimize a bit" --- .github/workflows/ci_client_runtime_test.yml | 90 ++++++++------------ 1 file changed, 35 insertions(+), 55 deletions(-) diff --git a/.github/workflows/ci_client_runtime_test.yml b/.github/workflows/ci_client_runtime_test.yml index 4d51a80bf..54381ae5d 100644 --- a/.github/workflows/ci_client_runtime_test.yml +++ b/.github/workflows/ci_client_runtime_test.yml @@ -8,112 +8,92 @@ on: env: BASE_IMAGE: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 RUST_LOG: "zombienet_orchestrator=debug,zombienet_provider=debug" - CARGO_TARGET_DIR: ${{ github.workspace }}/target + CARGO_TARGET_DIR: /tmp/target jobs: - build-and-setup: + prepare-matrix: runs-on: parity-default container: - image: ${{ env.BASE_IMAGE }} + image: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 outputs: runtime_matrix: ${{ steps.set-matrix.outputs.runtime_matrix }} binary_tag: ${{ steps.set-matrix.outputs.binary_tag }} steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - name: Fetch and Sort Versions + - name: Fetch Versions id: set-matrix shell: bash env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - # 1. Fetch Runtimes (Latest 3) + # Fetch 3 latest runtime tags from fellows/runtimes (v2.0.4, v2.0.3, etc) RUNTIMES=$(gh api graphql -f query=' query { repository(owner: "polkadot-fellows", name: "runtimes") { - releases(first: 20, orderBy: {field: CREATED_AT, direction: DESC}) { + releases(first: 3, orderBy: {field: CREATED_AT, direction: DESC}) { nodes { tagName } } } }' --jq '.data.repository.releases.nodes[].tagName' | grep -E "^v[0-9]+" | head -n 3 | jq -R . | jq -s -c .) - - # 2. Fetch Binaries (Version Sort, Exclude RCs) - RAW_BINARIES=$(gh api graphql -f query=' + + # Fetch latest stable binary tag from paritytech/polkadot-sdk + BINARY_TAG=$(gh api graphql -f query=' query { repository(owner: "paritytech", name: "polkadot-sdk") { releases(first: 20, orderBy: {field: CREATED_AT, direction: DESC}) { nodes { tagName } } } - }' --jq '.data.repository.releases.nodes[].tagName') - - BINARY_TAG=$(echo "$RAW_BINARIES" | grep -E "^polkadot-stable[0-9]+" | grep -v "\-rc" | sort -Vr | head -n 1) + }' --jq '.data.repository.releases.nodes[].tagName' | grep -E "^polkadot-stable[0-9]+" | grep -v "\-rc" | sort -Vr | head -n 1) echo "runtime_matrix=$RUNTIMES" >> $GITHUB_OUTPUT echo "binary_tag=$BINARY_TAG" >> $GITHUB_OUTPUT - - name: Download Binaries - shell: bash - run: | - mkdir -p ./shared-bin - BIN_TAG="${{ steps.set-matrix.outputs.binary_tag }}" - NODE_BINS=("polkadot" "polkadot-execute-worker" "polkadot-prepare-worker") - - for bin in "${NODE_BINS[@]}"; do - curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$BIN_TAG/$bin" -o "./shared-bin/$bin" - chmod +x "./shared-bin/$bin" - done - - - name: Compile Tests - run: | - cargo test --test client-runtime --no-run - - - name: Upload Workspace Artifacts - uses: actions/upload-artifact@v4 - with: - name: compiled-test-and-bins - path: | - ./shared-bin/ - ${{ env.CARGO_TARGET_DIR }}/debug/deps/client_runtime-* - ${{ env.CARGO_TARGET_DIR }}/debug/client-runtime - test-runtime: - needs: build-and-setup + needs: prepare-matrix runs-on: parity-default - name: "Test Runtime: ${{ matrix.runtime_tag }} with binary ${{ needs.build-and-setup.outputs.binary_tag }}" + name: "Test Runtime: ${{ matrix.runtime_tag }} with binary: ${{ needs.prepare-matrix.outputs.binary_tag }}" container: - image: ${{ env.BASE_IMAGE }} + image: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 strategy: fail-fast: false matrix: - runtime_tag: ${{ fromJson(needs.build-and-setup.outputs.runtime_matrix) }} + runtime_tag: ${{ fromJson(needs.prepare-matrix.outputs.runtime_matrix) }} steps: - name: Checkout Code uses: actions/checkout@v4 - - name: Download Workspace Artifacts - uses: actions/download-artifact@v4 - with: - name: compiled-test-and-bins - path: . + - name: Download Latest Binaries + shell: bash + run: | + BIN_TAG="${{ needs.prepare-matrix.outputs.binary_tag }}" + mkdir -p ./bin + NODE_BINS=("polkadot" "polkadot-execute-worker" "polkadot-prepare-worker") + for bin in "${NODE_BINS[@]}"; do + echo "Downloading $bin @ $BIN_TAG" + curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$BIN_TAG/$bin" -o "./bin/$bin" + chmod +x "./bin/$bin" + done + echo "$PWD/bin" >> $GITHUB_PATH - name: Download Specific Runtime env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | mkdir -p artifacts - gh release download "${{ matrix.runtime_tag }}" -R polkadot-fellows/runtimes \ + TAG="${{ matrix.runtime_tag }}" + + echo "Downloading Runtimes for $TAG..." + + gh release download "$TAG" -R polkadot-fellows/runtimes \ -p "polkadot_runtime-*.compact.compressed.wasm" \ --output artifacts/relay_runtime.wasm - - name: Run Pre-compiled Test + - name: Run Compatibility Test env: RELAY_RUNTIME_PATH: ${{ github.workspace }}/artifacts/relay_runtime.wasm ZOMBIE_PROVIDER: native - PATH: ${{ github.workspace }}/shared-bin:${{ env.PATH }} + PATH: ${{ github.workspace }}/bin:${{ env.PATH }} run: | - chmod +x ./shared-bin/* - TEST_BIN=$(find ./target/debug/ -maxdepth 1 -name "client-runtime" -type f -executable | head -n 1) - $TEST_BIN --nocapture \ No newline at end of file + echo "Testing Binary ${{ needs.prepare-matrix.outputs.binary_tag }} against Runtime ${{ matrix.runtime_tag }}" + cargo test --test client-runtime -- --nocapture \ No newline at end of file From b84526df4160ecf6f325ef2b52992412d0314b02 Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Fri, 9 Jan 2026 14:29:48 +0100 Subject: [PATCH 11/27] add runtime client action --- .github/workflows/ci_runtime_client_test.yml | 99 ++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 .github/workflows/ci_runtime_client_test.yml diff --git a/.github/workflows/ci_runtime_client_test.yml b/.github/workflows/ci_runtime_client_test.yml new file mode 100644 index 000000000..48c2770d8 --- /dev/null +++ b/.github/workflows/ci_runtime_client_test.yml @@ -0,0 +1,99 @@ +name: Zombienet Runtime-Client Compatibility Test + +on: + pull_request: + branches: [main] + workflow_dispatch: + +env: + BASE_IMAGE: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 + RUST_LOG: "zombienet_orchestrator=debug,zombienet_provider=debug" + CARGO_TARGET_DIR: /tmp/target + +jobs: + prepare-matrix: + runs-on: parity-default + container: + image: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 + outputs: + binary_matrix: ${{ steps.set-matrix.outputs.binary_matrix }} + runtime_tag: ${{ steps.set-matrix.outputs.runtime_tag }} + steps: + - name: Fetch Versions + id: set-matrix + shell: bash + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # 1. Fetch the single latest runtime tag from fellows/runtimes (e.g., v2.0.4) + RUNTIME_TAG=$(gh api graphql -f query=' + query { + repository(owner: "polkadot-fellows", name: "runtimes") { + releases(first: 5, orderBy: {field: CREATED_AT, direction: DESC}) { + nodes { tagName } + } + } + }' --jq '.data.repository.releases.nodes[].tagName' | grep -E "^v[0-9]+" | head -n 1) + + # 2. Fetch 3 latest stable binary tags from paritytech/polkadot-sdk + BINARIES=$(gh api graphql -f query=' + query { + repository(owner: "paritytech", name: "polkadot-sdk") { + releases(first: 20, orderBy: {field: CREATED_AT, direction: DESC}) { + nodes { tagName } + } + } + }' --jq '.data.repository.releases.nodes[].tagName' | grep -E "^polkadot-stable[0-9]+" | grep -v "\-rc" | sort -Vr | head -n 3 | jq -R . | jq -s -c .) + + echo "runtime_tag=$RUNTIME_TAG" >> $GITHUB_OUTPUT + echo "binary_matrix=$BINARIES" >> $GITHUB_OUTPUT + + test-binary: + needs: prepare-matrix + runs-on: parity-default + name: "Test Binary: ${{ matrix.binary_tag }} with runtime: ${{ needs.prepare-matrix.outputs.runtime_tag }}" + container: + image: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 + strategy: + fail-fast: false + matrix: + binary_tag: ${{ fromJson(needs.prepare-matrix.outputs.binary_matrix) }} + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Download Specific Binary + shell: bash + run: | + BIN_TAG="${{ matrix.binary_tag }}" + mkdir -p ./bin + NODE_BINS=("polkadot" "polkadot-execute-worker" "polkadot-prepare-worker") + for bin in "${NODE_BINS[@]}"; do + echo "Downloading $bin @ $BIN_TAG" + curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$BIN_TAG/$bin" -o "./bin/$bin" + chmod +x "./bin/$bin" + done + echo "$PWD/bin" >> $GITHUB_PATH + + - name: Download Latest Runtime + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + mkdir -p artifacts + TAG="${{ needs.prepare-matrix.outputs.runtime_tag }}" + + echo "Downloading Runtime $TAG..." + + gh release download "$TAG" -R polkadot-fellows/runtimes \ + -p "polkadot_runtime-*.compact.compressed.wasm" \ + --output artifacts/relay_runtime.wasm + + - name: Run Compatibility Test + env: + RELAY_RUNTIME_PATH: ${{ github.workspace }}/artifacts/relay_runtime.wasm + ZOMBIE_PROVIDER: native + PATH: ${{ github.workspace }}/bin:${{ env.PATH }} + run: | + echo "Testing Binary ${{ matrix.binary_tag }} against Runtime ${{ needs.prepare-matrix.outputs.runtime_tag }}" + cargo test --test client-runtime -- --nocapture \ No newline at end of file From cd35a7229eda910a845b5e43068c0807f22d858f Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Fri, 9 Jan 2026 17:43:21 +0100 Subject: [PATCH 12/27] add mixed test --- .github/workflows/ci_runtime_client_test.yml | 50 +++++++++++++++++++- crates/sdk/tests/client-runtime.rs | 38 +++++++++++---- 2 files changed, 78 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci_runtime_client_test.yml b/.github/workflows/ci_runtime_client_test.yml index 48c2770d8..b8dbbcb7d 100644 --- a/.github/workflows/ci_runtime_client_test.yml +++ b/.github/workflows/ci_runtime_client_test.yml @@ -96,4 +96,52 @@ jobs: PATH: ${{ github.workspace }}/bin:${{ env.PATH }} run: | echo "Testing Binary ${{ matrix.binary_tag }} against Runtime ${{ needs.prepare-matrix.outputs.runtime_tag }}" - cargo test --test client-runtime -- --nocapture \ No newline at end of file + cargo test --test client-runtime -- --nocapture + test-mixed-binaries: + needs: prepare-matrix + runs-on: parity-default + name: "Mixed binaries compatibility test" + container: + image: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 + steps: + - name: Checkout Code + uses: actions/checkout@v4 + - name: Download Binaries + shell: bash + run: | + BIN_TAGS=($(echo '${{ needs.prepare-matrix.outputs.binary_matrix }}' | jq -r '.[]')) + mkdir -p ./mixed-bins + for i in "${!BIN_TAGS[@]}"; do + TAG="${BIN_TAGS[$i]}" + echo "Downloading Polkadot @ $TAG as polkadot_$i" + curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot" -o "./mixed-bins/polkadot_$i" + chmod +x "./mixed-bins/polkadot_$i" + + # Download workers for the primary/newest binary + if [ $i -eq 0 ]; then + curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot-execute-worker" -o "./mixed-bins/polkadot-execute-worker" + curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot-prepare-worker" -o "./mixed-bins/polkadot-prepare-worker" + chmod +x ./mixed-bins/polkadot-*-worker + fi + done + echo "$PWD/mixed-bins" >> $GITHUB_PATH + - name: Download Latest Runtime + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + mkdir -p artifacts + gh release download "${{ needs.prepare-matrix.outputs.runtime_tag }}" \ + -R polkadot-fellows/runtimes \ + -p "polkadot_runtime-*.compact.compressed.wasm" \ + --output artifacts/relay_runtime.wasm + + - name: Run Mixed Version Test + env: + RELAY_RUNTIME_PATH: ${{ github.workspace }}/artifacts/relay_runtime.wasm + POLKADOT_BIN_LATEST: ${{ github.workspace }}/mixed-bins/polkadot_0 + POLKADOT_BIN_LATEST-1: ${{ github.workspace }}/mixed-bins/polkadot_1 + POLKADOT_BIN_LATEST-2: ${{ github.workspace }}/mixed-bins/polkadot_2 + ZOMBIE_PROVIDER: native + run: | + echo "Running mixed network with 3 versions of Polkadot" + cargo test --test mixed-version-network -- --nocapture \ No newline at end of file diff --git a/crates/sdk/tests/client-runtime.rs b/crates/sdk/tests/client-runtime.rs index ab46816d1..51499b901 100644 --- a/crates/sdk/tests/client-runtime.rs +++ b/crates/sdk/tests/client-runtime.rs @@ -6,6 +6,9 @@ use zombienet_sdk::NetworkConfigExt; fn small_network() -> NetworkConfig { let relay_runtime_path = PathBuf::from(env::var("RELAY_RUNTIME_PATH").unwrap()); + let polkadot_bin_latest = env::var("POLKADOT_BIN_LATEST").unwrap_or("polkadot".into()); + let polkadot_bin_latest_1 = env::var("POLKADOT_BIN_LATEST-1").unwrap_or("polkadot".into()); + let polkadot_bin_latest_2 = env::var("POLKADOT_BIN_LATEST-2").unwrap_or("polkadot".into()); NetworkConfigBuilder::new() .with_relaychain(|r| { @@ -13,8 +16,18 @@ fn small_network() -> NetworkConfig { .with_default_command("polkadot") .with_default_args(vec!["-lparachain=debug,runtime=debug".into()]) .with_chain_spec_runtime(relay_runtime_path, None) - .with_validator(|node| node.with_name("alice")) - .with_validator(|node| node.with_name("bob")) + .with_validator(|node| { + node.with_name("alice") + .with_command(polkadot_bin_latest.as_ref()) + }) + .with_validator(|node| { + node.with_name("bob") + .with_command(polkadot_bin_latest_1.as_ref()) + }) + .with_validator(|node| { + node.with_name("charlie") + .with_command(polkadot_bin_latest_2.as_ref()) + }) }) .build() .unwrap() @@ -29,14 +42,21 @@ async fn ci_native_smoke_should_works() { let alice = network.get_node("alice").unwrap(); let alice_client: OnlineClient = alice.wait_client().await.unwrap(); - let mut blocks = alice_client - .blocks() - .subscribe_finalized() - .await - .unwrap() - .take(10); + let bob = network.get_node("bob").unwrap(); + let bob_client: OnlineClient = bob.wait_client().await.unwrap(); + + let charlie = network.get_node("charlie").unwrap(); + let charlie_client: OnlineClient = charlie.wait_client().await.unwrap(); + + wait_n_blocks(&alice_client, 5, "alice").await; + wait_n_blocks(&bob_client, 5, "bob").await; + wait_n_blocks(&charlie_client, 5, "charlie").await; +} + +async fn wait_n_blocks(client: &OnlineClient, n: usize, name: &str) { + let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(n); while let Some(block) = blocks.next().await { - println!("Block #{}", block.unwrap().header().number); + println!("{name} Block #{}", block.unwrap().header().number); } } From 9c9bbf2d91a51a443b336b76bcb836c67f765afd Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Fri, 9 Jan 2026 17:44:26 +0100 Subject: [PATCH 13/27] clippy --- crates/orchestrator/src/network/node.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/orchestrator/src/network/node.rs b/crates/orchestrator/src/network/node.rs index fd8f0e8e9..e16eac6ca 100644 --- a/crates/orchestrator/src/network/node.rs +++ b/crates/orchestrator/src/network/node.rs @@ -628,7 +628,7 @@ impl NetworkNode { let resolved_metric_name = if metric_name.contains("_bucket") { metric_name.to_string() } else { - format!("{}_bucket", metric_name) + format!("{metric_name}_bucket") }; // First pass: collect all matching metrics with their label counts From 94ce28038bdab00d630d9461b46307b2d332f1b5 Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Fri, 9 Jan 2026 17:52:10 +0100 Subject: [PATCH 14/27] fix name --- .github/workflows/ci_runtime_client_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_runtime_client_test.yml b/.github/workflows/ci_runtime_client_test.yml index b8dbbcb7d..a2a7743d3 100644 --- a/.github/workflows/ci_runtime_client_test.yml +++ b/.github/workflows/ci_runtime_client_test.yml @@ -143,5 +143,5 @@ jobs: POLKADOT_BIN_LATEST-2: ${{ github.workspace }}/mixed-bins/polkadot_2 ZOMBIE_PROVIDER: native run: | - echo "Running mixed network with 3 versions of Polkadot" - cargo test --test mixed-version-network -- --nocapture \ No newline at end of file + echo "Running mixed network with 3 latest client versions" + cargo test --test client-runtime -- --nocapture \ No newline at end of file From 38421d386c3470c18ea1773dc3ee8bbde30c0483 Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Fri, 9 Jan 2026 18:05:09 +0100 Subject: [PATCH 15/27] fix path --- .github/workflows/ci_runtime_client_test.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_runtime_client_test.yml b/.github/workflows/ci_runtime_client_test.yml index a2a7743d3..daf8079a7 100644 --- a/.github/workflows/ci_runtime_client_test.yml +++ b/.github/workflows/ci_runtime_client_test.yml @@ -138,10 +138,11 @@ jobs: - name: Run Mixed Version Test env: RELAY_RUNTIME_PATH: ${{ github.workspace }}/artifacts/relay_runtime.wasm - POLKADOT_BIN_LATEST: ${{ github.workspace }}/mixed-bins/polkadot_0 - POLKADOT_BIN_LATEST-1: ${{ github.workspace }}/mixed-bins/polkadot_1 - POLKADOT_BIN_LATEST-2: ${{ github.workspace }}/mixed-bins/polkadot_2 + POLKADOT_BIN_LATEST: polkadot_0 + POLKADOT_BIN_LATEST-1: polkadot_1 + POLKADOT_BIN_LATEST-2: polkadot_2 ZOMBIE_PROVIDER: native + PATH: ${{ github.workspace }}/mixed_bins:${{ env.PATH }} run: | echo "Running mixed network with 3 latest client versions" cargo test --test client-runtime -- --nocapture \ No newline at end of file From 6871d1b37105ea85df761e1e1925cfcbffb0440f Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Fri, 9 Jan 2026 18:18:20 +0100 Subject: [PATCH 16/27] binaries in a single test --- .github/workflows/ci_runtime_client_test.yml | 70 +++++--------------- 1 file changed, 15 insertions(+), 55 deletions(-) diff --git a/.github/workflows/ci_runtime_client_test.yml b/.github/workflows/ci_runtime_client_test.yml index daf8079a7..7493aaa3c 100644 --- a/.github/workflows/ci_runtime_client_test.yml +++ b/.github/workflows/ci_runtime_client_test.yml @@ -48,55 +48,6 @@ jobs: echo "runtime_tag=$RUNTIME_TAG" >> $GITHUB_OUTPUT echo "binary_matrix=$BINARIES" >> $GITHUB_OUTPUT - test-binary: - needs: prepare-matrix - runs-on: parity-default - name: "Test Binary: ${{ matrix.binary_tag }} with runtime: ${{ needs.prepare-matrix.outputs.runtime_tag }}" - container: - image: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 - strategy: - fail-fast: false - matrix: - binary_tag: ${{ fromJson(needs.prepare-matrix.outputs.binary_matrix) }} - - steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - name: Download Specific Binary - shell: bash - run: | - BIN_TAG="${{ matrix.binary_tag }}" - mkdir -p ./bin - NODE_BINS=("polkadot" "polkadot-execute-worker" "polkadot-prepare-worker") - for bin in "${NODE_BINS[@]}"; do - echo "Downloading $bin @ $BIN_TAG" - curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$BIN_TAG/$bin" -o "./bin/$bin" - chmod +x "./bin/$bin" - done - echo "$PWD/bin" >> $GITHUB_PATH - - - name: Download Latest Runtime - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - mkdir -p artifacts - TAG="${{ needs.prepare-matrix.outputs.runtime_tag }}" - - echo "Downloading Runtime $TAG..." - - gh release download "$TAG" -R polkadot-fellows/runtimes \ - -p "polkadot_runtime-*.compact.compressed.wasm" \ - --output artifacts/relay_runtime.wasm - - - name: Run Compatibility Test - env: - RELAY_RUNTIME_PATH: ${{ github.workspace }}/artifacts/relay_runtime.wasm - ZOMBIE_PROVIDER: native - PATH: ${{ github.workspace }}/bin:${{ env.PATH }} - run: | - echo "Testing Binary ${{ matrix.binary_tag }} against Runtime ${{ needs.prepare-matrix.outputs.runtime_tag }}" - cargo test --test client-runtime -- --nocapture test-mixed-binaries: needs: prepare-matrix runs-on: parity-default @@ -113,9 +64,10 @@ jobs: mkdir -p ./mixed-bins for i in "${!BIN_TAGS[@]}"; do TAG="${BIN_TAGS[$i]}" - echo "Downloading Polkadot @ $TAG as polkadot_$i" - curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot" -o "./mixed-bins/polkadot_$i" - chmod +x "./mixed-bins/polkadot_$i" + FILENAME="polkadot-${TAG}" + echo "Downloading Polkadot @ $TAG as $FILENAME" + curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot" -o "./mixed-bins/$FILENAME" + chmod +x "./mixed-bins/$FILENAME" # Download workers for the primary/newest binary if [ $i -eq 0 ]; then @@ -138,11 +90,19 @@ jobs: - name: Run Mixed Version Test env: RELAY_RUNTIME_PATH: ${{ github.workspace }}/artifacts/relay_runtime.wasm - POLKADOT_BIN_LATEST: polkadot_0 - POLKADOT_BIN_LATEST-1: polkadot_1 - POLKADOT_BIN_LATEST-2: polkadot_2 ZOMBIE_PROVIDER: native PATH: ${{ github.workspace }}/mixed_bins:${{ env.PATH }} run: | + BIN_TAGS=($(echo '${{ needs.prepare-matrix.outputs.binary_matrix }}' | jq -r '.[]')) + + export POLKADOT_BIN_LATEST="polkadot-${BIN_TAGS[0]}" + export POLKADOT_BIN_LATEST-1="polkadot-${BIN_TAGS[1]}" + export POLKADOT_BIN_LATEST-2="polkadot-${BIN_TAGS[2]}" + + echo "Running mixed network test with:" + echo "Alice (Latest) : $POLKADOT_BIN_LATEST" + echo "Bob (Latest-1) : $POLKADOT_BIN_LATEST-1" + echo "Charlie (Latest-2): $POLKADOT_BIN_LATEST-2" + echo "Running mixed network with 3 latest client versions" cargo test --test client-runtime -- --nocapture \ No newline at end of file From ce2eb9afe47d4bde45e38f9d25dcdb1f6faced5f Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Fri, 9 Jan 2026 18:29:03 +0100 Subject: [PATCH 17/27] shell fix --- .github/workflows/ci_runtime_client_test.yml | 9 +++++---- crates/sdk/tests/client-runtime.rs | 5 ++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci_runtime_client_test.yml b/.github/workflows/ci_runtime_client_test.yml index 7493aaa3c..32456398b 100644 --- a/.github/workflows/ci_runtime_client_test.yml +++ b/.github/workflows/ci_runtime_client_test.yml @@ -88,6 +88,7 @@ jobs: --output artifacts/relay_runtime.wasm - name: Run Mixed Version Test + shell: bash env: RELAY_RUNTIME_PATH: ${{ github.workspace }}/artifacts/relay_runtime.wasm ZOMBIE_PROVIDER: native @@ -96,13 +97,13 @@ jobs: BIN_TAGS=($(echo '${{ needs.prepare-matrix.outputs.binary_matrix }}' | jq -r '.[]')) export POLKADOT_BIN_LATEST="polkadot-${BIN_TAGS[0]}" - export POLKADOT_BIN_LATEST-1="polkadot-${BIN_TAGS[1]}" - export POLKADOT_BIN_LATEST-2="polkadot-${BIN_TAGS[2]}" + export POLKADOT_BIN_LATEST_1="polkadot-${BIN_TAGS[1]}" + export POLKADOT_BIN_LATEST_2="polkadot-${BIN_TAGS[2]}" echo "Running mixed network test with:" echo "Alice (Latest) : $POLKADOT_BIN_LATEST" - echo "Bob (Latest-1) : $POLKADOT_BIN_LATEST-1" - echo "Charlie (Latest-2): $POLKADOT_BIN_LATEST-2" + echo "Bob (Latest-1) : $POLKADOT_BIN_LATEST_1" + echo "Charlie (Latest-2): $POLKADOT_BIN_LATEST_2" echo "Running mixed network with 3 latest client versions" cargo test --test client-runtime -- --nocapture \ No newline at end of file diff --git a/crates/sdk/tests/client-runtime.rs b/crates/sdk/tests/client-runtime.rs index 51499b901..d5598d6cd 100644 --- a/crates/sdk/tests/client-runtime.rs +++ b/crates/sdk/tests/client-runtime.rs @@ -7,13 +7,12 @@ use zombienet_sdk::NetworkConfigExt; fn small_network() -> NetworkConfig { let relay_runtime_path = PathBuf::from(env::var("RELAY_RUNTIME_PATH").unwrap()); let polkadot_bin_latest = env::var("POLKADOT_BIN_LATEST").unwrap_or("polkadot".into()); - let polkadot_bin_latest_1 = env::var("POLKADOT_BIN_LATEST-1").unwrap_or("polkadot".into()); - let polkadot_bin_latest_2 = env::var("POLKADOT_BIN_LATEST-2").unwrap_or("polkadot".into()); + let polkadot_bin_latest_1 = env::var("POLKADOT_BIN_LATEST_1").unwrap_or("polkadot".into()); + let polkadot_bin_latest_2 = env::var("POLKADOT_BIN_LATEST_2").unwrap_or("polkadot".into()); NetworkConfigBuilder::new() .with_relaychain(|r| { r.with_chain("polkadot-local") - .with_default_command("polkadot") .with_default_args(vec!["-lparachain=debug,runtime=debug".into()]) .with_chain_spec_runtime(relay_runtime_path, None) .with_validator(|node| { From f1746c14ef76b91cae4b0c61694f4e55828f4220 Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Mon, 12 Jan 2026 14:28:19 +0100 Subject: [PATCH 18/27] fix filename --- .github/workflows/ci_runtime_client_test.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci_runtime_client_test.yml b/.github/workflows/ci_runtime_client_test.yml index 32456398b..c942123bc 100644 --- a/.github/workflows/ci_runtime_client_test.yml +++ b/.github/workflows/ci_runtime_client_test.yml @@ -61,22 +61,22 @@ jobs: shell: bash run: | BIN_TAGS=($(echo '${{ needs.prepare-matrix.outputs.binary_matrix }}' | jq -r '.[]')) - mkdir -p ./mixed-bins + mkdir -p ./bin for i in "${!BIN_TAGS[@]}"; do TAG="${BIN_TAGS[$i]}" FILENAME="polkadot-${TAG}" echo "Downloading Polkadot @ $TAG as $FILENAME" - curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot" -o "./mixed-bins/$FILENAME" - chmod +x "./mixed-bins/$FILENAME" + curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot" -o "./bin/$FILENAME" + chmod +x "./bin/$FILENAME" # Download workers for the primary/newest binary if [ $i -eq 0 ]; then - curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot-execute-worker" -o "./mixed-bins/polkadot-execute-worker" - curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot-prepare-worker" -o "./mixed-bins/polkadot-prepare-worker" - chmod +x ./mixed-bins/polkadot-*-worker + curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot-execute-worker" -o "./bin/polkadot-execute-worker" + curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot-prepare-worker" -o "./bin/polkadot-prepare-worker" + chmod +x ./bin/polkadot-*-worker fi done - echo "$PWD/mixed-bins" >> $GITHUB_PATH + echo "$PWD/bin" >> $GITHUB_PATH - name: Download Latest Runtime env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -92,7 +92,7 @@ jobs: env: RELAY_RUNTIME_PATH: ${{ github.workspace }}/artifacts/relay_runtime.wasm ZOMBIE_PROVIDER: native - PATH: ${{ github.workspace }}/mixed_bins:${{ env.PATH }} + PATH: ${{ github.workspace }}/bin:${{ env.PATH }} run: | BIN_TAGS=($(echo '${{ needs.prepare-matrix.outputs.binary_matrix }}' | jq -r '.[]')) From a341563be767e2bf73a07915b3eb16a844d8930a Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Mon, 12 Jan 2026 14:31:48 +0100 Subject: [PATCH 19/27] get all workers --- .github/workflows/ci_runtime_client_test.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci_runtime_client_test.yml b/.github/workflows/ci_runtime_client_test.yml index c942123bc..27c97a3ab 100644 --- a/.github/workflows/ci_runtime_client_test.yml +++ b/.github/workflows/ci_runtime_client_test.yml @@ -69,12 +69,11 @@ jobs: curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot" -o "./bin/$FILENAME" chmod +x "./bin/$FILENAME" - # Download workers for the primary/newest binary - if [ $i -eq 0 ]; then - curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot-execute-worker" -o "./bin/polkadot-execute-worker" - curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot-prepare-worker" -o "./bin/polkadot-prepare-worker" - chmod +x ./bin/polkadot-*-worker - fi + echo "Downloading workers for $TAG" + curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot-execute-worker" -o "./bin/polkadot-execute-worker-${TAG}" + curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot-prepare-worker" -o "./bin/polkadot-prepare-worker-${TAG}" + chmod +x "./bin/polkadot-execute-worker-${TAG}" + chmod +x "./bin/polkadot-prepare-worker-${TAG}" done echo "$PWD/bin" >> $GITHUB_PATH - name: Download Latest Runtime From 1c07771a11ebd0a665efdb2a246554ebf4d95c87 Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Mon, 12 Jan 2026 14:51:59 +0100 Subject: [PATCH 20/27] try with workers --- .github/workflows/ci_runtime_client_test.yml | 13 +++++-- crates/sdk/tests/client-runtime.rs | 40 ++++++++++++++++---- 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci_runtime_client_test.yml b/.github/workflows/ci_runtime_client_test.yml index 27c97a3ab..87cee35f4 100644 --- a/.github/workflows/ci_runtime_client_test.yml +++ b/.github/workflows/ci_runtime_client_test.yml @@ -69,11 +69,13 @@ jobs: curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot" -o "./bin/$FILENAME" chmod +x "./bin/$FILENAME" + # Create separate worker directory for this version echo "Downloading workers for $TAG" - curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot-execute-worker" -o "./bin/polkadot-execute-worker-${TAG}" - curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot-prepare-worker" -o "./bin/polkadot-prepare-worker-${TAG}" - chmod +x "./bin/polkadot-execute-worker-${TAG}" - chmod +x "./bin/polkadot-prepare-worker-${TAG}" + mkdir -p "./bin/workers-${TAG}" + curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot-execute-worker" -o "./bin/workers-${TAG}/polkadot-execute-worker" + curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot-prepare-worker" -o "./bin/workers-${TAG}/polkadot-prepare-worker" + chmod +x "./bin/workers-${TAG}/polkadot-execute-worker" + chmod +x "./bin/workers-${TAG}/polkadot-prepare-worker" done echo "$PWD/bin" >> $GITHUB_PATH - name: Download Latest Runtime @@ -98,6 +100,9 @@ jobs: export POLKADOT_BIN_LATEST="polkadot-${BIN_TAGS[0]}" export POLKADOT_BIN_LATEST_1="polkadot-${BIN_TAGS[1]}" export POLKADOT_BIN_LATEST_2="polkadot-${BIN_TAGS[2]}" + export WORKERS_PATH_LATEST="${{ github.workspace }}/bin/workers-${BIN_TAGS[0]}" + export WORKERS_PATH_LATEST_1="${{ github.workspace }}/bin/workers-${BIN_TAGS[1]}" + export WORKERS_PATH_LATEST_2="${{ github.workspace }}/bin/workers-${BIN_TAGS[2]}" echo "Running mixed network test with:" echo "Alice (Latest) : $POLKADOT_BIN_LATEST" diff --git a/crates/sdk/tests/client-runtime.rs b/crates/sdk/tests/client-runtime.rs index d5598d6cd..f168db32a 100644 --- a/crates/sdk/tests/client-runtime.rs +++ b/crates/sdk/tests/client-runtime.rs @@ -10,23 +10,47 @@ fn small_network() -> NetworkConfig { let polkadot_bin_latest_1 = env::var("POLKADOT_BIN_LATEST_1").unwrap_or("polkadot".into()); let polkadot_bin_latest_2 = env::var("POLKADOT_BIN_LATEST_2").unwrap_or("polkadot".into()); + let workers_path_latest = env::var("WORKERS_PATH_LATEST").ok(); + let workers_path_latest_1 = env::var("WORKERS_PATH_LATEST_1").ok(); + let workers_path_latest_2 = env::var("WORKERS_PATH_LATEST_2").ok(); + NetworkConfigBuilder::new() .with_relaychain(|r| { - r.with_chain("polkadot-local") + let relaychain = r + .with_chain("polkadot-local") .with_default_args(vec!["-lparachain=debug,runtime=debug".into()]) .with_chain_spec_runtime(relay_runtime_path, None) .with_validator(|node| { - node.with_name("alice") - .with_command(polkadot_bin_latest.as_ref()) + let mut alice = node + .with_name("alice") + .with_command(polkadot_bin_latest.as_ref()); + if let Some(workers_path) = &workers_path_latest { + alice = + alice.with_args(vec![("--workers-path", workers_path.as_str()).into()]); + } + alice }) .with_validator(|node| { - node.with_name("bob") - .with_command(polkadot_bin_latest_1.as_ref()) + let mut bob = node + .with_name("bob") + .with_command(polkadot_bin_latest_1.as_ref()); + if let Some(workers_path) = &workers_path_latest_1 { + bob = bob.with_args(vec![("--workers-path", workers_path.as_str()).into()]); + } + bob }) .with_validator(|node| { - node.with_name("charlie") - .with_command(polkadot_bin_latest_2.as_ref()) - }) + let mut charlie = node + .with_name("charlie") + .with_command(polkadot_bin_latest_2.as_ref()); + if let Some(workers_path) = &workers_path_latest_2 { + charlie = + charlie + .with_args(vec![("--workers-path", workers_path.as_str()).into()]); + } + charlie + }); + relaychain }) .build() .unwrap() From 8d7b38e2ddce1603f5db5a044df05a11194d2ae1 Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Mon, 12 Jan 2026 16:30:45 +0100 Subject: [PATCH 21/27] debug --- .github/workflows/ci_runtime_client_test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci_runtime_client_test.yml b/.github/workflows/ci_runtime_client_test.yml index 87cee35f4..736b691eb 100644 --- a/.github/workflows/ci_runtime_client_test.yml +++ b/.github/workflows/ci_runtime_client_test.yml @@ -104,6 +104,11 @@ jobs: export WORKERS_PATH_LATEST_1="${{ github.workspace }}/bin/workers-${BIN_TAGS[1]}" export WORKERS_PATH_LATEST_2="${{ github.workspace }}/bin/workers-${BIN_TAGS[2]}" + ls "${{ github.workspace }}/bin/" + ls ${WORKERS_PATH_LATEST} + ls ${WORKERS_PATH_LATEST_1} + ls ${WORKERS_PATH_LATEST_2} + echo "Running mixed network test with:" echo "Alice (Latest) : $POLKADOT_BIN_LATEST" echo "Bob (Latest-1) : $POLKADOT_BIN_LATEST_1" From 463f87b4040997b682123c39dc30b802e8aa8035 Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Mon, 12 Jan 2026 16:40:19 +0100 Subject: [PATCH 22/27] debug --- .github/workflows/ci_runtime_client_test.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci_runtime_client_test.yml b/.github/workflows/ci_runtime_client_test.yml index 736b691eb..747d077da 100644 --- a/.github/workflows/ci_runtime_client_test.yml +++ b/.github/workflows/ci_runtime_client_test.yml @@ -76,6 +76,8 @@ jobs: curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot-prepare-worker" -o "./bin/workers-${TAG}/polkadot-prepare-worker" chmod +x "./bin/workers-${TAG}/polkadot-execute-worker" chmod +x "./bin/workers-${TAG}/polkadot-prepare-worker" + + ls "./bin/workers-${TAG}" done echo "$PWD/bin" >> $GITHUB_PATH - name: Download Latest Runtime @@ -104,11 +106,6 @@ jobs: export WORKERS_PATH_LATEST_1="${{ github.workspace }}/bin/workers-${BIN_TAGS[1]}" export WORKERS_PATH_LATEST_2="${{ github.workspace }}/bin/workers-${BIN_TAGS[2]}" - ls "${{ github.workspace }}/bin/" - ls ${WORKERS_PATH_LATEST} - ls ${WORKERS_PATH_LATEST_1} - ls ${WORKERS_PATH_LATEST_2} - echo "Running mixed network test with:" echo "Alice (Latest) : $POLKADOT_BIN_LATEST" echo "Bob (Latest-1) : $POLKADOT_BIN_LATEST_1" From ab472ec508b2103ca106259ddc412ac373b9255e Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Mon, 12 Jan 2026 16:50:31 +0100 Subject: [PATCH 23/27] debug --- .github/workflows/ci_runtime_client_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_runtime_client_test.yml b/.github/workflows/ci_runtime_client_test.yml index 747d077da..7a28c92b8 100644 --- a/.github/workflows/ci_runtime_client_test.yml +++ b/.github/workflows/ci_runtime_client_test.yml @@ -77,7 +77,7 @@ jobs: chmod +x "./bin/workers-${TAG}/polkadot-execute-worker" chmod +x "./bin/workers-${TAG}/polkadot-prepare-worker" - ls "./bin/workers-${TAG}" + echo "$(ls bin/workers-${TAG})" done echo "$PWD/bin" >> $GITHUB_PATH - name: Download Latest Runtime From 114037015d68a3e8c0bd88ea31819692b20c3ee9 Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Mon, 12 Jan 2026 17:07:44 +0100 Subject: [PATCH 24/27] better download --- .github/workflows/ci_runtime_client_test.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci_runtime_client_test.yml b/.github/workflows/ci_runtime_client_test.yml index 7a28c92b8..9c33047da 100644 --- a/.github/workflows/ci_runtime_client_test.yml +++ b/.github/workflows/ci_runtime_client_test.yml @@ -66,18 +66,18 @@ jobs: TAG="${BIN_TAGS[$i]}" FILENAME="polkadot-${TAG}" echo "Downloading Polkadot @ $TAG as $FILENAME" - curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot" -o "./bin/$FILENAME" + curl -fL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot" -o "./bin/$FILENAME" chmod +x "./bin/$FILENAME" - # Create separate worker directory for this version echo "Downloading workers for $TAG" mkdir -p "./bin/workers-${TAG}" - curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot-execute-worker" -o "./bin/workers-${TAG}/polkadot-execute-worker" - curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/polkadot-prepare-worker" -o "./bin/workers-${TAG}/polkadot-prepare-worker" - chmod +x "./bin/workers-${TAG}/polkadot-execute-worker" - chmod +x "./bin/workers-${TAG}/polkadot-prepare-worker" - - echo "$(ls bin/workers-${TAG})" + for worker in polkadot-execute-worker polkadot-prepare-worker; do + url="https://github.com/paritytech/polkadot-sdk/releases/download/$TAG/$worker" + echo "Downloading $worker" + curl -fL "$url" -o "./bin/workers-${TAG}/$worker" + chmod +x "./bin/workers-${TAG}/$worker" + done + ls -lh "./bin/workers-${TAG}" done echo "$PWD/bin" >> $GITHUB_PATH - name: Download Latest Runtime From 3d87f230ec6d2979aef6f821e73e09c565894f98 Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Mon, 12 Jan 2026 17:45:49 +0100 Subject: [PATCH 25/27] adjust workers path --- .github/workflows/ci_runtime_client_test.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_runtime_client_test.yml b/.github/workflows/ci_runtime_client_test.yml index 9c33047da..6d2e3fa21 100644 --- a/.github/workflows/ci_runtime_client_test.yml +++ b/.github/workflows/ci_runtime_client_test.yml @@ -94,6 +94,7 @@ jobs: shell: bash env: RELAY_RUNTIME_PATH: ${{ github.workspace }}/artifacts/relay_runtime.wasm + WORKERS_BASE_PATH: ${{ github.workspace }}/bin ZOMBIE_PROVIDER: native PATH: ${{ github.workspace }}/bin:${{ env.PATH }} run: | @@ -102,9 +103,9 @@ jobs: export POLKADOT_BIN_LATEST="polkadot-${BIN_TAGS[0]}" export POLKADOT_BIN_LATEST_1="polkadot-${BIN_TAGS[1]}" export POLKADOT_BIN_LATEST_2="polkadot-${BIN_TAGS[2]}" - export WORKERS_PATH_LATEST="${{ github.workspace }}/bin/workers-${BIN_TAGS[0]}" - export WORKERS_PATH_LATEST_1="${{ github.workspace }}/bin/workers-${BIN_TAGS[1]}" - export WORKERS_PATH_LATEST_2="${{ github.workspace }}/bin/workers-${BIN_TAGS[2]}" + export WORKERS_PATH_LATEST="$WORKERS_BASE_PATH/workers-${BIN_TAGS[0]}" + export WORKERS_PATH_LATEST_1="$WORKERS_BASE_PATH/workers-${BIN_TAGS[1]}" + export WORKERS_PATH_LATEST_2="$WORKERS_BASE_PATH/workers-${BIN_TAGS[2]}" echo "Running mixed network test with:" echo "Alice (Latest) : $POLKADOT_BIN_LATEST" From c75b8c36b9574dda21726133622f7731cf9139cd Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Tue, 13 Jan 2026 15:08:02 +0100 Subject: [PATCH 26/27] change to manual trigger --- .github/workflows/ci_client_runtime_test.yml | 60 +++++++++++++------- .github/workflows/ci_runtime_client_test.yml | 60 +++++++++++++------- 2 files changed, 82 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci_client_runtime_test.yml b/.github/workflows/ci_client_runtime_test.yml index 54381ae5d..72ff960b9 100644 --- a/.github/workflows/ci_client_runtime_test.yml +++ b/.github/workflows/ci_client_runtime_test.yml @@ -1,9 +1,16 @@ name: Zombienet Client-Runtime Compatibility Test on: - pull_request: - branches: [main] workflow_dispatch: + inputs: + runtime_tags: + description: 'Comma-separated list of 3 runtime version tags (e.g., v2.0.4,v2.0.3,v2.0.2). Leave empty for auto-discovery of 3 latest.' + required: false + type: string + binary_tag: + description: 'Client binary tag (e.g., polkadot-stable2503). Leave empty for auto-discovery of latest.' + required: false + type: string env: BASE_IMAGE: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 @@ -24,26 +31,41 @@ jobs: shell: bash env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + INPUT_RUNTIME_TAGS: ${{ inputs.runtime_tags }} + INPUT_BINARY_TAG: ${{ inputs.binary_tag }} run: | - # Fetch 3 latest runtime tags from fellows/runtimes (v2.0.4, v2.0.3, etc) - RUNTIMES=$(gh api graphql -f query=' - query { - repository(owner: "polkadot-fellows", name: "runtimes") { - releases(first: 3, orderBy: {field: CREATED_AT, direction: DESC}) { - nodes { tagName } + # Use provided runtime tags or fetch 3 latest from fellows/runtimes (v2.0.4, v2.0.3, etc) + if [[ -n "$INPUT_RUNTIME_TAGS" ]]; then + # Convert comma-separated input to JSON array + RUNTIMES=$(echo "$INPUT_RUNTIME_TAGS" | tr ',' '\n' | jq -R . | jq -s -c .) + echo "Using provided runtime tags: $RUNTIMES" + else + RUNTIMES=$(gh api graphql -f query=' + query { + repository(owner: "polkadot-fellows", name: "runtimes") { + releases(first: 3, orderBy: {field: CREATED_AT, direction: DESC}) { + nodes { tagName } + } } - } - }' --jq '.data.repository.releases.nodes[].tagName' | grep -E "^v[0-9]+" | head -n 3 | jq -R . | jq -s -c .) - - # Fetch latest stable binary tag from paritytech/polkadot-sdk - BINARY_TAG=$(gh api graphql -f query=' - query { - repository(owner: "paritytech", name: "polkadot-sdk") { - releases(first: 20, orderBy: {field: CREATED_AT, direction: DESC}) { - nodes { tagName } + }' --jq '.data.repository.releases.nodes[].tagName' | grep -E "^v[0-9]+" | head -n 3 | jq -R . | jq -s -c .) + echo "Auto-discovered runtime tags: $RUNTIMES" + fi + + # Use provided binary tag or fetch latest stable from paritytech/polkadot-sdk + if [[ -n "$INPUT_BINARY_TAG" ]]; then + BINARY_TAG="$INPUT_BINARY_TAG" + echo "Using provided binary tag: $BINARY_TAG" + else + BINARY_TAG=$(gh api graphql -f query=' + query { + repository(owner: "paritytech", name: "polkadot-sdk") { + releases(first: 20, orderBy: {field: CREATED_AT, direction: DESC}) { + nodes { tagName } + } } - } - }' --jq '.data.repository.releases.nodes[].tagName' | grep -E "^polkadot-stable[0-9]+" | grep -v "\-rc" | sort -Vr | head -n 1) + }' --jq '.data.repository.releases.nodes[].tagName' | grep -E "^polkadot-stable[0-9]+" | grep -v "\-rc" | sort -Vr | head -n 1) + echo "Auto-discovered binary tag: $BINARY_TAG" + fi echo "runtime_matrix=$RUNTIMES" >> $GITHUB_OUTPUT echo "binary_tag=$BINARY_TAG" >> $GITHUB_OUTPUT diff --git a/.github/workflows/ci_runtime_client_test.yml b/.github/workflows/ci_runtime_client_test.yml index 6d2e3fa21..c6d3e811b 100644 --- a/.github/workflows/ci_runtime_client_test.yml +++ b/.github/workflows/ci_runtime_client_test.yml @@ -1,9 +1,16 @@ name: Zombienet Runtime-Client Compatibility Test on: - pull_request: - branches: [main] workflow_dispatch: + inputs: + runtime_tag: + description: 'Runtime version tag (e.g., v2.0.4). Leave empty for auto-discovery of latest.' + required: false + type: string + binary_tags: + description: 'Comma-separated list of 3 client binary tags (e.g., polkadot-stable2503,polkadot-stable2502,polkadot-stable2501). Leave empty for auto-discovery of 3 latest.' + required: false + type: string env: BASE_IMAGE: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 @@ -24,26 +31,41 @@ jobs: shell: bash env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + INPUT_RUNTIME_TAG: ${{ inputs.runtime_tag }} + INPUT_BINARY_TAGS: ${{ inputs.binary_tags }} run: | - # 1. Fetch the single latest runtime tag from fellows/runtimes (e.g., v2.0.4) - RUNTIME_TAG=$(gh api graphql -f query=' - query { - repository(owner: "polkadot-fellows", name: "runtimes") { - releases(first: 5, orderBy: {field: CREATED_AT, direction: DESC}) { - nodes { tagName } + # 1. Use provided runtime tag or fetch the single latest from fellows/runtimes (e.g., v2.0.4) + if [[ -n "$INPUT_RUNTIME_TAG" ]]; then + RUNTIME_TAG="$INPUT_RUNTIME_TAG" + echo "Using provided runtime tag: $RUNTIME_TAG" + else + RUNTIME_TAG=$(gh api graphql -f query=' + query { + repository(owner: "polkadot-fellows", name: "runtimes") { + releases(first: 5, orderBy: {field: CREATED_AT, direction: DESC}) { + nodes { tagName } + } } - } - }' --jq '.data.repository.releases.nodes[].tagName' | grep -E "^v[0-9]+" | head -n 1) - - # 2. Fetch 3 latest stable binary tags from paritytech/polkadot-sdk - BINARIES=$(gh api graphql -f query=' - query { - repository(owner: "paritytech", name: "polkadot-sdk") { - releases(first: 20, orderBy: {field: CREATED_AT, direction: DESC}) { - nodes { tagName } + }' --jq '.data.repository.releases.nodes[].tagName' | grep -E "^v[0-9]+" | head -n 1) + echo "Auto-discovered runtime tag: $RUNTIME_TAG" + fi + + # 2. Use provided binary tags or fetch 3 latest stable binary tags from paritytech/polkadot-sdk + if [[ -n "$INPUT_BINARY_TAGS" ]]; then + # Convert comma-separated input to JSON array + BINARIES=$(echo "$INPUT_BINARY_TAGS" | tr ',' '\n' | jq -R . | jq -s -c .) + echo "Using provided binary tags: $BINARIES" + else + BINARIES=$(gh api graphql -f query=' + query { + repository(owner: "paritytech", name: "polkadot-sdk") { + releases(first: 20, orderBy: {field: CREATED_AT, direction: DESC}) { + nodes { tagName } + } } - } - }' --jq '.data.repository.releases.nodes[].tagName' | grep -E "^polkadot-stable[0-9]+" | grep -v "\-rc" | sort -Vr | head -n 3 | jq -R . | jq -s -c .) + }' --jq '.data.repository.releases.nodes[].tagName' | grep -E "^polkadot-stable[0-9]+" | grep -v "\-rc" | sort -Vr | head -n 3 | jq -R . | jq -s -c .) + echo "Auto-discovered binary tags: $BINARIES" + fi echo "runtime_tag=$RUNTIME_TAG" >> $GITHUB_OUTPUT echo "binary_matrix=$BINARIES" >> $GITHUB_OUTPUT From 717d922cef63ae910f7b7608200f98bb71790bcf Mon Sep 17 00:00:00 2001 From: RafalMirowski1 Date: Tue, 13 Jan 2026 15:11:50 +0100 Subject: [PATCH 27/27] minor cleanup --- .github/workflows/ci_client_runtime_test.yml | 4 +--- .github/workflows/ci_runtime_client_test.yml | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/ci_client_runtime_test.yml b/.github/workflows/ci_client_runtime_test.yml index 72ff960b9..45be8551c 100644 --- a/.github/workflows/ci_client_runtime_test.yml +++ b/.github/workflows/ci_client_runtime_test.yml @@ -13,9 +13,7 @@ on: type: string env: - BASE_IMAGE: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 RUST_LOG: "zombienet_orchestrator=debug,zombienet_provider=debug" - CARGO_TARGET_DIR: /tmp/target jobs: prepare-matrix: @@ -93,7 +91,7 @@ jobs: NODE_BINS=("polkadot" "polkadot-execute-worker" "polkadot-prepare-worker") for bin in "${NODE_BINS[@]}"; do echo "Downloading $bin @ $BIN_TAG" - curl -sL "https://github.com/paritytech/polkadot-sdk/releases/download/$BIN_TAG/$bin" -o "./bin/$bin" + curl -fL "https://github.com/paritytech/polkadot-sdk/releases/download/$BIN_TAG/$bin" -o "./bin/$bin" chmod +x "./bin/$bin" done echo "$PWD/bin" >> $GITHUB_PATH diff --git a/.github/workflows/ci_runtime_client_test.yml b/.github/workflows/ci_runtime_client_test.yml index c6d3e811b..b04ea8f11 100644 --- a/.github/workflows/ci_runtime_client_test.yml +++ b/.github/workflows/ci_runtime_client_test.yml @@ -13,9 +13,7 @@ on: type: string env: - BASE_IMAGE: docker.io/paritytech/ci-unified:bullseye-1.88.0-2025-06-27-v202506301118 RUST_LOG: "zombienet_orchestrator=debug,zombienet_provider=debug" - CARGO_TARGET_DIR: /tmp/target jobs: prepare-matrix: