Skip to content

Commit 150414e

Browse files
committed
fix: compatibility runtime workflow
1 parent ef51222 commit 150414e

4 files changed

Lines changed: 19 additions & 5 deletions

File tree

‎.github/workflows/runtime-compatibility.yml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ jobs:
6767
# Only run if workflow_run was successful OR if manually triggered
6868
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
6969
runs-on: ubuntu-latest
70+
timeout-minutes: 150
7071
strategy:
7172
fail-fast: false
7273
matrix:
@@ -218,14 +219,15 @@ jobs:
218219
# 1. Generate plain spec
219220
"$TMP_COLLATOR" build-spec --chain astar-dev > astar-plain.json
220221
221-
# 2. Patch sudo key, WASM, and (crucially, since the spec is raw)
222-
# session keys + invulnerables for zombienet's collator names.
222+
# 2. Patch sudo key, WASM, and (crucially, since the spec is raw) para ID,
223+
# session keys + invulnerables to match smoke_runtime_upgrade.toml.
223224
python3 patch_astar_sudo_spec.py \
224225
astar-plain.json \
225226
"$SUDO_WASM" \
226227
astar-patched.json \
227228
"$ALICE" \
228229
"$TMP_COLLATOR" \
230+
2000 \
229231
collator1 collator2
230232
231233
# 3. Convert patched spec -> raw spec
@@ -239,6 +241,8 @@ jobs:
239241
# ── Run the actual compatibility test ─────────────────────────────────────
240242
- name: Run compatibility test
241243
working-directory: ${{ env.ZOMBIENET_DIR }}
244+
# zombienet's "perform upgrade" waits forever if the chain stops producing blocks
245+
timeout-minutes: 40
242246
run: |
243247
if [ "${{ matrix.chain }}" = "astar" ]; then
244248
export CHAIN="./astar-raw.json"

‎third-party/zombienet/patch_astar_sudo_spec.py‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@
88
these names, and once we hand zombienet a raw spec it can no longer inject
99
them itself. Without this rewrite the collators are unauthorised to author
1010
and the chain never produces a block.
11+
4. Set the para ID to the one zombienet registers on the relay, which it can't
12+
patch into a raw spec's genesis either. On a mismatch no block is produced.
1113
1214
Usage:
1315
patch_astar_sudo_spec.py <plain_in> <wasm> <patched_out> \\
14-
<sudo_ss58> <collator_binary> <collator_name>...
16+
<sudo_ss58> <collator_binary> <para_id> <collator_name>...
1517
"""
1618

1719
import json
1820
import subprocess
1921
import sys
2022
from pathlib import Path
2123

22-
if len(sys.argv) < 7:
24+
if len(sys.argv) < 8:
2325
print(__doc__, file=sys.stderr)
2426
sys.exit(2)
2527

@@ -28,7 +30,8 @@
2830
out_path = Path(sys.argv[3])
2931
sudo_ss58 = sys.argv[4]
3032
collator_bin = sys.argv[5]
31-
collator_names = sys.argv[6:]
33+
para_id = int(sys.argv[6])
34+
collator_names = sys.argv[7:]
3235

3336

3437
def inspect(uri: str) -> dict:
@@ -64,6 +67,9 @@ def uri_for(name: str) -> str:
6467

6568
cfg.setdefault("sudo", {})["key"] = sudo_ss58
6669

70+
cfg.setdefault("parachainInfo", {})["parachainId"] = para_id
71+
spec["para_id"] = para_id
72+
6773
cfg.setdefault("session", {})["keys"] = [
6874
[c["ss58"], c["ss58"], {"aura": c["ss58"]}] for _, c in collators
6975
]

‎third-party/zombienet/setup.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ while ps $SETUP_PID > /dev/null ; do
3232
sleep 1
3333
done
3434
chmod +x polkadot polkadot-execute-worker polkadot-prepare-worker
35+
./polkadot --version

‎third-party/zombienet/smoke_runtime_upgrade.zndsl‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ collator2: parachain 2000 perform upgrade with ./runtime.compact.compressed.wasm
1818
## and same-slot collisions between mixed client versions).
1919
collator1: js-script ./scripts/post_upgrade.js with "20" return is equal to 1 within 450 seconds
2020
collator2: js-script ./scripts/post_upgrade.js with "20" return is equal to 1 within 450 seconds
21+
22+
## on the upgraded runtime, session keys register only with a valid ownership proof
23+
collator2: js-script ./scripts/rotate_session_keys.js return is equal to 1 within 200 seconds

0 commit comments

Comments
 (0)