Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 53 additions & 4 deletions .github/actions/use-polkadot-binaries/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ description: |
consume — restore-only with fail-on-cache-miss. Use in matrix legs / consumers.

Versions are read from .github/env (POLKADOT_NODE_VERSION, CHAIN_SPEC_BUILDER_VERSION,
ZOMBIENET_VERSION, TRY_RUNTIME_VERSION, FRAME_OMNI_BENCHER_VERSION). The action loads
that file into $GITHUB_ENV and installs `just` for you — callers only need to checkout
ZOMBIENET_VERSION, TRY_RUNTIME_VERSION, FRAME_OMNI_BENCHER_VERSION,
WESTEND_RELAY_RUNTIME_VERSION, PASEO_RELAY_RUNTIME_VERSION). The action loads that
file into $GITHUB_ENV and installs `just` for you — callers only need to checkout
the repo first.

inputs:
groups:
description: Space-separated binary groups. Supported - polkadot-node, chain-spec-builder, zombienet, try-runtime, frame-omni-bencher.
description: Space-separated binary groups. Supported - polkadot-node, chain-spec-builder, zombienet, try-runtime, frame-omni-bencher, westend-relay-runtime, paseo-relay-runtime.
required: true
mode:
description: prepare (populate + save, non-matrix job) or consume (restore-only).
Expand All @@ -38,7 +39,7 @@ runs:
echo "::error::use-polkadot-binaries: groups must be a non-empty space-separated list"
exit 1
fi
VALID="polkadot-node chain-spec-builder zombienet try-runtime frame-omni-bencher"
VALID="polkadot-node chain-spec-builder zombienet try-runtime frame-omni-bencher westend-relay-runtime paseo-relay-runtime"
for g in $INPUT_GROUPS; do
case " $VALID " in
*" $g "*) ;;
Expand Down Expand Up @@ -232,3 +233,51 @@ runs:
chmod -R +x "${POLKADOT_BINARIES_DIR}/frame-omni-bencher"
fi
just binaries-bencher >> "$GITHUB_PATH"

# ============================================================
# westend-relay-runtime (WASM artifact; no PATH append)
# ============================================================
- name: Cache westend-relay-runtime WASM
id: cache-westend-relay-runtime
if: inputs.mode == 'prepare' && contains(format(' {0} ', inputs.groups), ' westend-relay-runtime ')
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: ${{ env.POLKADOT_BINARIES_DIR }}/westend-relay-runtime
key: polkadot-binaries-${{ runner.os }}-westend-relay-runtime-${{ env.WESTEND_RELAY_RUNTIME_VERSION }}

- name: Populate westend-relay-runtime WASM
if: inputs.mode == 'prepare' && contains(format(' {0} ', inputs.groups), ' westend-relay-runtime ') && steps.cache-westend-relay-runtime.outputs.cache-hit != 'true'
shell: bash
run: just binaries-westend-relay-runtime > /dev/null

- name: Restore westend-relay-runtime WASM
if: inputs.mode == 'consume' && contains(format(' {0} ', inputs.groups), ' westend-relay-runtime ')
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: ${{ env.POLKADOT_BINARIES_DIR }}/westend-relay-runtime
key: polkadot-binaries-${{ runner.os }}-westend-relay-runtime-${{ env.WESTEND_RELAY_RUNTIME_VERSION }}
fail-on-cache-miss: true

# ============================================================
# paseo-relay-runtime (WASM artifact; no PATH append)
# ============================================================
- name: Cache paseo-relay-runtime WASM
id: cache-paseo-relay-runtime
if: inputs.mode == 'prepare' && contains(format(' {0} ', inputs.groups), ' paseo-relay-runtime ')
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: ${{ env.POLKADOT_BINARIES_DIR }}/paseo-relay-runtime
key: polkadot-binaries-${{ runner.os }}-paseo-relay-runtime-${{ env.PASEO_RELAY_RUNTIME_VERSION }}

- name: Populate paseo-relay-runtime WASM
if: inputs.mode == 'prepare' && contains(format(' {0} ', inputs.groups), ' paseo-relay-runtime ') && steps.cache-paseo-relay-runtime.outputs.cache-hit != 'true'
shell: bash
run: just binaries-paseo-relay-runtime > /dev/null

- name: Restore paseo-relay-runtime WASM
if: inputs.mode == 'consume' && contains(format(' {0} ', inputs.groups), ' paseo-relay-runtime ')
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: ${{ env.POLKADOT_BINARIES_DIR }}/paseo-relay-runtime
key: polkadot-binaries-${{ runner.os }}-paseo-relay-runtime-${{ env.PASEO_RELAY_RUNTIME_VERSION }}
fail-on-cache-miss: true
4 changes: 3 additions & 1 deletion .github/env
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ RUST_STABLE_VERSION=1.88.0
NODE_VERSION=22
KUBO_VERSION=v0.40.1
POLKADOT_BINARIES_DIR=.polkadot-binaries
POLKADOT_NODE_VERSION=d6a4f5977b39bf5e5152e2f2bb6719ea92b992ea
POLKADOT_NODE_VERSION=35a3e48a586624abdea6629d2ace90f637444be8
WESTEND_RELAY_RUNTIME_VERSION=35a3e48a586624abdea6629d2ace90f637444be8
PASEO_RELAY_RUNTIME_VERSION=ed51b038e2c5150c86dac96ff65454836e17678e
FRAME_OMNI_BENCHER_VERSION=polkadot-stable2603
CHAIN_SPEC_BUILDER_VERSION=polkadot-stable2603
TRY_RUNTIME_VERSION=v0.10.1
Expand Down
19 changes: 5 additions & 14 deletions .github/workflows/chainspec-sync-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,14 @@ jobs:
set-image:
uses: ./.github/workflows/set-image.yml

# Pre-warm the binary cache once so matrix legs hit the cache instead of
# each one source-building polkadot-omni-node independently.
# Pre-warm the binary cache once. Cross-workflow concurrency lives in the
# reusable workflow so all PR-wide prepares for the same SHA serialize.
setup:
needs: [set-image]
name: Setup
runs-on: parity-large
container:
uses: ./.github/workflows/prepare-polkadot-binaries.yml
with:
groups: polkadot-node
image: ${{ needs.set-image.outputs.CI_IMAGE }}
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Set up Polkadot binaries
uses: ./.github/actions/use-polkadot-binaries
with:
groups: polkadot-node
mode: prepare

sync-check:
needs: [set-image, setup]
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,10 @@ jobs:
prepare-bencher:
name: Prepare frame-omni-bencher
needs: [set-image, check-fmt]
runs-on: parity-large
container:
uses: ./.github/workflows/prepare-polkadot-binaries.yml
with:
groups: frame-omni-bencher
image: ${{ needs.set-image.outputs.CI_IMAGE }}
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Set up Polkadot binaries
uses: ./.github/actions/use-polkadot-binaries
with:
groups: frame-omni-bencher
mode: prepare

benchmarks:
name: Check Benchmarks (${{ matrix.runtime.name }})
Expand Down
22 changes: 7 additions & 15 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,16 @@ jobs:
needs: [changes]
uses: ./.github/workflows/set-image.yml

# Pre-warm the binary cache once before the matrix fan-out so all matrix
# legs hit the cache instead of racing to download/build.
# Pre-warm the binary cache once before the matrix fan-out. Cross-workflow
# concurrency lives in the reusable workflow so PR-wide prepares for the
# same SHA serialize.
setup:
if: needs.changes.outputs.should-run == 'true'
needs: [changes, set-image]
name: Setup
runs-on: parity-large
container:
uses: ./.github/workflows/prepare-polkadot-binaries.yml
with:
groups: polkadot-node chain-spec-builder zombienet westend-relay-runtime paseo-relay-runtime
image: ${{ needs.set-image.outputs.CI_IMAGE }}
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Set up Polkadot binaries
uses: ./.github/actions/use-polkadot-binaries
with:
groups: polkadot-node chain-spec-builder zombienet
mode: prepare

runtime-matrix:
if: needs.changes.outputs.should-run == 'true'
Expand Down Expand Up @@ -84,7 +76,7 @@ jobs:
- name: Set up Polkadot binaries
uses: ./.github/actions/use-polkadot-binaries
with:
groups: polkadot-node chain-spec-builder zombienet
groups: polkadot-node chain-spec-builder zombienet westend-relay-runtime paseo-relay-runtime
mode: consume

- name: Rust cache (Bulletin)
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/prepare-polkadot-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Prepare polkadot binaries

# Centralizes the `use-polkadot-binaries` prepare path so the contract lives
# in one file and all callers share the same cache keys.

on:
workflow_call:
inputs:
groups:
type: string
required: true
description: Space-separated binary groups (forwarded to use-polkadot-binaries).
image:
type: string
required: true
description: Container image (passed by the caller, typically set-image.outputs.CI_IMAGE).

permissions:
contents: read

jobs:
prepare:
runs-on: parity-large
container:
image: ${{ inputs.image }}
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- uses: ./.github/actions/use-polkadot-binaries
with:
groups: ${{ inputs.groups }}
mode: prepare
51 changes: 38 additions & 13 deletions .github/workflows/zombienet-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,23 @@ jobs:

prepare-binaries:
if: needs.changes.outputs.should-run == 'true'
name: Fetch polkadot binaries + bulletin chain specs
needs: [changes, set-image]
uses: ./.github/workflows/prepare-polkadot-binaries.yml
with:
groups: polkadot-node chain-spec-builder westend-relay-runtime paseo-relay-runtime
image: ${{ needs.set-image.outputs.CI_IMAGE }}

prepare-specs:
if: needs.changes.outputs.should-run == 'true'
name: Generate bulletin chain specs
needs: [changes, set-image, prepare-binaries]
runs-on: parity-large
container:
image: ${{ needs.set-image.outputs.CI_IMAGE }}
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Set up Polkadot binaries
uses: ./.github/actions/use-polkadot-binaries
with:
groups: polkadot-node chain-spec-builder
mode: prepare

# Keyed by commit SHA: the spec embeds the bulletin runtime WASM.
- name: Cache bulletin chain specs
id: cache-specs
Expand All @@ -56,14 +58,21 @@ jobs:
zombienet/bulletin-paseo-spec.json
key: bulletin-specs-${{ runner.os }}-${{ github.sha }}

- name: Set up Polkadot binaries
if: steps.cache-specs.outputs.cache-hit != 'true'
uses: ./.github/actions/use-polkadot-binaries
with:
groups: chain-spec-builder
mode: consume

- name: Generate chain specs
if: steps.cache-specs.outputs.cache-hit != 'true'
run: |
just chain-spec westend
just chain-spec paseo

zombienet-auto-renew-tests:
needs: [set-image, prepare-binaries]
needs: [set-image, prepare-binaries, prepare-specs]
name: auto-renew / ${{ matrix.runtime.name }} / ${{ matrix.group }}
runs-on: parity-large
container:
Expand All @@ -89,7 +98,7 @@ jobs:
- name: Set up Polkadot binaries
uses: ./.github/actions/use-polkadot-binaries
with:
groups: polkadot-node chain-spec-builder
groups: polkadot-node chain-spec-builder westend-relay-runtime paseo-relay-runtime
mode: consume

- name: Rust cache
Expand Down Expand Up @@ -118,15 +127,25 @@ jobs:
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: zombienet-auto-renew-test-logs-${{ matrix.runtime.name }}-${{ matrix.group }}
path: /tmp/zombie-*/**/*.log
# Parachain collator's RocksDB only — relay validators don't carry col11. The
# `*.log` glob brings in both stdout logs and WAL fragments; `CURRENT`,
# `MANIFEST-*`, `OPTIONS-*`, `IDENTITY`, and `*.sst` are the rest of the rocksdb
# surface needed for `rocksdb_ldb` to open the DB post-mortem.
path: |
/tmp/zombie-*/**/*.log
/tmp/zombie-*/collator-1/data/chains/*/db/full/CURRENT
/tmp/zombie-*/collator-1/data/chains/*/db/full/MANIFEST-*
/tmp/zombie-*/collator-1/data/chains/*/db/full/OPTIONS-*
/tmp/zombie-*/collator-1/data/chains/*/db/full/IDENTITY
/tmp/zombie-*/collator-1/data/chains/*/db/full/*.sst
retention-days: 14

zombienet-sync-tests:
# Sync suite is ~120 min; gate behind dispatch / `zombienet-sync-tests` label.
if: >-
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'zombienet-sync-tests'))
needs: [set-image, prepare-binaries]
needs: [set-image, prepare-binaries, prepare-specs]
name: sync / ${{ matrix.runtime.name }}
runs-on: parity-large
container:
Expand All @@ -147,7 +166,7 @@ jobs:
- name: Set up Polkadot binaries
uses: ./.github/actions/use-polkadot-binaries
with:
groups: polkadot-node chain-spec-builder
groups: polkadot-node chain-spec-builder westend-relay-runtime paseo-relay-runtime
mode: consume

- name: Rust cache
Expand Down Expand Up @@ -178,5 +197,11 @@ jobs:
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: zombienet-sync-test-logs-bulletin-${{ matrix.runtime.name }}
path: /tmp/zombie-*/**/*.log
path: |
/tmp/zombie-*/**/*.log
/tmp/zombie-*/collator-1/data/chains/*/db/full/CURRENT
/tmp/zombie-*/collator-1/data/chains/*/db/full/MANIFEST-*
/tmp/zombie-*/collator-1/data/chains/*/db/full/OPTIONS-*
/tmp/zombie-*/collator-1/data/chains/*/db/full/IDENTITY
/tmp/zombie-*/collator-1/data/chains/*/db/full/*.sst
retention-days: 14
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ console-ui/playwright/.cache/
# Specs for zombienet (need to be fresh)
zombienet/bulletin-westend-spec.json
zombienet/bulletin-paseo-spec.json
zombienet/westend-local-spec.json
zombienet/paseo-local-spec.json
17 changes: 11 additions & 6 deletions examples/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,24 @@ bulletin-parachain-zombienet-start test_dir runtime="bulletin-westend-runtime":
POLKADOT_PARACHAIN_BINARY_PATH="$POLKADOT_BIN_DIR/polkadot-omni-node"
ZOMBIENET_BIN="$ZOMBIENET_BIN_DIR/zombienet"

# Pick spec script + zombienet TOML based on the runtime
# Pick spec scripts + zombienet TOML based on the runtime
if [ "{{ runtime }}" = "bulletin-westend-runtime" ]; then
SPEC_SCRIPT="create_bulletin_westend_spec.sh"
RELAY_SPEC_SCRIPT="create_westend_local_spec.sh"
ZOMBIENET_TOML="zombienet/bulletin-westend-local.toml"
elif [ "{{ runtime }}" = "bulletin-paseo-runtime" ]; then
SPEC_SCRIPT="create_bulletin_paseo_spec.sh"
RELAY_SPEC_SCRIPT="create_paseo_local_spec.sh"
ZOMBIENET_TOML="zombienet/bulletin-paseo-local.toml"
else
echo "❌ Unhandled runtime: {{ runtime }}"
exit 1
fi

echo " Creating chain spec for {{ runtime }}..."
echo " Creating chain specs for {{ runtime }}..."
CSB_DIR="$(cd "$ROOT_DIR" && just binaries-chain-spec-builder)"
PATH="$CSB_DIR:$PATH" "$ROOT_DIR/scripts/$SPEC_SCRIPT"
PATH="$CSB_DIR:$PATH" "$ROOT_DIR/scripts/$RELAY_SPEC_SCRIPT"

cat <<EOF
⚡ Starting Bulletin chain with zombienet
Expand Down Expand Up @@ -523,13 +526,14 @@ run-test-authorize-and-store test_dir runtime mode="ws" ws_url="ws://127.0.0.1:1

# Run the script with parameters
if [ "{{ mode }}" = "smoldot" ]; then
RELAY_CHAINSPEC_PATH="{{ test_dir }}/bob/cfg/westend-local.json"
# Zombienet names the parachain chainspec by <relay>-<para_id>.json,
# and the containing directory by the collator name used in each toml.
if [ "{{ runtime }}" = "bulletin-westend-runtime" ]; then
RELAY_CHAINSPEC_PATH="{{ test_dir }}/bob/cfg/westend-local.json"
PARACHAIN_CHAINSPEC_PATH="{{ test_dir }}/bulletin-westend-collator-2/cfg/westend-local-1010.json"
elif [ "{{ runtime }}" = "bulletin-paseo-runtime" ]; then
PARACHAIN_CHAINSPEC_PATH="{{ test_dir }}/bulletin-paseo-collator-2/cfg/westend-local-1501.json"
RELAY_CHAINSPEC_PATH="{{ test_dir }}/bob/cfg/paseo-local.json"
PARACHAIN_CHAINSPEC_PATH="{{ test_dir }}/bulletin-paseo-collator-2/cfg/paseo-local-1501.json"
else
echo "❌ Unhandled runtime: {{ runtime }}"
exit 1
Expand Down Expand Up @@ -734,11 +738,12 @@ run-authorize-and-store runtime mode="ws" ipfs_mode="kubo-docker": npm-install
# Parachain: relay chain (required) + parachain spec (optional).
# Zombienet names the parachain chainspec by <relay>-<para_id>.json,
# and the containing directory by the collator name used in each toml.
RELAY_CHAINSPEC_PATH="$TEST_DIR/bob/cfg/westend-local.json"
if [ "{{ runtime }}" = "bulletin-westend-runtime" ]; then
RELAY_CHAINSPEC_PATH="$TEST_DIR/bob/cfg/westend-local.json"
PARACHAIN_CHAINSPEC_PATH="$TEST_DIR/bulletin-westend-collator-2/cfg/westend-local-1010.json"
elif [ "{{ runtime }}" = "bulletin-paseo-runtime" ]; then
PARACHAIN_CHAINSPEC_PATH="$TEST_DIR/bulletin-paseo-collator-2/cfg/westend-local-1501.json"
RELAY_CHAINSPEC_PATH="$TEST_DIR/bob/cfg/paseo-local.json"
PARACHAIN_CHAINSPEC_PATH="$TEST_DIR/bulletin-paseo-collator-2/cfg/paseo-local-1501.json"
else
echo "❌ Unhandled runtime: {{ runtime }}"
exit 1
Expand Down
Loading
Loading