diff --git a/runtime/flashbox/src/lib.rs b/runtime/flashbox/src/lib.rs index 03387c0f5..8cd92b3ac 100644 --- a/runtime/flashbox/src/lib.rs +++ b/runtime/flashbox/src/lib.rs @@ -38,7 +38,7 @@ pub mod weights; mod tests; use { - cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases, + cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases, cumulus_primitives_core::{relay_chain::SessionIndex, BodyId, ParaId}, frame_support::{ construct_runtime, @@ -504,7 +504,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime { type ReservedDmpWeight = (); type XcmpMessageHandler = (); type ReservedXcmpWeight = (); - type CheckAssociatedRelayNumber = RelayNumberStrictlyIncreases; + type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases; type ConsensusHook = ConsensusHook; } diff --git a/test/moonwall.config.json b/test/moonwall.config.json index 0a045e2cc..950538844 100644 --- a/test/moonwall.config.json +++ b/test/moonwall.config.json @@ -577,6 +577,45 @@ } ] }, + { + "name": "zombie_simple_template_upgrade_with_latest_releases", + "testFileDir": ["suites/rt-upgrade-templates-zombienet"], + "runScripts": [ + "download-latest-rt-binaries.sh", + "build-spec-single-container.sh tmp container-chain-simple-node flashbox-local", + "download-polkadot.sh", + "download-latest-binaries.sh ../target/release", + "compile-wasm.ts compile -b tmp/tanssi-node -o wasm -c specs/single-container-tanssi-1000.json", + "compile-wasm.ts compile -b tmp/container-chain-simple-node -o wasm -c specs/single-container-template-container-2000.json" + ], + + "timeout": 900000, + "foundation": { + "rtUpgradePath": "../target/release/wbuild/container-chain-template-simple-runtime/container_chain_template_simple_runtime.compact.compressed.wasm", + "type": "zombie", + "zombieSpec": { + "configPath": "./configs/zombieTemplateUpgradeSimple.json", + "disableDefaultEthProviders": true + } + }, + "connections": [ + { + "name": "Relay", + "type": "polkadotJs", + "endpoints": ["ws://127.0.0.1:9947"] + }, + { + "name": "Tanssi", + "type": "polkadotJs", + "endpoints": ["ws://127.0.0.1:9948"] + }, + { + "name": "parachain", + "type": "polkadotJs", + "endpoints": ["ws://127.0.0.1:9949"] + } + ] + }, { "name": "zombie_frontier_template_upgrade", "testFileDir": ["suites/rt-upgrade-templates-zombienet"], @@ -615,6 +654,45 @@ } ] }, + { + "name": "zombie_frontier_template_upgrade_with_latest_releases", + "testFileDir": ["suites/rt-upgrade-templates-zombienet"], + "runScripts": [ + "download-latest-rt-binaries.sh", + "build-spec-single-container.sh tmp container-chain-frontier-node flashbox-local", + "download-polkadot.sh", + "download-latest-binaries.sh ../target/release", + "compile-wasm.ts compile -b tmp/tanssi-node -o wasm -c specs/single-container-tanssi-1000.json", + "compile-wasm.ts compile -b tmp/container-chain-frontier-node -o wasm -c specs/single-container-template-container-2000.json" + ], + + "timeout": 900000, + "foundation": { + "rtUpgradePath": "../target/release/wbuild/container-chain-template-frontier-runtime/container_chain_template_frontier_runtime.compact.compressed.wasm", + "type": "zombie", + "zombieSpec": { + "configPath": "./configs/zombieTemplateUpgradeFrontier.json", + "disableDefaultEthProviders": true + } + }, + "connections": [ + { + "name": "Relay", + "type": "polkadotJs", + "endpoints": ["ws://127.0.0.1:9947"] + }, + { + "name": "Tanssi", + "type": "polkadotJs", + "endpoints": ["ws://127.0.0.1:9948"] + }, + { + "name": "parachain", + "type": "polkadotJs", + "endpoints": ["ws://127.0.0.1:9949"] + } + ] + }, { "name": "zombie_tanssi_relay", "timeout": 600000, diff --git a/test/scripts/download-latest-binaries.sh b/test/scripts/download-latest-binaries.sh new file mode 100755 index 000000000..af71871ee --- /dev/null +++ b/test/scripts/download-latest-binaries.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +# Exit on any error +set -e + +# Always run the commands from the "test" dir +cd $(dirname $0)/.. + +if [[ -z "${1}" || ${1} == "undefined" ]]; then + OUTPUT_FOLDER="tmp" +else + OUTPUT_FOLDER="${1}" +fi + +LATEST_NODE_RELEASE=$(curl -s https://api.github.com/repos/moondance-labs/tanssi/releases | jq -r '.[] | select(.name | test("v0.";"i")) | .tag_name' | head -n 1 | tr -d '[:blank:]') && [[ ! -z "${LATEST_NODE_RELEASE}" ]] +ENDPOINT="https://api.github.com/repos/moondance-labs/tanssi/git/refs/tags/$LATEST_NODE_RELEASE" +RESPONSE=$(curl -s -H "Accept: application/vnd.github.v3+json" $ENDPOINT) +TYPE=$(echo $RESPONSE | jq -r '.object.type') +if [[ $TYPE == "commit" ]] +then + LATEST_NODE_SHA8=$(echo $RESPONSE | jq -r '.object.sha' | cut -c -8) +elif [[ $TYPE == "tag" ]] +then + URL=$(echo $RESPONSE | jq -r '.object.url') + TAG_RESPONSE=$(curl -s -H "Accept: application/vnd.github.v3+json" $URL) + TAG_RESPONSE_CLEAN=$(echo $TAG_RESPONSE | tr -d '\000-\037') + LATEST_NODE_SHA8=$(echo $TAG_RESPONSE_CLEAN | jq -r '.object.sha' | cut -c -8) +fi + +DOCKER_TAG_TANSSI="moondancelabs/tanssi:sha-$LATEST_NODE_SHA8" + +docker rm -f tanssi_container 2> /dev/null | true +docker create --name tanssi_container $DOCKER_TAG_TANSSI bash +docker cp tanssi_container:tanssi/tanssi-node $OUTPUT_FOLDER/tanssi-node +docker rm -f tanssi_container +chmod uog+x ../target/release/tanssi-node +chmod uog+x $OUTPUT_FOLDER/tanssi-node + +DOCKER_TAG_CONTAINER_SIMPLE="moondancelabs/container-chain-simple-template:sha-$LATEST_NODE_SHA8" + +docker rm -f tanssi_container_simple 2> /dev/null | true +docker create --name tanssi_container_simple $DOCKER_TAG_CONTAINER_SIMPLE bash +docker cp tanssi_container_simple:container-chain-template-simple/container-chain-simple-node $OUTPUT_FOLDER/container-chain-simple-node +docker rm -f tanssi_container_simple +chmod uog+x ../target/release/container-chain-simple-node +chmod uog+x $OUTPUT_FOLDER/container-chain-simple-node + +DOCKER_TAG_CONTAINER_FRONTIER="moondancelabs/container-chain-evm-template:sha-$LATEST_NODE_SHA8" + +docker rm -f tanssi_container_frontier 2> /dev/null | true +docker create --name tanssi_container_frontier $DOCKER_TAG_CONTAINER_FRONTIER bash +docker cp tanssi_container_frontier:container-chain-template-evm/container-chain-frontier-node $OUTPUT_FOLDER/container-chain-frontier-node +docker rm -f tanssi_container_frontier +chmod uog+x ../target/release/container-chain-frontier-node +chmod uog+x $OUTPUT_FOLDER/container-chain-frontier-node