From 5a1be21f1435e1be0f1573934e1995f4248193a8 Mon Sep 17 00:00:00 2001 From: Kailai Wang Date: Mon, 5 Dec 2022 14:20:32 +0100 Subject: [PATCH 01/25] update script --- scripts/fork-parachain-and-launch.sh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/fork-parachain-and-launch.sh b/scripts/fork-parachain-and-launch.sh index 90e5a3bbce..10c5bf6bbb 100755 --- a/scripts/fork-parachain-and-launch.sh +++ b/scripts/fork-parachain-and-launch.sh @@ -18,14 +18,12 @@ function print_divider() { function usage() { print_divider - echo "Usage: $0 [http-rpc-endpoint] [orig-chain] [fork-chain] [binary]" - echo - echo "the http-rpc-endpoint has to be a reachabale HTTP-RPC URL (do not mix it up with ws port)" + echo "Usage: $0 [ws-rpc-endpoint] [orig-chain] [fork-chain] [binary]" echo echo "default:" - echo "http-rpc-endpoint: http://localhost:9933" - echo "orig-chain: litmus" - echo "fork-chain: litmus-dev" + echo "ws-rpc-endpoint: ws://127.0.0.1:9944" + echo "orig-chain: rococo" + echo "fork-chain: rococo-dev" echo "binary: the binary copied from litentry/litentry-parachain:latest" print_divider } @@ -41,9 +39,9 @@ case "$1" in ;; esac -ENDPOINT="${1:-http://localhost:9933}" -ORIG_CHAIN=${2:-litmus} -FORK_CHAIN=${3:-litmus-dev} +ENDPOINT="${1:-ws://127.0.0.1:9944}" +ORIG_CHAIN=${2:-rococo} +FORK_CHAIN=${3:-rococo-dev} CHAIN_TYPE= case "$FORK_CHAIN" in @@ -51,6 +49,8 @@ case "$FORK_CHAIN" in CHAIN_TYPE=litmus ;; litentry*) CHAIN_TYPE=litentry ;; + rococo*) + CHAIN_TYPE=rococo ;; *) echo "unsupported chain type" exit 1 ;; @@ -59,6 +59,7 @@ esac echo "TMPDIR is $TMPDIR" cd "$TMPDIR" git clone "$FORK_OFF_SUBSTRATE_REPO" +git checkout wss-fork cd fork-off-substrate npm i @@ -88,7 +89,7 @@ jq .result | sed 's/"//g;s/^0x//' | xxd -r -p > runtime.wasm # write .env file cd .. cat << EOF > .env -HTTP_RPC_ENDPOINT=$ENDPOINT +WS_RPC_ENDPOINT=$ENDPOINT ALICE=1 ORIG_CHAIN=$ORIG_CHAIN FORK_CHAIN=$FORK_CHAIN @@ -107,4 +108,4 @@ cd "$ROOTDIR" sed -i.bak "s;$FORK_CHAIN;$FORK_JSON_PATH;" docker/$CHAIN_TYPE-parachain-launch-config.yml # start the network -make launch-docker-$CHAIN_TYPE +# make launch-docker-$CHAIN_TYPE From f884cbbc2ac30252932da19643d94594a2ead01f Mon Sep 17 00:00:00 2001 From: Kailai Wang Date: Mon, 5 Dec 2022 17:27:02 +0100 Subject: [PATCH 02/25] use relative path --- scripts/fork-parachain-and-launch.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/fork-parachain-and-launch.sh b/scripts/fork-parachain-and-launch.sh index 10c5bf6bbb..d5b913e28a 100755 --- a/scripts/fork-parachain-and-launch.sh +++ b/scripts/fork-parachain-and-launch.sh @@ -102,10 +102,10 @@ if [ ! -f data/fork.json ]; then exit 2 fi -FORK_JSON_PATH="$(pwd)/data/fork.json" +cp -f data/fork.json "$ROOTDIR/docker/" cd "$ROOTDIR" -sed -i.bak "s;$FORK_CHAIN;$FORK_JSON_PATH;" docker/$CHAIN_TYPE-parachain-launch-config.yml +sed -i.bak "s;$FORK_CHAIN;fork.json;" docker/$CHAIN_TYPE-parachain-launch-config.yml # start the network # make launch-docker-$CHAIN_TYPE From d9c059c8fb744c640451a0bd3b9adccbcfd0a8e0 Mon Sep 17 00:00:00 2001 From: Kailai Wang Date: Mon, 5 Dec 2022 19:26:20 +0100 Subject: [PATCH 03/25] update script --- scripts/fork-parachain-and-launch.sh | 41 ++++++++-------------------- 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/scripts/fork-parachain-and-launch.sh b/scripts/fork-parachain-and-launch.sh index d5b913e28a..aae6704f6e 100755 --- a/scripts/fork-parachain-and-launch.sh +++ b/scripts/fork-parachain-and-launch.sh @@ -18,17 +18,16 @@ function print_divider() { function usage() { print_divider - echo "Usage: $0 [ws-rpc-endpoint] [orig-chain] [fork-chain] [binary]" + echo "Usage: $0 [ws-rpc-endpoint] [rococo|litmus|litentry] [binary]" echo echo "default:" echo "ws-rpc-endpoint: ws://127.0.0.1:9944" - echo "orig-chain: rococo" - echo "fork-chain: rococo-dev" + echo "chain: rococo" echo "binary: the binary copied from litentry/litentry-parachain:latest" print_divider } -[ $# -gt 4 ] && (usage; exit 1) +[ $# -gt 3 ] && (usage; exit 1) case "$1" in help|-h|--help) @@ -41,16 +40,11 @@ esac ENDPOINT="${1:-ws://127.0.0.1:9944}" ORIG_CHAIN=${2:-rococo} -FORK_CHAIN=${3:-rococo-dev} -CHAIN_TYPE= - -case "$FORK_CHAIN" in - litmus*) - CHAIN_TYPE=litmus ;; - litentry*) - CHAIN_TYPE=litentry ;; - rococo*) - CHAIN_TYPE=rococo ;; +FORK_CHAIN=${ORIG_CHAIN}-dev + +case "$ORIG_CHAIN" in + litmus|rococo|litentry) + ;; *) echo "unsupported chain type" exit 1 ;; @@ -59,8 +53,8 @@ esac echo "TMPDIR is $TMPDIR" cd "$TMPDIR" git clone "$FORK_OFF_SUBSTRATE_REPO" -git checkout wss-fork cd fork-off-substrate +git checkout wss-fork npm i mkdir data && cd data @@ -73,19 +67,6 @@ else fi chmod a+x binary -# pop up a warning if on non-CI host -if [ $(hostname) != "ubuntu-16gb-CI" ]; then - echo "WARNING: it seems you are not on the CI host" - echo " please make sure the given HTTP-RPC endpoint accessible" -else - # open the ssh port forwarding for a short time - ssh -f -L 9900:localhost:9933 litmus-sg-rpc0 sleep 120 -fi - -# retrieve the live wasm -curl -s -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "state_getStorage", "params": [ "0x3a636f6465" ]}' "$ENDPOINT" | \ -jq .result | sed 's/"//g;s/^0x//' | xxd -r -p > runtime.wasm - # write .env file cd .. cat << EOF > .env @@ -105,7 +86,7 @@ fi cp -f data/fork.json "$ROOTDIR/docker/" cd "$ROOTDIR" -sed -i.bak "s;$FORK_CHAIN;fork.json;" docker/$CHAIN_TYPE-parachain-launch-config.yml +sed -i.bak "s;$FORK_CHAIN;fork.json;" docker/$ORIG_CHAIN-parachain-launch-config.yml # start the network -# make launch-docker-$CHAIN_TYPE +make launch-docker-$ORIG_CHAIN From cde217c431e8bbd0bd5d301ea6edf154a11134ff Mon Sep 17 00:00:00 2001 From: Kailai Wang Date: Mon, 5 Dec 2022 20:28:02 +0100 Subject: [PATCH 04/25] improve arg handling --- scripts/fork-parachain-and-launch.sh | 44 +++++++++++++++++++--------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/scripts/fork-parachain-and-launch.sh b/scripts/fork-parachain-and-launch.sh index aae6704f6e..b81efccd39 100755 --- a/scripts/fork-parachain-and-launch.sh +++ b/scripts/fork-parachain-and-launch.sh @@ -10,6 +10,14 @@ set -eo pipefail ROOTDIR=$(git rev-parse --show-toplevel) TMPDIR=$(mktemp -d /tmp/XXXXXX) +cleanup() { + echo "removing $1 ..." + rm -rf "$1" + exit +} + +trap 'cleanup' INT TERM EXIT + FORK_OFF_SUBSTRATE_REPO="https://github.com/litentry/fork-off-substrate.git" function print_divider() { @@ -18,12 +26,14 @@ function print_divider() { function usage() { print_divider - echo "Usage: $0 [ws-rpc-endpoint] [rococo|litmus|litentry] [binary]" - echo - echo "default:" - echo "ws-rpc-endpoint: ws://127.0.0.1:9944" - echo "chain: rococo" - echo "binary: the binary copied from litentry/litentry-parachain:latest" + echo "Usage: $0 [chain] [ws-rpc-endpoint] [binary]" + echo + echo "chain: rococo|litmus|litentry" + echo " default: rococo" + echo "ws-rpc-endpoint: the ws rpc endpoint of the parachain" + echo " default: litentry-rococo's rpc endpoint" + echo "binary: path to the litentry parachain binary" + echo " default: the binary copied from litentry/litentry-parachain:latest" print_divider } @@ -38,12 +48,18 @@ case "$1" in ;; esac -ENDPOINT="${1:-ws://127.0.0.1:9944}" -ORIG_CHAIN=${2:-rococo} +ORIG_CHAIN=${1:-rococo} FORK_CHAIN=${ORIG_CHAIN}-dev case "$ORIG_CHAIN" in - litmus|rococo|litentry) + rococo) + ENDPOINT="${2:-wss://rpc.rococo-parachain-sg.litentry.io}" + ;; + litmus) + ENDPOINT="${2:-wss://rpc.litmus-parachain.litentry.io}" + ;; + litentry) + ENDPOINT="${2:-wss://rpc.litentry-parachain.litentry.io}" ;; *) echo "unsupported chain type" @@ -60,10 +76,10 @@ npm i mkdir data && cd data # copy the binary -if [ -z "$4" ]; then - docker cp $(docker create --rm litentry/litentry-parachain:latest):/usr/local/bin/litentry-collator binary +if [ -z "$3" ]; then + docker cp "$(docker create --rm litentry/litentry-parachain:latest):/usr/local/bin/litentry-collator" binary else - cp "$4" binary + cp -f "$3" binary fi chmod a+x binary @@ -86,7 +102,7 @@ fi cp -f data/fork.json "$ROOTDIR/docker/" cd "$ROOTDIR" -sed -i.bak "s;$FORK_CHAIN;fork.json;" docker/$ORIG_CHAIN-parachain-launch-config.yml +sed -i.bak "s;$FORK_CHAIN;fork.json;" "docker/$ORIG_CHAIN-parachain-launch-config.yml" # start the network -make launch-docker-$ORIG_CHAIN +make "launch-docker-$ORIG_CHAIN" From 9ca926a706b927ac1f2e5565a362208618777c99 Mon Sep 17 00:00:00 2001 From: Kailai Wang Date: Mon, 5 Dec 2022 22:44:37 +0100 Subject: [PATCH 05/25] fix trap --- scripts/fork-parachain-and-launch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/fork-parachain-and-launch.sh b/scripts/fork-parachain-and-launch.sh index b81efccd39..11d74d08b6 100755 --- a/scripts/fork-parachain-and-launch.sh +++ b/scripts/fork-parachain-and-launch.sh @@ -16,7 +16,7 @@ cleanup() { exit } -trap 'cleanup' INT TERM EXIT +trap 'cleanup $TMPDIR' INT TERM EXIT FORK_OFF_SUBSTRATE_REPO="https://github.com/litentry/fork-off-substrate.git" From e26ad7d44582b6db800de3999e07a1a5fdd95b96 Mon Sep 17 00:00:00 2001 From: Scc Date: Wed, 7 Dec 2022 15:43:37 +0800 Subject: [PATCH 06/25] simulmation runtime upgrade demo impl --- .../workflows/runtime-upgrade-simulation.yml | 49 ++++++++++ Makefile | 26 ++++++ scripts/fork-parachain-and-launch.sh | 3 +- scripts/launch-local-binary.sh | 2 +- scripts/runtime-upgrade.sh | 89 +++++++++++++++++++ ts-tests/tests/runtime-upgrade.ts | 49 ++++++++++ 6 files changed, 215 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/runtime-upgrade-simulation.yml create mode 100755 scripts/runtime-upgrade.sh create mode 100644 ts-tests/tests/runtime-upgrade.ts diff --git a/.github/workflows/runtime-upgrade-simulation.yml b/.github/workflows/runtime-upgrade-simulation.yml new file mode 100644 index 0000000000..4269d91783 --- /dev/null +++ b/.github/workflows/runtime-upgrade-simulation.yml @@ -0,0 +1,49 @@ +name: Runtime upgrade simulation + +on: + push: + branches: + - dev + paths-ignore: + - "**/dependabot.yml" + - "**/README.md" + pull_request: + branches: + - dev + types: + - opened + - reopened + - synchronize + - ready_for_review + workflow_dispatch: + +env: + RELEASE_TAG: ${{ github.event.inputs.release_tag }} + DIFF_TAG: ${{ github.event.inputs.diff_tag }} + GENESIS_RELEASE: ${{ github.event.inputs.genesis_release }} + DOCKER_BUILDKIT: 1 + + +job: + fork-parachain-and-launch: + run-on: ubuntu-latest + strategy: + matrix: + chain: + - litmus + - litentry + - rococo + steps: + - name: fork-parachain + run: + make fork-parachain-${{ matrix.chain }} + - name: download-new-runtime.wasm && runtime upgrade + run: +# or same above add the command in makefile + @./script/runtime-upgrade.sh ${{ matrix.chain }} +# make runtime-upgrade-${{ matrix.chain }} + + + + + diff --git a/Makefile b/Makefile index 6bc77d3364..d7da5d725c 100644 --- a/Makefile +++ b/Makefile @@ -212,6 +212,32 @@ clippyfix: cargofix: cargo fix --allow-dirty --allow-staged --workspace --all-targets --all-features +#fork parachain +.PHONY: fork-parachain-litentry +fork-parachain-litentry: + @./scripts/fork-parachain-and-launch.sh litentry + +.PHONY: fork-parachain-litmus +fork-parachain-litmus: + @./scripts/fork-parachain-and-launch.sh litmus + +.PHONY: fork-parachain-rococo +fork-parachain-rococo: + @./scripts/fork-parachain-and-launch.sh rococo + +#runtime upgrade +.PHONY:runtime-upgrade-litentry +runtime-upgrade-litentry: + @./scripts/fork-parachain-and-launch.sh litentry + +.PHONY:runtime-upgrade-litmus +runtime-upgrade-litentry: + @./scripts/fork-parachain-and-launch.sh litmus + +.PHONY:runtime-upgrade-rococo +runtime-upgrade-litentry: + @./scripts/fork-parachain-and-launch.sh rococo + define pkgid $(shell cargo pkgid $1) endef diff --git a/scripts/fork-parachain-and-launch.sh b/scripts/fork-parachain-and-launch.sh index 11d74d08b6..42c46c735e 100755 --- a/scripts/fork-parachain-and-launch.sh +++ b/scripts/fork-parachain-and-launch.sh @@ -68,9 +68,8 @@ esac echo "TMPDIR is $TMPDIR" cd "$TMPDIR" -git clone "$FORK_OFF_SUBSTRATE_REPO" +git clone -b wss-fork "$FORK_OFF_SUBSTRATE_REPO" cd fork-off-substrate -git checkout wss-fork npm i mkdir data && cd data diff --git a/scripts/launch-local-binary.sh b/scripts/launch-local-binary.sh index ac4442c6ba..1123343bdb 100755 --- a/scripts/launch-local-binary.sh +++ b/scripts/launch-local-binary.sh @@ -42,7 +42,7 @@ if [ -z "$POLKADOT_BIN" ]; then # TODO: find a way to get stable download link # https://api.github.com/repos/paritytech/polkadot/releases/latest is not reliable as # polkadot could publish release which has no binary - url="https://github.com/paritytech/polkadot/releases/download/v0.9.18/polkadot" + url="https://github.com/paritytech/polkadot/releases/download/v0.9.32/polkadot" POLKADOT_BIN="$TMPDIR/polkadot" wget -O "$POLKADOT_BIN" -q "$url" chmod a+x "$POLKADOT_BIN" diff --git a/scripts/runtime-upgrade.sh b/scripts/runtime-upgrade.sh new file mode 100755 index 0000000000..246a27e4da --- /dev/null +++ b/scripts/runtime-upgrade.sh @@ -0,0 +1,89 @@ +#!/bin/bash +# set -eo we don't allow any command failed in this script. +set -eo pipefail + + +# the script is used to simulation runtime upgrade,See issue_378 for details +# https://github.com/litentry/litentry-parachain/issues/378 + +# pre-knowledge: +# Get the latest snapshot of the blockchain and export it. Start the chain locally with the obtained snapshot, +# and then run the runtime-upgrade program to check the consistency of the status before and after the upgrade. +# If the upgrade is successful, the upgrade is successful. + + +# This script should do: +# 1.new runtime.wasm is already? +# 2.upload runtime.wasm +# 3.update successful + +function usage() { + echo + echo "Usage: $0 litentry|litmus|rococo will download runtime.wasm" + echo " both are of Linux verion" +} + +CHAIN_TYPE=${1:-rococo} + + +case "$CHAIN_TYPE" in + rococo) + CHAIN_TYPE=rococo + ;; + litmus) + CHAIN_TYPE=litmus + ;; + litentry) + CHAIN_TYPE=litentry + ;; + *) + echo "unsupported chain type" + exit 1 ;; +esac + +echo "$CHAIN_TYPE" + +function print_divider() { + echo "------------------------------------------------------------" +} + +function download_new_wasm() { + echo "will download $CHAIN_TYPE runtime.wasm please wait a later ~~" + #https://github.com/litentry/litentry-parachain/releases/download/v0.9.13/rococo-parachain-runtime.compact.compressed.wasm + url="https://github.com/litentry/litentry-parachain/releases/download/v0.9.13/$CHAIN_TYPE-parachain-runtime.compact.compressed.wasm" + + echo "$url" + #NEW_WASM="$(pwd)/docker/$CHAIN_TYPE-parachain-runtime.compact.compressed.wasm" + cd "$(pwd)/docker" + wget -q "$url" + echo "right is download successful!" + +} + +download_new_wasm + + +#2. upload runtime.wasm reference ts-test register-parachain.ts +echo "register parachain now ..." +cd "$ROOTDIR/ts-tests" +echo "NODE_ENV=ci" > .env +yarn +yarn register-parachain 2>&1 | tee "$TMPDIR/register-parachain.log" +print_divider + + + + + + + + + + + + + + + + + diff --git a/ts-tests/tests/runtime-upgrade.ts b/ts-tests/tests/runtime-upgrade.ts new file mode 100644 index 0000000000..fa22e46d4f --- /dev/null +++ b/ts-tests/tests/runtime-upgrade.ts @@ -0,0 +1,49 @@ +//simulate runtime upgrad +// is a demo not impl + +import fs from 'fs'; +import '@polkadot/api-augment'; +import { ApiPromise, Keyring, WsProvider } from '@polkadot/api'; +import { TypeRegistry } from '@polkadot/types/create'; +import { Bytes } from '@polkadot/types'; + +import { loadConfig, signAndSend } from './utils'; + +async function registerParachain(api: ApiPromise, config: any) { + // Get keyring of Alice, who is also the sudo in dev chain spec + const keyring = new Keyring({ type: 'sr25519' }); + const alice = keyring.addFromUri('//Alice'); + + const genesisHeadBytes = fs.readFileSync(config.genesis_state_path, 'utf8'); + const validationCodeBytes = fs.readFileSync(config.genesis_wasm_path, 'utf8'); + + const registry = new TypeRegistry(); + + const tx = api.tx.sudo.sudo( + api.tx.parasSudoWrapper.sudoScheduleParaInitialize(process.env.PARACHAIN_ID, { + genesisHead: new Bytes(registry, genesisHeadBytes), + validationCode: new Bytes(registry, validationCodeBytes), + parachain: true, + }) + ); + + console.log(`Parachain registration tx Sent!`); + return signAndSend(tx, alice); +} + +(async () => { + console.log('Register parachain ...'); + const config = loadConfig(); + + const provider = new WsProvider(config.relaychain_ws); + const api = await ApiPromise.create({ + provider: provider, + }); + + await registerParachain(api, config); + await api.disconnect(); + provider.on('disconnected', () => { + console.log('Disconnect from relaychain'); + process.exit(0); + }); +})(); From 91a3b2d10f559c34f6e9e04fde8baa205e7b34ae Mon Sep 17 00:00:00 2001 From: SCC Date: Wed, 7 Dec 2022 15:58:19 +0800 Subject: [PATCH 07/25] runtime-upgrade ts impl --- scripts/runtime-upgrade.sh | 5 ++--- ts-tests/tests/runtime-upgrade.ts | 21 ++++++++------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/scripts/runtime-upgrade.sh b/scripts/runtime-upgrade.sh index 246a27e4da..47ad799e19 100755 --- a/scripts/runtime-upgrade.sh +++ b/scripts/runtime-upgrade.sh @@ -9,7 +9,6 @@ set -eo pipefail # pre-knowledge: # Get the latest snapshot of the blockchain and export it. Start the chain locally with the obtained snapshot, # and then run the runtime-upgrade program to check the consistency of the status before and after the upgrade. -# If the upgrade is successful, the upgrade is successful. # This script should do: @@ -64,11 +63,11 @@ download_new_wasm #2. upload runtime.wasm reference ts-test register-parachain.ts -echo "register parachain now ..." +echo "runtime upgrade now ..." cd "$ROOTDIR/ts-tests" echo "NODE_ENV=ci" > .env yarn -yarn register-parachain 2>&1 | tee "$TMPDIR/register-parachain.log" +yarn runtime-upgrade 2>&1 | tee "$TMPDIR/runtime-upgrade.log" print_divider diff --git a/ts-tests/tests/runtime-upgrade.ts b/ts-tests/tests/runtime-upgrade.ts index fa22e46d4f..6052664587 100644 --- a/ts-tests/tests/runtime-upgrade.ts +++ b/ts-tests/tests/runtime-upgrade.ts @@ -9,23 +9,18 @@ import { Bytes } from '@polkadot/types'; import { loadConfig, signAndSend } from './utils'; -async function registerParachain(api: ApiPromise, config: any) { +async function runtime_upgrade(api: ApiPromise, config: any) { // Get keyring of Alice, who is also the sudo in dev chain spec const keyring = new Keyring({ type: 'sr25519' }); const alice = keyring.addFromUri('//Alice'); - const genesisHeadBytes = fs.readFileSync(config.genesis_state_path, 'utf8'); - const validationCodeBytes = fs.readFileSync(config.genesis_wasm_path, 'utf8'); - const registry = new TypeRegistry(); - - const tx = api.tx.sudo.sudo( - api.tx.parasSudoWrapper.sudoScheduleParaInitialize(process.env.PARACHAIN_ID, { - genesisHead: new Bytes(registry, genesisHeadBytes), - validationCode: new Bytes(registry, validationCodeBytes), - parachain: true, - }) - ); + const code_path="./docker/*-parachain-runtime.compact.compressed.wasm" + const tx = api.tx.sudo.sudoUncheckWeight( + api.tx.system.setCode( + code_path + ) + ); console.log(`Parachain registration tx Sent!`); return signAndSend(tx, alice); @@ -40,7 +35,7 @@ async function registerParachain(api: ApiPromise, config: any) { provider: provider, }); - await registerParachain(api, config); + await runtime_upgrade(api, config); await api.disconnect(); provider.on('disconnected', () => { console.log('Disconnect from relaychain'); From 5bccf7a0a292e4e1154abb75dcabf8a52b9d3cb6 Mon Sep 17 00:00:00 2001 From: SCC Date: Wed, 7 Dec 2022 16:15:43 +0800 Subject: [PATCH 08/25] fix some syntax --- .../workflows/runtime-upgrade-simulation.yml | 2 +- scripts/runtime-upgrade.sh | 1 + ts-tests/tests/runtime-upgrade.ts | 23 ++++++++----------- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/runtime-upgrade-simulation.yml b/.github/workflows/runtime-upgrade-simulation.yml index 4269d91783..28257db2ff 100644 --- a/.github/workflows/runtime-upgrade-simulation.yml +++ b/.github/workflows/runtime-upgrade-simulation.yml @@ -40,7 +40,7 @@ job: - name: download-new-runtime.wasm && runtime upgrade run: # or same above add the command in makefile - @./script/runtime-upgrade.sh ${{ matrix.chain }} + ./scripts/runtime-upgrade.sh ${{ matrix.chain }} # make runtime-upgrade-${{ matrix.chain }} diff --git a/scripts/runtime-upgrade.sh b/scripts/runtime-upgrade.sh index 47ad799e19..2049f3f8e4 100755 --- a/scripts/runtime-upgrade.sh +++ b/scripts/runtime-upgrade.sh @@ -62,6 +62,7 @@ function download_new_wasm() { download_new_wasm +sleep 10 #2. upload runtime.wasm reference ts-test register-parachain.ts echo "runtime upgrade now ..." cd "$ROOTDIR/ts-tests" diff --git a/ts-tests/tests/runtime-upgrade.ts b/ts-tests/tests/runtime-upgrade.ts index 6052664587..9448d1a7c6 100644 --- a/ts-tests/tests/runtime-upgrade.ts +++ b/ts-tests/tests/runtime-upgrade.ts @@ -1,27 +1,24 @@ //simulate runtime upgrad -// is a demo not impl import fs from 'fs'; import '@polkadot/api-augment'; -import { ApiPromise, Keyring, WsProvider } from '@polkadot/api'; -import { TypeRegistry } from '@polkadot/types/create'; -import { Bytes } from '@polkadot/types'; +import {ApiPromise, Keyring, WsProvider} from '@polkadot/api'; +import {TypeRegistry} from '@polkadot/types/create'; +import {Bytes} from '@polkadot/types'; -import { loadConfig, signAndSend } from './utils'; +import {loadConfig, signAndSend} from './utils'; async function runtime_upgrade(api: ApiPromise, config: any) { // Get keyring of Alice, who is also the sudo in dev chain spec - const keyring = new Keyring({ type: 'sr25519' }); + const keyring = new Keyring({type: 'sr25519'}); const alice = keyring.addFromUri('//Alice'); - const registry = new TypeRegistry(); - const code_path="./docker/*-parachain-runtime.compact.compressed.wasm" + const code_path = "./docker/*-parachain-runtime.compact.compressed.wasm" const tx = api.tx.sudo.sudoUncheckWeight( - api.tx.system.setCode( - code_path - ) - ); - + api.tx.system.setCode( + code_path + ) + ); console.log(`Parachain registration tx Sent!`); return signAndSend(tx, alice); } From 1c0f1b2ce31c11910f5a64c7a5e78df9fdc9cddf Mon Sep 17 00:00:00 2001 From: SCC Date: Wed, 7 Dec 2022 16:52:25 +0800 Subject: [PATCH 09/25] fix makefile --- Makefile | 15 +-------------- scripts/runtime-upgrade.sh | 2 +- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index d7da5d725c..903f8c144a 100644 --- a/Makefile +++ b/Makefile @@ -212,20 +212,7 @@ clippyfix: cargofix: cargo fix --allow-dirty --allow-staged --workspace --all-targets --all-features -#fork parachain -.PHONY: fork-parachain-litentry -fork-parachain-litentry: - @./scripts/fork-parachain-and-launch.sh litentry - -.PHONY: fork-parachain-litmus -fork-parachain-litmus: - @./scripts/fork-parachain-and-launch.sh litmus - -.PHONY: fork-parachain-rococo -fork-parachain-rococo: - @./scripts/fork-parachain-and-launch.sh rococo - -#runtime upgrade +#fork parachain && runtime update .PHONY:runtime-upgrade-litentry runtime-upgrade-litentry: @./scripts/fork-parachain-and-launch.sh litentry diff --git a/scripts/runtime-upgrade.sh b/scripts/runtime-upgrade.sh index 2049f3f8e4..825242f70c 100755 --- a/scripts/runtime-upgrade.sh +++ b/scripts/runtime-upgrade.sh @@ -55,7 +55,7 @@ function download_new_wasm() { #NEW_WASM="$(pwd)/docker/$CHAIN_TYPE-parachain-runtime.compact.compressed.wasm" cd "$(pwd)/docker" wget -q "$url" - echo "right is download successful!" + echo "right download successful!" } From b74c34db97e3fc55f09ec1c92d60d9f754ec2e0b Mon Sep 17 00:00:00 2001 From: scc Date: Wed, 7 Dec 2022 17:11:02 +0800 Subject: [PATCH 10/25] optimized scripts && cli --- .github/workflows/runtime-upgrade-simulation.yml | 3 ++- scripts/runtime-upgrade.sh | 8 ++++---- ts-tests/tests/runtime-upgrade.ts | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/runtime-upgrade-simulation.yml b/.github/workflows/runtime-upgrade-simulation.yml index 28257db2ff..0ca21acca5 100644 --- a/.github/workflows/runtime-upgrade-simulation.yml +++ b/.github/workflows/runtime-upgrade-simulation.yml @@ -39,8 +39,9 @@ job: make fork-parachain-${{ matrix.chain }} - name: download-new-runtime.wasm && runtime upgrade run: + RELEASE_TAG=${{ env.RELEASE_TAG }} # or same above add the command in makefile - ./scripts/runtime-upgrade.sh ${{ matrix.chain }} + ./scripts/runtime-upgrade.sh ${{ matrix.chain }} RELEASE_TAG # make runtime-upgrade-${{ matrix.chain }} diff --git a/scripts/runtime-upgrade.sh b/scripts/runtime-upgrade.sh index 825242f70c..36ab6b5ff3 100755 --- a/scripts/runtime-upgrade.sh +++ b/scripts/runtime-upgrade.sh @@ -18,12 +18,12 @@ set -eo pipefail function usage() { echo - echo "Usage: $0 litentry|litmus|rococo will download runtime.wasm" + echo "Usage: $0 litentry|litmus|rococo [release_tag] will download runtime.wasm" echo " both are of Linux verion" } CHAIN_TYPE=${1:-rococo} - +RELEASE_TAG=${2} case "$CHAIN_TYPE" in rococo) @@ -49,10 +49,9 @@ function print_divider() { function download_new_wasm() { echo "will download $CHAIN_TYPE runtime.wasm please wait a later ~~" #https://github.com/litentry/litentry-parachain/releases/download/v0.9.13/rococo-parachain-runtime.compact.compressed.wasm - url="https://github.com/litentry/litentry-parachain/releases/download/v0.9.13/$CHAIN_TYPE-parachain-runtime.compact.compressed.wasm" + url="https://github.com/litentry/litentry-parachain/releases/download/$RELEASE_TAG/$CHAIN_TYPE-parachain-runtime.compact.compressed.wasm" echo "$url" - #NEW_WASM="$(pwd)/docker/$CHAIN_TYPE-parachain-runtime.compact.compressed.wasm" cd "$(pwd)/docker" wget -q "$url" echo "right download successful!" @@ -69,6 +68,7 @@ cd "$ROOTDIR/ts-tests" echo "NODE_ENV=ci" > .env yarn yarn runtime-upgrade 2>&1 | tee "$TMPDIR/runtime-upgrade.log" + print_divider diff --git a/ts-tests/tests/runtime-upgrade.ts b/ts-tests/tests/runtime-upgrade.ts index 9448d1a7c6..4c00ed6d33 100644 --- a/ts-tests/tests/runtime-upgrade.ts +++ b/ts-tests/tests/runtime-upgrade.ts @@ -14,7 +14,7 @@ async function runtime_upgrade(api: ApiPromise, config: any) { const alice = keyring.addFromUri('//Alice'); const code_path = "./docker/*-parachain-runtime.compact.compressed.wasm" - const tx = api.tx.sudo.sudoUncheckWeight( + const tx = api.tx.sudo.sudoUncheckedWeight( api.tx.system.setCode( code_path ) From 6cad6b34b4a98cb1cb9f62a325979318574b16e0 Mon Sep 17 00:00:00 2001 From: Kailai Wang Date: Wed, 7 Dec 2022 12:21:26 +0000 Subject: [PATCH 11/25] use master branch of fork-off-substrate --- scripts/fork-parachain-and-launch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/fork-parachain-and-launch.sh b/scripts/fork-parachain-and-launch.sh index 42c46c735e..ee56d86f37 100755 --- a/scripts/fork-parachain-and-launch.sh +++ b/scripts/fork-parachain-and-launch.sh @@ -68,7 +68,7 @@ esac echo "TMPDIR is $TMPDIR" cd "$TMPDIR" -git clone -b wss-fork "$FORK_OFF_SUBSTRATE_REPO" +git clone "$FORK_OFF_SUBSTRATE_REPO" cd fork-off-substrate npm i From 1168afe5bd20ac41871541cb6bb10cb1ec4a5d89 Mon Sep 17 00:00:00 2001 From: Scc Date: Thu, 8 Dec 2022 11:39:42 +0800 Subject: [PATCH 12/25] optimize ts code --- .../workflows/runtime-upgrade-simulation.yml | 36 ++++-- Makefile | 14 --- scripts/fork-parachain-and-launch.sh | 2 +- scripts/runtime-upgrade.sh | 61 +++------- ts-tests/package.json | 1 + ts-tests/tests/runtime-upgrade.ts | 110 +++++++++++++----- 6 files changed, 123 insertions(+), 101 deletions(-) diff --git a/.github/workflows/runtime-upgrade-simulation.yml b/.github/workflows/runtime-upgrade-simulation.yml index 0ca21acca5..fc87c06452 100644 --- a/.github/workflows/runtime-upgrade-simulation.yml +++ b/.github/workflows/runtime-upgrade-simulation.yml @@ -3,23 +3,41 @@ name: Runtime upgrade simulation on: push: branches: - - dev + - 378-GA-for-runtime-upgrade-simulation paths-ignore: - "**/dependabot.yml" - "**/README.md" pull_request: branches: - - dev + - 378-GA-for-runtime-upgrade-simulation types: - opened - reopened - synchronize - ready_for_review workflow_dispatch: + inputs: + ReLEASE_TAG: + type: string + # if the runtime-benchmarks image should be rebuilt or pulled from hub + description: rebuild-docker + required: ${{ github.event.release.tag_name }} + default: ${{ github.event.release.tag_name }} + litentry: + type: boolean + description: litentry + required: true + default: false + rococo: + type: boolean + description: rococo + required: true + default: false + env: - RELEASE_TAG: ${{ github.event.inputs.release_tag }} - DIFF_TAG: ${{ github.event.inputs.diff_tag }} +# RELEASE_TAG: ${{ github.event.release.tag_name }} + DIFF_TAG: ${{ github.event.release.diff_tag }} GENESIS_RELEASE: ${{ github.event.inputs.genesis_release }} DOCKER_BUILDKIT: 1 @@ -30,19 +48,19 @@ job: strategy: matrix: chain: - - litmus - litentry - rococo steps: - name: fork-parachain run: - make fork-parachain-${{ matrix.chain }} + ./scripts/fork-parachain-and-launch.sh ${{matrix.chain}} + - name: download-new-runtime.wasm && runtime upgrade + timeout-minutes: 10 run: RELEASE_TAG=${{ env.RELEASE_TAG }} -# or same above add the command in makefile - ./scripts/runtime-upgrade.sh ${{ matrix.chain }} RELEASE_TAG -# make runtime-upgrade-${{ matrix.chain }} + ./scripts/runtime-upgrade.sh ${{ matrix.chain }} $RELEASE_TAG + diff --git a/Makefile b/Makefile index 903f8c144a..6ed278da9c 100644 --- a/Makefile +++ b/Makefile @@ -211,20 +211,6 @@ clippyfix: .PHONY: cargofix ## cargo fix cargofix: cargo fix --allow-dirty --allow-staged --workspace --all-targets --all-features - -#fork parachain && runtime update -.PHONY:runtime-upgrade-litentry -runtime-upgrade-litentry: - @./scripts/fork-parachain-and-launch.sh litentry - -.PHONY:runtime-upgrade-litmus -runtime-upgrade-litentry: - @./scripts/fork-parachain-and-launch.sh litmus - -.PHONY:runtime-upgrade-rococo -runtime-upgrade-litentry: - @./scripts/fork-parachain-and-launch.sh rococo - define pkgid $(shell cargo pkgid $1) endef diff --git a/scripts/fork-parachain-and-launch.sh b/scripts/fork-parachain-and-launch.sh index 42c46c735e..ee56d86f37 100755 --- a/scripts/fork-parachain-and-launch.sh +++ b/scripts/fork-parachain-and-launch.sh @@ -68,7 +68,7 @@ esac echo "TMPDIR is $TMPDIR" cd "$TMPDIR" -git clone -b wss-fork "$FORK_OFF_SUBSTRATE_REPO" +git clone "$FORK_OFF_SUBSTRATE_REPO" cd fork-off-substrate npm i diff --git a/scripts/runtime-upgrade.sh b/scripts/runtime-upgrade.sh index 36ab6b5ff3..d920e18e94 100755 --- a/scripts/runtime-upgrade.sh +++ b/scripts/runtime-upgrade.sh @@ -2,7 +2,6 @@ # set -eo we don't allow any command failed in this script. set -eo pipefail - # the script is used to simulation runtime upgrade,See issue_378 for details # https://github.com/litentry/litentry-parachain/issues/378 @@ -10,7 +9,6 @@ set -eo pipefail # Get the latest snapshot of the blockchain and export it. Start the chain locally with the obtained snapshot, # and then run the runtime-upgrade program to check the consistency of the status before and after the upgrade. - # This script should do: # 1.new runtime.wasm is already? # 2.upload runtime.wasm @@ -18,72 +16,41 @@ set -eo pipefail function usage() { echo - echo "Usage: $0 litentry|litmus|rococo [release_tag] will download runtime.wasm" + echo "Usage: $0 litentry|litmus|rococo [release_tag] will download runtime.wasm && runtime upgrade" echo " both are of Linux verion" } CHAIN_TYPE=${1:-rococo} RELEASE_TAG=${2} -case "$CHAIN_TYPE" in - rococo) - CHAIN_TYPE=rococo - ;; - litmus) - CHAIN_TYPE=litmus - ;; - litentry) - CHAIN_TYPE=litentry - ;; - *) - echo "unsupported chain type" - exit 1 ;; -esac - -echo "$CHAIN_TYPE" - function print_divider() { echo "------------------------------------------------------------" } function download_new_wasm() { - echo "will download $CHAIN_TYPE runtime.wasm please wait a later ~~" - #https://github.com/litentry/litentry-parachain/releases/download/v0.9.13/rococo-parachain-runtime.compact.compressed.wasm - url="https://github.com/litentry/litentry-parachain/releases/download/$RELEASE_TAG/$CHAIN_TYPE-parachain-runtime.compact.compressed.wasm" + echo "will download $CHAIN_TYPE runtime.wasm please wait a later ~~" - echo "$url" - cd "$(pwd)/docker" - wget -q "$url" - echo "right download successful!" + url="https://github.com/litentry/litentry-parachain/releases/download/$RELEASE_TAG/$CHAIN_TYPE-parachain-runtime.compact.compressed.wasm" + echo "$url" + cd "$(pwd)/docker" + wget -q "$url" + mv $CHAIN_TYPE-parachain-runtime.compact.compressed.wasm runtime.compact.compressed.wasm + echo "right download successful!" + cd .. } download_new_wasm - sleep 10 #2. upload runtime.wasm reference ts-test register-parachain.ts -echo "runtime upgrade now ..." -cd "$ROOTDIR/ts-tests" -echo "NODE_ENV=ci" > .env +echo "simulation runtime upgrade now ..." +cd "$(pwd)/ts-tests" +echo "NODE_ENV=ci" >.env yarn yarn runtime-upgrade 2>&1 | tee "$TMPDIR/runtime-upgrade.log" print_divider - - - - - - - - - - - - - - - - +#3.succeccful +echo "simulation runtime upgrade successful!" diff --git a/ts-tests/package.json b/ts-tests/package.json index 2b5e46f97b..dac4a4543e 100644 --- a/ts-tests/package.json +++ b/ts-tests/package.json @@ -8,6 +8,7 @@ }, "scripts": { "register-parachain": "ts-node tests/register-parachain.ts", + "runtime-upgrade": "ts-node tests/runtime-upgrade.ts", "test-filter": "mocha --exit --sort -r ts-node/register 'tests/base-filter.test.ts'", "test-bridge": "mocha --exit --sort -r ts-node/register 'tests/bridge.test.ts'", "test-all": "mocha --exit --sort -r ts-node/register 'tests/**/*.test.ts'" diff --git a/ts-tests/tests/runtime-upgrade.ts b/ts-tests/tests/runtime-upgrade.ts index 4c00ed6d33..27ea85a7ad 100644 --- a/ts-tests/tests/runtime-upgrade.ts +++ b/ts-tests/tests/runtime-upgrade.ts @@ -1,41 +1,91 @@ -//simulate runtime upgrad - -import fs from 'fs'; -import '@polkadot/api-augment'; -import {ApiPromise, Keyring, WsProvider} from '@polkadot/api'; -import {TypeRegistry} from '@polkadot/types/create'; -import {Bytes} from '@polkadot/types'; +//simulate runtime upgrade +import {blake2AsHex, cryptoWaitReady} from '@polkadot/util-crypto' +import * as fs from 'fs' +import {KeyringPair} from '@polkadot/keyring/types' +import {ISubmittableResult} from '@polkadot/types/types' +import {Keyring, ApiPromise, WsProvider} from '@polkadot/api' import {loadConfig, signAndSend} from './utils'; +import '@polkadot/wasm-crypto/initOnlyAsm'; +import * as path from 'path'; + +const keyring = new Keyring({type: 'sr25519'}) -async function runtime_upgrade(api: ApiPromise, config: any) { - // Get keyring of Alice, who is also the sudo in dev chain spec - const keyring = new Keyring({type: 'sr25519'}); - const alice = keyring.addFromUri('//Alice'); - - const code_path = "./docker/*-parachain-runtime.compact.compressed.wasm" - const tx = api.tx.sudo.sudoUncheckedWeight( - api.tx.system.setCode( - code_path - ) - ); - console.log(`Parachain registration tx Sent!`); - return signAndSend(tx, alice); +export function sleep(ms: number) { + return new Promise((resolve) => { + setTimeout(resolve, ms) + }) } -(async () => { - console.log('Register parachain ...'); +async function authorizeUpgrade(admin: KeyringPair, codeHash: string) { const config = loadConfig(); - - const provider = new WsProvider(config.relaychain_ws); + const provider = new WsProvider(config.parachain_ws); const api = await ApiPromise.create({ provider: provider, }); - await runtime_upgrade(api, config); - await api.disconnect(); - provider.on('disconnected', () => { - console.log('Disconnect from relaychain'); - process.exit(0); + + await api.tx.sudo + .sudo(api.tx.parachainSystem.authorizeUpgrade(codeHash)) + .signAndSend(admin, ({events, status}: ISubmittableResult) => { + console.log('Proposal status:', status.type) + if (status.isInBlock) { + console.error('You have just upgraded your chain') + console.log('Included at block hash', status.asInBlock.toHex()) + console.log('Events:') + // @ts-ignore + console.log(JSON.stringify(events.toString(), null, 2)) + } else if (status.isFinalized) { + console.log('Finalized block hash', status.asFinalized.toHex()) + } + }) +} + +async function upgrade(admin: KeyringPair, code: string) { + + const config = loadConfig(); + const provider = new WsProvider(config.parachain_ws); + const api = await ApiPromise.create({ + provider: provider, }); -})(); + + const proposal = api.tx.parachainSystem.enactAuthorizedUpgrade(`0x${code}`) + + console.log(`Upgrading from ${admin.address}, ${code.length / 2} bytes`) + // Perform the actual chain upgrade via the sudo module + await api.tx.sudo + .sudo(proposal) + .signAndSend(admin, ({events, status}: ISubmittableResult) => { + console.log('Proposal status:', status.type) + if (status.isInBlock) { + console.error('You have just upgraded your chain') + + console.log('Included at block hash', status.asInBlock.toHex()) + console.log('Events:') + + // @ts-ignore + console.log(JSON.stringify(events.toString(), null, 2)) + } else if (status.isFinalized) { + console.log('Finalized block hash', status.asFinalized.toHex()) + } + }) + console.log(`parachain runtime upgrade ready`) + +} + +(async () => { + await cryptoWaitReady() + const wasmPath = path.resolve(`${__dirname}`, '../../docker/runtime.compact.compressed.wasm'); + + const wasm = fs.readFileSync(wasmPath) + const codeHash = blake2AsHex(wasm, 256) + console.log('wasm authorizeCode', codeHash) + const code = wasm.toString('hex') + + const admin = keyring.addFromUri('//Alice', {name: 'Alice'}) + await authorizeUpgrade(admin, codeHash) + // event + await sleep(24000) + await upgrade(admin, code) + +})().catch(console.error) From 336a8bd22e0711d1967d57cfe6f1631ecd7bc002 Mon Sep 17 00:00:00 2001 From: SCC Date: Thu, 8 Dec 2022 11:59:40 +0800 Subject: [PATCH 13/25] fix description --- .github/workflows/runtime-upgrade-simulation.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/runtime-upgrade-simulation.yml b/.github/workflows/runtime-upgrade-simulation.yml index fc87c06452..91ad14bf83 100644 --- a/.github/workflows/runtime-upgrade-simulation.yml +++ b/.github/workflows/runtime-upgrade-simulation.yml @@ -19,8 +19,7 @@ on: inputs: ReLEASE_TAG: type: string - # if the runtime-benchmarks image should be rebuilt or pulled from hub - description: rebuild-docker + description: release_tag required: ${{ github.event.release.tag_name }} default: ${{ github.event.release.tag_name }} litentry: @@ -60,9 +59,3 @@ job: run: RELEASE_TAG=${{ env.RELEASE_TAG }} ./scripts/runtime-upgrade.sh ${{ matrix.chain }} $RELEASE_TAG - - - - - - From c542e73bc29ef2ff59c3601ba9bf7b27f4399c29 Mon Sep 17 00:00:00 2001 From: Scc Date: Thu, 8 Dec 2022 12:10:10 +0800 Subject: [PATCH 14/25] fix action sytanx --- .../workflows/runtime-upgrade-simulation.yml | 36 ++++++------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/.github/workflows/runtime-upgrade-simulation.yml b/.github/workflows/runtime-upgrade-simulation.yml index 91ad14bf83..150cb3adec 100644 --- a/.github/workflows/runtime-upgrade-simulation.yml +++ b/.github/workflows/runtime-upgrade-simulation.yml @@ -1,12 +1,6 @@ name: Runtime upgrade simulation on: - push: - branches: - - 378-GA-for-runtime-upgrade-simulation - paths-ignore: - - "**/dependabot.yml" - - "**/README.md" pull_request: branches: - 378-GA-for-runtime-upgrade-simulation @@ -17,27 +11,20 @@ on: - ready_for_review workflow_dispatch: inputs: - ReLEASE_TAG: + release_tag: type: string description: release_tag required: ${{ github.event.release.tag_name }} default: ${{ github.event.release.tag_name }} - litentry: - type: boolean - description: litentry - required: true - default: false - rococo: - type: boolean - description: rococo - required: true - default: false - + inputs: + chain: + type: choice + description: The chain whose runtime upgrade + options: + - litentry + - rococo env: -# RELEASE_TAG: ${{ github.event.release.tag_name }} - DIFF_TAG: ${{ github.event.release.diff_tag }} - GENESIS_RELEASE: ${{ github.event.inputs.genesis_release }} DOCKER_BUILDKIT: 1 @@ -50,12 +37,11 @@ job: - litentry - rococo steps: - - name: fork-parachain + - name: fork-parachain-and-launch run: - ./scripts/fork-parachain-and-launch.sh ${{matrix.chain}} + ./scripts/fork-parachain-and-launch.sh ${{ github.event.inputs.chain }} - name: download-new-runtime.wasm && runtime upgrade timeout-minutes: 10 run: - RELEASE_TAG=${{ env.RELEASE_TAG }} - ./scripts/runtime-upgrade.sh ${{ matrix.chain }} $RELEASE_TAG + ./scripts/runtime-upgrade.sh ${{ github.event.inputs.chain }} ${{ github.event.release.tag_name }} \ No newline at end of file From c34f4cda80b2c008d1e6997e76834a9d3432d187 Mon Sep 17 00:00:00 2001 From: Scc Date: Thu, 8 Dec 2022 13:56:45 +0800 Subject: [PATCH 15/25] fix cli syntax --- .github/workflows/runtime-upgrade-simulation.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/runtime-upgrade-simulation.yml b/.github/workflows/runtime-upgrade-simulation.yml index 150cb3adec..08c1744ff8 100644 --- a/.github/workflows/runtime-upgrade-simulation.yml +++ b/.github/workflows/runtime-upgrade-simulation.yml @@ -1,6 +1,12 @@ -name: Runtime upgrade simulation +name: Runtime Upgrade Simulation on: + push: + branches: + - dev + paths-ignore: + - "**/dependabot.yml" + - "**/README.md" pull_request: branches: - 378-GA-for-runtime-upgrade-simulation @@ -44,4 +50,5 @@ job: - name: download-new-runtime.wasm && runtime upgrade timeout-minutes: 10 run: - ./scripts/runtime-upgrade.sh ${{ github.event.inputs.chain }} ${{ github.event.release.tag_name }} \ No newline at end of file + ./scripts/runtime-upgrade.sh ${{ github.event.inputs.chain }} ${{ github.event.release.tag_name }} + \ No newline at end of file From 92305988cdf30cc52a47fdf05fcf5ef511021200 Mon Sep 17 00:00:00 2001 From: Scc Date: Thu, 8 Dec 2022 14:03:10 +0800 Subject: [PATCH 16/25] fix cli syntax --- .editorconfig | 2 + .../workflows/runtime-upgrade-simulation.yml | 107 +++++++++--------- 2 files changed, 55 insertions(+), 54 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..874bf8b81f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,2 @@ +[*] +end_of_line = lf \ No newline at end of file diff --git a/.github/workflows/runtime-upgrade-simulation.yml b/.github/workflows/runtime-upgrade-simulation.yml index 08c1744ff8..cbcfe35dc6 100644 --- a/.github/workflows/runtime-upgrade-simulation.yml +++ b/.github/workflows/runtime-upgrade-simulation.yml @@ -1,54 +1,53 @@ -name: Runtime Upgrade Simulation - -on: - push: - branches: - - dev - paths-ignore: - - "**/dependabot.yml" - - "**/README.md" - pull_request: - branches: - - 378-GA-for-runtime-upgrade-simulation - types: - - opened - - reopened - - synchronize - - ready_for_review - workflow_dispatch: - inputs: - release_tag: - type: string - description: release_tag - required: ${{ github.event.release.tag_name }} - default: ${{ github.event.release.tag_name }} - inputs: - chain: - type: choice - description: The chain whose runtime upgrade - options: - - litentry - - rococo - -env: - DOCKER_BUILDKIT: 1 - - -job: - fork-parachain-and-launch: - run-on: ubuntu-latest - strategy: - matrix: - chain: - - litentry - - rococo - steps: - - name: fork-parachain-and-launch - run: - ./scripts/fork-parachain-and-launch.sh ${{ github.event.inputs.chain }} - - - name: download-new-runtime.wasm && runtime upgrade - timeout-minutes: 10 - run: - ./scripts/runtime-upgrade.sh ${{ github.event.inputs.chain }} ${{ github.event.release.tag_name }} - \ No newline at end of file +name: Runtime Upgrade Simulation + +on: + push: + branches: + - 378-GA-for-runtime-upgrade-simulation + paths-ignore: + - "**/dependabot.yml" + - "**/README.md" + pull_request: + branches: + - 378-GA-for-runtime-upgrade-simulation + types: + - opened + - reopened + - synchronize + - ready_for_review + workflow_dispatch: + inputs: + release_tag: + type: string + description: release_tag + required: ${{ github.event.release.tag_name }} + default: ${{ github.event.release.tag_name }} + inputs: + chain: + type: choice + description: The chain whose runtime upgrade + options: + - litentry + - rococo + +env: + DOCKER_BUILDKIT: 1 + + +job: + fork-parachain-and-launch: + run-on: ubuntu-latest + strategy: + matrix: + chain: + - litentry + - rococo + steps: + - name: fork-parachain-and-launch + run: + ./scripts/fork-parachain-and-launch.sh ${{ github.event.inputs.chain }} + + - name: download-new-runtime.wasm && runtime upgrade + timeout-minutes: 10 + run: + ./scripts/runtime-upgrade.sh ${{ github.event.inputs.chain }} ${{ github.event.release.tag_name }} From 1c203e07c01442bcd4bfb63f1d6bd18389adc6b4 Mon Sep 17 00:00:00 2001 From: Scc Date: Thu, 8 Dec 2022 14:07:48 +0800 Subject: [PATCH 17/25] fix cli syntax --- .editorconfig | 2 +- .github/workflows/runtime-upgrade-simulation.yml | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.editorconfig b/.editorconfig index 874bf8b81f..270106b1fa 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,2 +1,2 @@ [*] -end_of_line = lf \ No newline at end of file +end_of_line = lf diff --git a/.github/workflows/runtime-upgrade-simulation.yml b/.github/workflows/runtime-upgrade-simulation.yml index cbcfe35dc6..bbaf9cd294 100644 --- a/.github/workflows/runtime-upgrade-simulation.yml +++ b/.github/workflows/runtime-upgrade-simulation.yml @@ -22,13 +22,12 @@ on: description: release_tag required: ${{ github.event.release.tag_name }} default: ${{ github.event.release.tag_name }} - inputs: - chain: - type: choice - description: The chain whose runtime upgrade - options: - - litentry - - rococo + chain: + type: choice + description: The chain whose runtime upgrade + options: + - litentry + - rococo env: DOCKER_BUILDKIT: 1 From ef008d5314c3c837b7d03e3bdd2be7126c94206a Mon Sep 17 00:00:00 2001 From: Scc Date: Thu, 8 Dec 2022 14:13:52 +0800 Subject: [PATCH 18/25] fix cli syntax --- .github/workflows/runtime-upgrade-simulation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/runtime-upgrade-simulation.yml b/.github/workflows/runtime-upgrade-simulation.yml index bbaf9cd294..0831244a17 100644 --- a/.github/workflows/runtime-upgrade-simulation.yml +++ b/.github/workflows/runtime-upgrade-simulation.yml @@ -33,9 +33,9 @@ env: DOCKER_BUILDKIT: 1 -job: +jobs: fork-parachain-and-launch: - run-on: ubuntu-latest + runs-on: ubuntu-latest strategy: matrix: chain: From f9ea020e2507158245bfd0fac58b3d4d844e6f1c Mon Sep 17 00:00:00 2001 From: Scc Date: Thu, 8 Dec 2022 14:26:32 +0800 Subject: [PATCH 19/25] fix cli syntax --- .github/workflows/runtime-upgrade-simulation.yml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/.github/workflows/runtime-upgrade-simulation.yml b/.github/workflows/runtime-upgrade-simulation.yml index 0831244a17..b1a396958f 100644 --- a/.github/workflows/runtime-upgrade-simulation.yml +++ b/.github/workflows/runtime-upgrade-simulation.yml @@ -1,4 +1,4 @@ -name: Runtime Upgrade Simulation +name: Runtime upgrade on: push: @@ -15,19 +15,6 @@ on: - reopened - synchronize - ready_for_review - workflow_dispatch: - inputs: - release_tag: - type: string - description: release_tag - required: ${{ github.event.release.tag_name }} - default: ${{ github.event.release.tag_name }} - chain: - type: choice - description: The chain whose runtime upgrade - options: - - litentry - - rococo env: DOCKER_BUILDKIT: 1 @@ -50,3 +37,4 @@ jobs: timeout-minutes: 10 run: ./scripts/runtime-upgrade.sh ${{ github.event.inputs.chain }} ${{ github.event.release.tag_name }} + From 86bb7183b8135c5412c0b222e35d6163388294a1 Mon Sep 17 00:00:00 2001 From: Scc Date: Thu, 8 Dec 2022 14:28:08 +0800 Subject: [PATCH 20/25] fix cli syntax --- .../workflows/runtime-upgrade-simulation.yml | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/runtime-upgrade-simulation.yml b/.github/workflows/runtime-upgrade-simulation.yml index b1a396958f..1e52b9c586 100644 --- a/.github/workflows/runtime-upgrade-simulation.yml +++ b/.github/workflows/runtime-upgrade-simulation.yml @@ -1,20 +1,19 @@ name: Runtime upgrade on: - push: - branches: - - 378-GA-for-runtime-upgrade-simulation - paths-ignore: - - "**/dependabot.yml" - - "**/README.md" - pull_request: - branches: - - 378-GA-for-runtime-upgrade-simulation - types: - - opened - - reopened - - synchronize - - ready_for_review + workflow_dispatch: + inputs: + release_tag: + type: string + description: release_tag + required: ${{ github.event.release.tag_name }} + default: ${{ github.event.release.tag_name }} + chain: + type: choice + description: The chain whose runtime upgrade + options: + - litentry + - rococo env: DOCKER_BUILDKIT: 1 From 2553cebcee10f010ea1b18712154e9cc4b3e0560 Mon Sep 17 00:00:00 2001 From: Scc Date: Thu, 8 Dec 2022 14:30:24 +0800 Subject: [PATCH 21/25] fix cli syntax --- .github/workflows/runtime-upgrade-simulation.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/runtime-upgrade-simulation.yml b/.github/workflows/runtime-upgrade-simulation.yml index 1e52b9c586..f18c5f5cdc 100644 --- a/.github/workflows/runtime-upgrade-simulation.yml +++ b/.github/workflows/runtime-upgrade-simulation.yml @@ -3,11 +3,6 @@ name: Runtime upgrade on: workflow_dispatch: inputs: - release_tag: - type: string - description: release_tag - required: ${{ github.event.release.tag_name }} - default: ${{ github.event.release.tag_name }} chain: type: choice description: The chain whose runtime upgrade @@ -36,4 +31,3 @@ jobs: timeout-minutes: 10 run: ./scripts/runtime-upgrade.sh ${{ github.event.inputs.chain }} ${{ github.event.release.tag_name }} - From e763b4b037cc64501acebb37be978d6b635dd45a Mon Sep 17 00:00:00 2001 From: Scc Date: Thu, 8 Dec 2022 14:41:23 +0800 Subject: [PATCH 22/25] fix cli syntax --- .../workflows/runtime-upgrade-simulation.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/runtime-upgrade-simulation.yml b/.github/workflows/runtime-upgrade-simulation.yml index f18c5f5cdc..bca8f12a6a 100644 --- a/.github/workflows/runtime-upgrade-simulation.yml +++ b/.github/workflows/runtime-upgrade-simulation.yml @@ -1,8 +1,25 @@ name: Runtime upgrade on: + push: + branches: + - 378-GA-for-runtime-upgrade-simulation + paths-ignore: + - "**/dependabot.yml" + - "**/README.md" + pull_request: + branches: + - 378-GA-for-runtime-upgrade-simulation + types: + - opened + - reopened + - synchronize + - ready_for_review workflow_dispatch: inputs: + release_tag: + type: string + description: release_tag chain: type: choice description: The chain whose runtime upgrade @@ -30,4 +47,4 @@ jobs: - name: download-new-runtime.wasm && runtime upgrade timeout-minutes: 10 run: - ./scripts/runtime-upgrade.sh ${{ github.event.inputs.chain }} ${{ github.event.release.tag_name }} + ./scripts/runtime-upgrade.sh ${{ github.event.inputs.chain }} ${{ github.event.inputs.release_tag }} From 18d537e5f2301e00c59eb3fc7430ae18d23f86ad Mon Sep 17 00:00:00 2001 From: Scc Date: Fri, 9 Dec 2022 22:05:17 +0800 Subject: [PATCH 23/25] optimize ts-code & cli --- .../workflows/runtime-upgrade-simulation.yml | 41 +-- ts-tests/package.json | 4 +- ts-tests/tests/runtime-upgrade.ts | 259 ++++++++++++------ 3 files changed, 184 insertions(+), 120 deletions(-) diff --git a/.github/workflows/runtime-upgrade-simulation.yml b/.github/workflows/runtime-upgrade-simulation.yml index bca8f12a6a..4bde5a63b7 100644 --- a/.github/workflows/runtime-upgrade-simulation.yml +++ b/.github/workflows/runtime-upgrade-simulation.yml @@ -1,50 +1,37 @@ name: Runtime upgrade on: - push: - branches: - - 378-GA-for-runtime-upgrade-simulation - paths-ignore: - - "**/dependabot.yml" - - "**/README.md" - pull_request: - branches: - - 378-GA-for-runtime-upgrade-simulation - types: - - opened - - reopened - - synchronize - - ready_for_review + release: + types: [released] + workflow_dispatch: inputs: release_tag: - type: string - description: release_tag + description: runtime.wasm release_tag + default: "v0.9.13" + required: true chain: type: choice + default: rococo description: The chain whose runtime upgrade options: - litentry - rococo -env: - DOCKER_BUILDKIT: 1 - - jobs: fork-parachain-and-launch: runs-on: ubuntu-latest - strategy: - matrix: - chain: - - litentry - - rococo steps: + - name: Checkout codes on ${{ github.ref }} + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: fork-parachain-and-launch - run: + run: | ./scripts/fork-parachain-and-launch.sh ${{ github.event.inputs.chain }} - name: download-new-runtime.wasm && runtime upgrade timeout-minutes: 10 - run: + run: | ./scripts/runtime-upgrade.sh ${{ github.event.inputs.chain }} ${{ github.event.inputs.release_tag }} diff --git a/ts-tests/package.json b/ts-tests/package.json index dac4a4543e..b8206802de 100644 --- a/ts-tests/package.json +++ b/ts-tests/package.json @@ -27,8 +27,8 @@ "typescript": "^4.7.3" }, "dependencies": { - "@polkadot/api": "^9.0.1", - "@polkadot/types": "^9.0.1", + "@polkadot/api": "^9.10.1", + "@polkadot/types": "^9.10.1", "dotenv": "^16.0.1", "ethers": "^5.6.9", "web3": "^1.7.3" diff --git a/ts-tests/tests/runtime-upgrade.ts b/ts-tests/tests/runtime-upgrade.ts index 27ea85a7ad..eb2c1b5706 100644 --- a/ts-tests/tests/runtime-upgrade.ts +++ b/ts-tests/tests/runtime-upgrade.ts @@ -1,91 +1,168 @@ -//simulate runtime upgrade - -import {blake2AsHex, cryptoWaitReady} from '@polkadot/util-crypto' -import * as fs from 'fs' -import {KeyringPair} from '@polkadot/keyring/types' -import {ISubmittableResult} from '@polkadot/types/types' -import {Keyring, ApiPromise, WsProvider} from '@polkadot/api' -import {loadConfig, signAndSend} from './utils'; -import '@polkadot/wasm-crypto/initOnlyAsm'; -import * as path from 'path'; - -const keyring = new Keyring({type: 'sr25519'}) - -export function sleep(ms: number) { - return new Promise((resolve) => { - setTimeout(resolve, ms) - }) -} - -async function authorizeUpgrade(admin: KeyringPair, codeHash: string) { - const config = loadConfig(); - const provider = new WsProvider(config.parachain_ws); - const api = await ApiPromise.create({ - provider: provider, - }); - - - await api.tx.sudo - .sudo(api.tx.parachainSystem.authorizeUpgrade(codeHash)) - .signAndSend(admin, ({events, status}: ISubmittableResult) => { - console.log('Proposal status:', status.type) - if (status.isInBlock) { - console.error('You have just upgraded your chain') - console.log('Included at block hash', status.asInBlock.toHex()) - console.log('Events:') - // @ts-ignore - console.log(JSON.stringify(events.toString(), null, 2)) - } else if (status.isFinalized) { - console.log('Finalized block hash', status.asFinalized.toHex()) - } - }) -} - -async function upgrade(admin: KeyringPair, code: string) { - - const config = loadConfig(); - const provider = new WsProvider(config.parachain_ws); - const api = await ApiPromise.create({ - provider: provider, - }); - - const proposal = api.tx.parachainSystem.enactAuthorizedUpgrade(`0x${code}`) - - console.log(`Upgrading from ${admin.address}, ${code.length / 2} bytes`) - // Perform the actual chain upgrade via the sudo module - await api.tx.sudo - .sudo(proposal) - .signAndSend(admin, ({events, status}: ISubmittableResult) => { - console.log('Proposal status:', status.type) - if (status.isInBlock) { - console.error('You have just upgraded your chain') - - console.log('Included at block hash', status.asInBlock.toHex()) - console.log('Events:') - - // @ts-ignore - console.log(JSON.stringify(events.toString(), null, 2)) - } else if (status.isFinalized) { - console.log('Finalized block hash', status.asFinalized.toHex()) - } - }) - console.log(`parachain runtime upgrade ready`) - -} - -(async () => { - await cryptoWaitReady() - const wasmPath = path.resolve(`${__dirname}`, '../../docker/runtime.compact.compressed.wasm'); - - const wasm = fs.readFileSync(wasmPath) - const codeHash = blake2AsHex(wasm, 256) - console.log('wasm authorizeCode', codeHash) - const code = wasm.toString('hex') - - const admin = keyring.addFromUri('//Alice', {name: 'Alice'}) - await authorizeUpgrade(admin, codeHash) - // event - await sleep(24000) - await upgrade(admin, code) - -})().catch(console.error) +//simulate runtime upgrade + +import {blake2AsHex, cryptoWaitReady} from '@polkadot/util-crypto' +import * as fs from 'fs' +import {KeyringPair} from '@polkadot/keyring/types' +import {ISubmittableResult} from '@polkadot/types/types' +import {Keyring, ApiPromise, WsProvider} from '@polkadot/api' +import {loadConfig, signAndSend} from './utils'; +import '@polkadot/wasm-crypto/initOnlyAsm'; +import * as path from 'path'; + +const keyring = new Keyring({type: 'sr25519'}) + +export function sleep(ms: number) { + return new Promise((resolve) => { + setTimeout(resolve, ms) + }) +} + +async function authorizeUpgrade(admin: KeyringPair, codeHash: string) { + const config = loadConfig() + const provider = new WsProvider(config.parachain_ws) + const api = await ApiPromise.create({ + provider: provider, + }); + + await api.tx.sudo + .sudo(api.tx.parachainSystem.authorizeUpgrade(codeHash)) + .signAndSend(admin, ({events, status}: ISubmittableResult) => { + console.log('Proposal status:', status.type) + if (status.isInBlock) { + console.error('You have just upgraded your chain') + console.log('Included at block hash', status.asInBlock.toHex()) + console.log('Events:') + // @ts-ignore + console.log(JSON.stringify(events.toString(), null, 2)) + } else if (status.isFinalized) { + console.log('Finalized block hash', status.asFinalized.toHex()) + } + }) +} + +async function upgrade(admin: KeyringPair, code: string) { + + const config = loadConfig() + const provider = new WsProvider(config.parachain_ws) + const api = await ApiPromise.create({ + provider: provider, + }); + + const proposal = api.tx.parachainSystem.enactAuthorizedUpgrade(`0x${code}`) + + const old_version =await runtime_version(api) + + console.log(`Upgrading from ${admin.address}, ${code.length / 2} bytes`) + // Perform the actual chain upgrade via the sudo module + const tx = api.tx.sudo.sudo(proposal) + await signAndSend(tx, admin) + + console.log("tx send successful ensure the new runtime version~~ please wait a later") + + await sleep(72000) + + const new_version = await runtime_version(api) + + if (new_version.specVersion >old_version.specVersion){ + console.log("version upgrade successful") + }else{ + console.log(`old version:${old_version.toString()} new version ${new_version.toString()},runtime upgrade failed `) + } + + // send a tx verify the chain produce blocks + await transfer(api,admin) + + process.exit(0) + +} +async function runtime_version(api: ApiPromise) { + + const runtime_version = await api.call.core.version() + + return runtime_version +} + +// event +async function listenEvent( + api:ApiPromise, + filterObj: { module: string; method: string; event: string } +) { + return new Promise(async (resolve, reject) => { + let startBlock = 0; + let timeout = 10; // 10 block number timeout + const unsubscribe = await api.rpc.chain.subscribeNewHeads(async (header) => { + const currentBlockNumber = header.number.toNumber(); + if (startBlock == 0) startBlock = currentBlockNumber; + if (currentBlockNumber > startBlock + timeout) { + reject("timeout"); + return; + } + console.log(`Chain is at block: #${header.number}`); + const signedBlock = await api.rpc.chain.getBlock(header.hash); + + const allEvents = (await api.query.system.events.at( + header.hash + )); + signedBlock.block.extrinsics.forEach((ex, index) => { + if ( + !( + ex.method.section === filterObj.module && + ex.method.method === filterObj.method + ) + ) { + return; + } + allEvents + .filter(({ phase, event }) => { + return ( + phase.isApplyExtrinsic && + phase.asApplyExtrinsic.eq(index) && + event.section == filterObj.module && + event.method == filterObj.event + ); + }) + .forEach(({ event }) => { + // const eventData = event.data as AESOutput; + const data = event.data; + const eventData:string[] = []; + for (let i = 0; i < data.length; i++) { + eventData.push(); + } + resolve({ eventData }); + unsubscribe(); + return; + }); + }); + }); + }); +} + +// transfer function verify the runtime upgrade +async function transfer( + api:ApiPromise, + admin: KeyringPair, +) { + const bob = keyring.addFromUri('//Bob', {name: 'Bob'}) + const tx = await api.tx.balances + .transfer(bob.address, 1000000000000) + + await signAndSend(tx,admin) + +} + +(async () => { + await cryptoWaitReady() + const wasmPath = path.resolve(`${__dirname}`, '../../docker/runtime.compact.compressed.wasm'); + + const wasm = fs.readFileSync(wasmPath) + const codeHash = blake2AsHex(wasm, 256) + console.log('wasm authorizeCode', codeHash) + const code = wasm.toString('hex') + + const admin = keyring.addFromUri('//Alice', {name: 'Alice'}) + await authorizeUpgrade(admin, codeHash) + + await sleep(24000) + await upgrade(admin, code) + +})().catch(console.error) From d5622651275faf482343ccc645a6fab255c312fa Mon Sep 17 00:00:00 2001 From: Kailai Wang Date: Sat, 10 Dec 2022 11:51:24 +0100 Subject: [PATCH 24/25] adjustment of script and GHA --- .editorconfig | 2 - .../workflows/runtime-upgrade-simulation.yml | 37 - .../workflows/simulate-runtime-upgrade.yml | 40 ++ Makefile | 1 + scripts/runtime-upgrade.sh | 70 +- ts-tests/package.json | 4 +- ts-tests/tests/base-filter.test.ts | 4 +- ts-tests/tests/bridge.test.ts | 4 +- ts-tests/tests/runtime-upgrade.test.ts | 71 ++ ts-tests/tests/runtime-upgrade.ts | 168 ----- ts-tests/tests/setup-bridge.ts | 47 +- ts-tests/tests/utils.ts | 6 +- ts-tests/yarn.lock | 674 +++++++++--------- 13 files changed, 527 insertions(+), 601 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .github/workflows/runtime-upgrade-simulation.yml create mode 100644 .github/workflows/simulate-runtime-upgrade.yml create mode 100644 ts-tests/tests/runtime-upgrade.test.ts delete mode 100644 ts-tests/tests/runtime-upgrade.ts diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 270106b1fa..0000000000 --- a/.editorconfig +++ /dev/null @@ -1,2 +0,0 @@ -[*] -end_of_line = lf diff --git a/.github/workflows/runtime-upgrade-simulation.yml b/.github/workflows/runtime-upgrade-simulation.yml deleted file mode 100644 index 4bde5a63b7..0000000000 --- a/.github/workflows/runtime-upgrade-simulation.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Runtime upgrade - -on: - release: - types: [released] - - workflow_dispatch: - inputs: - release_tag: - description: runtime.wasm release_tag - default: "v0.9.13" - required: true - chain: - type: choice - default: rococo - description: The chain whose runtime upgrade - options: - - litentry - - rococo - -jobs: - fork-parachain-and-launch: - runs-on: ubuntu-latest - steps: - - name: Checkout codes on ${{ github.ref }} - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: fork-parachain-and-launch - run: | - ./scripts/fork-parachain-and-launch.sh ${{ github.event.inputs.chain }} - - - name: download-new-runtime.wasm && runtime upgrade - timeout-minutes: 10 - run: | - ./scripts/runtime-upgrade.sh ${{ github.event.inputs.chain }} ${{ github.event.inputs.release_tag }} diff --git a/.github/workflows/simulate-runtime-upgrade.yml b/.github/workflows/simulate-runtime-upgrade.yml new file mode 100644 index 0000000000..b992d0332b --- /dev/null +++ b/.github/workflows/simulate-runtime-upgrade.yml @@ -0,0 +1,40 @@ +name: Simulate runtime upgrade + +on: + release: + types: [released] + + workflow_dispatch: + inputs: + release_tag: + description: runtime.wasm release_tag + required: true + +env: + RELEASE_TAG: ${{ github.event.inputs.release_tag || github.event.release.tag_name }} + +jobs: + simulate-runtime-upgrade: + runs-on: ubuntu-latest + strategy: + matrix: + chain: + # litmus is not supported, as sudo was removed + # TODO: add runtime upgrade via governance + - litentry + - rococo + steps: + - name: Checkout codes on ${{ github.ref }} + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Fork ${{ matrix.chain }} and launch parachain + timeout-minutes: 10 + run: | + ./scripts/fork-parachain-and-launch.sh ${{ matrix.chain }} + + - name: Test runtime upgrade + timeout-minutes: 10 + run: | + ./scripts/runtime-upgrade.sh https://github.com/litentry/litentry-parachain/releases/download/${{ env.RELEASE_TAG }}/${{ matrix.chain }}-parachain-runtime.compact.compressed.wasm diff --git a/Makefile b/Makefile index 6ed278da9c..6bc77d3364 100644 --- a/Makefile +++ b/Makefile @@ -211,6 +211,7 @@ clippyfix: .PHONY: cargofix ## cargo fix cargofix: cargo fix --allow-dirty --allow-staged --workspace --all-targets --all-features + define pkgid $(shell cargo pkgid $1) endef diff --git a/scripts/runtime-upgrade.sh b/scripts/runtime-upgrade.sh index d920e18e94..e97a48de73 100755 --- a/scripts/runtime-upgrade.sh +++ b/scripts/runtime-upgrade.sh @@ -2,55 +2,61 @@ # set -eo we don't allow any command failed in this script. set -eo pipefail -# the script is used to simulation runtime upgrade,See issue_378 for details +ROOTDIR=$(git rev-parse --show-toplevel) + +# the script is used to simulate runtime upgrade, see: # https://github.com/litentry/litentry-parachain/issues/378 -# pre-knowledge: -# Get the latest snapshot of the blockchain and export it. Start the chain locally with the obtained snapshot, -# and then run the runtime-upgrade program to check the consistency of the status before and after the upgrade. +# The latest state of the blockchain is scraped and used to bootstrap a chain locally via fork-off-substrate, +# see ./scripts/fork-parachain-and-launch.sh +# +# After that, this script: +# 1. get the runtime wasm +# 2. do runtime upgrade using wasm from step 1 +# 3. verify if the runtime upgrade is successful -# This script should do: -# 1.new runtime.wasm is already? -# 2.upload runtime.wasm -# 3.update successful +output_wasm=/tmp/runtime.wasm function usage() { echo - echo "Usage: $0 litentry|litmus|rococo [release_tag] will download runtime.wasm && runtime upgrade" - echo " both are of Linux verion" + echo "Usage: $0 wasm-path" + echo " wasm-path can be either local file path or https URL" } -CHAIN_TYPE=${1:-rococo} -RELEASE_TAG=${2} +[ $# -ne 1 ] && (usage; exit 1) function print_divider() { echo "------------------------------------------------------------" } -function download_new_wasm() { - echo "will download $CHAIN_TYPE runtime.wasm please wait a later ~~" +print_divider - url="https://github.com/litentry/litentry-parachain/releases/download/$RELEASE_TAG/$CHAIN_TYPE-parachain-runtime.compact.compressed.wasm" +# download runtime wasm +echo "Get runtime wasm from $1" +case "$1" in + https*) + wget -q "$1" -O "$output_wasm" ;; + *) + cp -f "$1" "$output_wasm" ;; +esac - echo "$url" - cd "$(pwd)/docker" - wget -q "$url" - mv $CHAIN_TYPE-parachain-runtime.compact.compressed.wasm runtime.compact.compressed.wasm - echo "right download successful!" - cd .. -} +echo "Done" -download_new_wasm +if [ -f "$output_wasm" ]; then + ls -l "$output_wasm" +else + echo "Cannot find $output_wasm, quit" + exit 1 +fi + +print_divider -sleep 10 -#2. upload runtime.wasm reference ts-test register-parachain.ts -echo "simulation runtime upgrade now ..." -cd "$(pwd)/ts-tests" -echo "NODE_ENV=ci" >.env -yarn -yarn runtime-upgrade 2>&1 | tee "$TMPDIR/runtime-upgrade.log" +# 2. do runtime upgrade and verify +echo "Do runtime upgrade and verify ..." +cd "$ROOTDIR/ts-tests" +echo "NODE_ENV=ci" > .env +yarn && yarn test-runtime-upgrade 2>&1 print_divider -#3.succeccful -echo "simulation runtime upgrade successful!" +echo "Done" \ No newline at end of file diff --git a/ts-tests/package.json b/ts-tests/package.json index b8206802de..ddd669022a 100644 --- a/ts-tests/package.json +++ b/ts-tests/package.json @@ -8,9 +8,9 @@ }, "scripts": { "register-parachain": "ts-node tests/register-parachain.ts", - "runtime-upgrade": "ts-node tests/runtime-upgrade.ts", "test-filter": "mocha --exit --sort -r ts-node/register 'tests/base-filter.test.ts'", "test-bridge": "mocha --exit --sort -r ts-node/register 'tests/bridge.test.ts'", + "test-runtime-upgrade": "mocha --exit --sort -r ts-node/register 'tests/runtime-upgrade.test.ts'", "test-all": "mocha --exit --sort -r ts-node/register 'tests/**/*.test.ts'" }, "author": "Han Zhao", @@ -22,7 +22,7 @@ "gts": "^3.1.0", "mocha": "^10.0.0", "mocha-steps": "^1.3.0", - "prettier": "2.7.1", + "prettier": "2.8.1", "ts-node": "^10.8.1", "typescript": "^4.7.3" }, diff --git a/ts-tests/tests/base-filter.test.ts b/ts-tests/tests/base-filter.test.ts index cd46a4cc0a..8e35738ff0 100644 --- a/ts-tests/tests/base-filter.test.ts +++ b/ts-tests/tests/base-filter.test.ts @@ -41,8 +41,8 @@ describeLitentry('Test Base Filter', ``, (context) => { // only work for litentry|rococo const parachain = (await context.api.rpc.system.chain()).toString().toLowerCase(); if (parachain === 'litmus-dev') { - console.log("skip test.") - return + console.log('skip test.'); + return; } // Get the initial balance of Alice and Bob const { nonce: aliceInitNonce, data: aliceInitBalance } = await context.api.query.system.account( diff --git a/ts-tests/tests/bridge.test.ts b/ts-tests/tests/bridge.test.ts index 60267a84ec..e09f45ef67 100644 --- a/ts-tests/tests/bridge.test.ts +++ b/ts-tests/tests/bridge.test.ts @@ -23,7 +23,7 @@ describeCrossChainTransfer('Test Cross-chain Transfer', ``, (context) => { const beforeAccountData = await context.parachainConfig.api.query.system.account( context.parachainConfig.ferdie.address ); - console.log("before deposit: ", beforeAccountData.toString()) + console.log('before deposit: ', beforeAccountData.toString()); // approve await erc20.approve(context.ethConfig.erc20Handler.address, depositAmount); @@ -37,7 +37,7 @@ describeCrossChainTransfer('Test Cross-chain Transfer', ``, (context) => { const afterAccountData = await context.parachainConfig.api.query.system.account( context.parachainConfig.ferdie.address ); - console.log("after deposit: ", afterAccountData.toString()) + console.log('after deposit: ', afterAccountData.toString()); assert.equal( bn100e12.add(beforeAccountData.data.free.toBn()).toString(), diff --git a/ts-tests/tests/runtime-upgrade.test.ts b/ts-tests/tests/runtime-upgrade.test.ts new file mode 100644 index 0000000000..9124936236 --- /dev/null +++ b/ts-tests/tests/runtime-upgrade.test.ts @@ -0,0 +1,71 @@ +import { blake2AsHex, cryptoWaitReady } from '@polkadot/util-crypto'; +import * as fs from 'fs'; +import { Keyring, ApiPromise, WsProvider } from '@polkadot/api'; +import { loadConfig, describeLitentry } from './utils'; +import '@polkadot/wasm-crypto/initOnlyAsm'; +import * as path from 'path'; +import { expect } from 'chai'; +import { step } from 'mocha-steps'; + +async function getRuntimeVersion(api: ApiPromise) { + const runtime_version = await api.rpc.state.getRuntimeVersion(); + return +runtime_version['specVersion']; +} + +async function runtimeUpgrade(api: ApiPromise, wasm: string) { + const keyring = new Keyring({ type: 'sr25519' }); + const alice = keyring.addFromUri('//Alice'); + const old_runtime_version = await getRuntimeVersion(api); + let currentBlock = (await api.rpc.chain.getHeader()).number.toNumber(); + console.log(`Start doing runtime upgrade, current block = ${currentBlock}`); + + // authorize and enact the upgrade + let nonce = (await api.rpc.system.accountNextIndex(alice.address)).toNumber(); + await api.tx.sudo + .sudo(api.tx.parachainSystem.authorizeUpgrade(blake2AsHex(wasm))) + .signAndSend(alice, { nonce: -1 }); + console.log('Submitted authorizeUpgrade'); + await api.tx.parachainSystem.enactAuthorizedUpgrade(wasm).signAndSend(alice, { nonce: -1 }); + console.log('Submitted enactAuthorizedUpgrade'); + + // wait for 10 blocks + console.log('Wait for new runtime ...'); + currentBlock = (await api.rpc.chain.getHeader()).number.toNumber(); + let timeoutBlock = currentBlock + 10; + let runtimeUpgraded = false; + + return new Promise(async (resolve, reject) => { + const unsub = await api.rpc.chain.subscribeNewHeads(async (header) => { + console.log(`Polling .. block = ${header.number.toNumber()}`); + const runtime_version = await getRuntimeVersion(api); + if (!runtimeUpgraded) { + if (runtime_version > old_runtime_version) { + runtimeUpgraded = true; + console.log( + `Runtime upgrade OK, new runtime version = ${runtime_version}, waiting for 2 more blocks ...` + ); + timeoutBlock = header.number.toNumber() + 2; + } + } + if (header.number.toNumber() == timeoutBlock) { + unsub(); + if (!runtimeUpgraded) { + reject('Runtime upgrade failed with timeout'); + } else { + console.log('All good'); + resolve(runtime_version); + } + } + }); + }); +} + +describeLitentry('Runtime upgrade test', ``, (context) => { + step('Running runtime ugprade test', async function () { + const wasmPath = path.resolve('/tmp/runtime.wasm'); + const wasm = fs.readFileSync(wasmPath).toString('hex'); + const runtimeVersion = await runtimeUpgrade(context.api, `0x${wasm}`); + console.log(`result: ${runtimeVersion}`); + expect(runtimeVersion === (await getRuntimeVersion(context.api))); + }); +}); diff --git a/ts-tests/tests/runtime-upgrade.ts b/ts-tests/tests/runtime-upgrade.ts deleted file mode 100644 index eb2c1b5706..0000000000 --- a/ts-tests/tests/runtime-upgrade.ts +++ /dev/null @@ -1,168 +0,0 @@ -//simulate runtime upgrade - -import {blake2AsHex, cryptoWaitReady} from '@polkadot/util-crypto' -import * as fs from 'fs' -import {KeyringPair} from '@polkadot/keyring/types' -import {ISubmittableResult} from '@polkadot/types/types' -import {Keyring, ApiPromise, WsProvider} from '@polkadot/api' -import {loadConfig, signAndSend} from './utils'; -import '@polkadot/wasm-crypto/initOnlyAsm'; -import * as path from 'path'; - -const keyring = new Keyring({type: 'sr25519'}) - -export function sleep(ms: number) { - return new Promise((resolve) => { - setTimeout(resolve, ms) - }) -} - -async function authorizeUpgrade(admin: KeyringPair, codeHash: string) { - const config = loadConfig() - const provider = new WsProvider(config.parachain_ws) - const api = await ApiPromise.create({ - provider: provider, - }); - - await api.tx.sudo - .sudo(api.tx.parachainSystem.authorizeUpgrade(codeHash)) - .signAndSend(admin, ({events, status}: ISubmittableResult) => { - console.log('Proposal status:', status.type) - if (status.isInBlock) { - console.error('You have just upgraded your chain') - console.log('Included at block hash', status.asInBlock.toHex()) - console.log('Events:') - // @ts-ignore - console.log(JSON.stringify(events.toString(), null, 2)) - } else if (status.isFinalized) { - console.log('Finalized block hash', status.asFinalized.toHex()) - } - }) -} - -async function upgrade(admin: KeyringPair, code: string) { - - const config = loadConfig() - const provider = new WsProvider(config.parachain_ws) - const api = await ApiPromise.create({ - provider: provider, - }); - - const proposal = api.tx.parachainSystem.enactAuthorizedUpgrade(`0x${code}`) - - const old_version =await runtime_version(api) - - console.log(`Upgrading from ${admin.address}, ${code.length / 2} bytes`) - // Perform the actual chain upgrade via the sudo module - const tx = api.tx.sudo.sudo(proposal) - await signAndSend(tx, admin) - - console.log("tx send successful ensure the new runtime version~~ please wait a later") - - await sleep(72000) - - const new_version = await runtime_version(api) - - if (new_version.specVersion >old_version.specVersion){ - console.log("version upgrade successful") - }else{ - console.log(`old version:${old_version.toString()} new version ${new_version.toString()},runtime upgrade failed `) - } - - // send a tx verify the chain produce blocks - await transfer(api,admin) - - process.exit(0) - -} -async function runtime_version(api: ApiPromise) { - - const runtime_version = await api.call.core.version() - - return runtime_version -} - -// event -async function listenEvent( - api:ApiPromise, - filterObj: { module: string; method: string; event: string } -) { - return new Promise(async (resolve, reject) => { - let startBlock = 0; - let timeout = 10; // 10 block number timeout - const unsubscribe = await api.rpc.chain.subscribeNewHeads(async (header) => { - const currentBlockNumber = header.number.toNumber(); - if (startBlock == 0) startBlock = currentBlockNumber; - if (currentBlockNumber > startBlock + timeout) { - reject("timeout"); - return; - } - console.log(`Chain is at block: #${header.number}`); - const signedBlock = await api.rpc.chain.getBlock(header.hash); - - const allEvents = (await api.query.system.events.at( - header.hash - )); - signedBlock.block.extrinsics.forEach((ex, index) => { - if ( - !( - ex.method.section === filterObj.module && - ex.method.method === filterObj.method - ) - ) { - return; - } - allEvents - .filter(({ phase, event }) => { - return ( - phase.isApplyExtrinsic && - phase.asApplyExtrinsic.eq(index) && - event.section == filterObj.module && - event.method == filterObj.event - ); - }) - .forEach(({ event }) => { - // const eventData = event.data as AESOutput; - const data = event.data; - const eventData:string[] = []; - for (let i = 0; i < data.length; i++) { - eventData.push(); - } - resolve({ eventData }); - unsubscribe(); - return; - }); - }); - }); - }); -} - -// transfer function verify the runtime upgrade -async function transfer( - api:ApiPromise, - admin: KeyringPair, -) { - const bob = keyring.addFromUri('//Bob', {name: 'Bob'}) - const tx = await api.tx.balances - .transfer(bob.address, 1000000000000) - - await signAndSend(tx,admin) - -} - -(async () => { - await cryptoWaitReady() - const wasmPath = path.resolve(`${__dirname}`, '../../docker/runtime.compact.compressed.wasm'); - - const wasm = fs.readFileSync(wasmPath) - const codeHash = blake2AsHex(wasm, 256) - console.log('wasm authorizeCode', codeHash) - const code = wasm.toString('hex') - - const admin = keyring.addFromUri('//Alice', {name: 'Alice'}) - await authorizeUpgrade(admin, codeHash) - - await sleep(24000) - await upgrade(admin, code) - -})().catch(console.error) diff --git a/ts-tests/tests/setup-bridge.ts b/ts-tests/tests/setup-bridge.ts index 9499fe37da..1978d9fd3a 100644 --- a/ts-tests/tests/setup-bridge.ts +++ b/ts-tests/tests/setup-bridge.ts @@ -5,14 +5,7 @@ import { Contract, ethers, Wallet } from 'ethers'; import { BN } from '@polkadot/util'; import fs from 'fs'; import { spawn } from 'child_process'; -import { - initApiPromise, - loadConfig, - ParachainConfig, - signAndSend, - sleep, - sudoWrapper -} from './utils'; +import { initApiPromise, loadConfig, ParachainConfig, signAndSend, sleep, sudoWrapper } from './utils'; import { toWei } from 'web3-utils'; const path = require('path'); @@ -119,7 +112,7 @@ async function setupCrossChainTransfer( let opts = { gasLimit: 85000, gasPrice: 20000000000 }; const parachainFee = new BN(10).pow(new BN(12)); // 1 unit const sourceChainID = 0; //ethereum - const destChainID = parseInt(pConfig.api.consts.chainBridge.bridgeChainId.toString()) //parachain + const destChainID = parseInt(pConfig.api.consts.chainBridge.bridgeChainId.toString()); //parachain const depositNonce = await pConfig.api.query.chainBridge.votes.entries(sourceChainID); const destResourceId = pConfig.api.consts.bridgeTransfer.nativeTokenResourceId.toHex(); @@ -161,7 +154,10 @@ async function setupCrossChainTransfer( const resource = await pConfig.api.query.chainBridge.resources(destResourceId); if (resource.toHuman() !== 'BridgeTransfer.transfer') { extrinsic.push( - await sudoWrapper(pConfig.api, pConfig.api.tx.chainBridge.setResource(destResourceId, 'BridgeTransfer.transfer')) + await sudoWrapper( + pConfig.api, + pConfig.api.tx.chainBridge.setResource(destResourceId, 'BridgeTransfer.transfer') + ) ); } @@ -242,20 +238,28 @@ async function startChainBridge( require('dotenv').config(); const dataDir = './bridge/data'; if (!fs.existsSync(dataDir)) { - fs.mkdirSync(dataDir, {recursive: true}); + fs.mkdirSync(dataDir, { recursive: true }); } emptyDir(dataDir); const ethBlock = await ethConfig.wallets.bob.provider.getBlockNumber(); const subBlock = await parachainConfig.api.rpc.chain.getHeader(); - const parachainChainID = parseInt(parachainConfig.api.consts.chainBridge.bridgeChainId.toString()) //parachain - - generateBridgeConfig(ethConfig, ethRelayer, parachainRelayer, ethBlock, subBlock.number.toNumber(), parachainChainID, config); - const logging = fs.createWriteStream(log, {flags: 'w+'}); + const parachainChainID = parseInt(parachainConfig.api.consts.chainBridge.bridgeChainId.toString()); //parachain + + generateBridgeConfig( + ethConfig, + ethRelayer, + parachainRelayer, + ethBlock, + subBlock.number.toNumber(), + parachainChainID, + config + ); + const logging = fs.createWriteStream(log, { flags: 'w+' }); const lsProcess = spawn( // `${process.env.GOPATH}/bin/chainbridge`, bridgePath, ['--verbosity', 'trace', '--blockstore', dataDir, '--config', config, '--keystore', './bridge/keys'], - {env: {STAGE: 'dev'}} + { env: { STAGE: 'dev' } } ); lsProcess.stdout.pipe(logging); lsProcess.stderr.pipe(logging); @@ -303,13 +307,7 @@ export function describeCrossChainTransfer( dave: new ethers.Wallet(generateTestKeys().dave, provider), eve: new ethers.Wallet(generateTestKeys().eve, provider), }; - const { - bridge, - erc20Handler, - erc721Handler, - genericHandler, - erc20 - } = await deployBridgeContracts( + const { bridge, erc20Handler, erc721Handler, genericHandler, erc20 } = await deployBridgeContracts( wallets.alice ); @@ -344,8 +342,7 @@ export function describeCrossChainTransfer( await sleep(5); }); - after(async function () { - }); + after(async function () {}); cb(context); }); diff --git a/ts-tests/tests/utils.ts b/ts-tests/tests/utils.ts index 8a17a72a24..dd9bec546c 100644 --- a/ts-tests/tests/utils.ts +++ b/ts-tests/tests/utils.ts @@ -107,9 +107,9 @@ export function signAndSend(tx: SubmittableExtrinsic, account: Address export async function sudoWrapper(api: ApiPromise, tx: SubmittableExtrinsic) { const chain = (await api.rpc.system.chain()).toString().toLowerCase(); if (chain == 'litmus-dev') { - const threshold = api.createType("Compact", 1); - const call = api.createType("Call", tx); - return api.tx.council.propose(threshold, call, api.createType("Compact", tx.length)) + const threshold = api.createType('Compact', 1); + const call = api.createType('Call', tx); + return api.tx.council.propose(threshold, call, api.createType('Compact', tx.length)); } else { return api.tx.sudo.sudo(tx); } diff --git a/ts-tests/yarn.lock b/ts-tests/yarn.lock index 0bf70a398f..40cfa6d1aa 100644 --- a/ts-tests/yarn.lock +++ b/ts-tests/yarn.lock @@ -30,12 +30,12 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/runtime@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a" - integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw== +"@babel/runtime@^7.20.6": + version "7.20.6" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.6.tgz#facf4879bfed9b5326326273a64220f099b0fce3" + integrity sha512-Q+8MqP7TiHMWzSfwiJwXCjyf4GYA4Dgw3emg/7xmwsdLJOZUp+nMqcOwOzzYheuM1rhDu8FSj2l0aoMygEuXuA== dependencies: - regenerator-runtime "^0.13.4" + regenerator-runtime "^0.13.11" "@cspotcode/source-map-support@^0.8.0": version "0.8.1" @@ -624,15 +624,15 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@noble/hashes@1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.2.tgz#e9e035b9b166ca0af657a7848eb2718f0f22f183" - integrity sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA== +"@noble/hashes@1.1.3": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.3.tgz#360afc77610e0a61f3417e497dcf36862e4f8111" + integrity sha512-CE0FCR57H2acVI5UOzIGSSIYxZ6v/HOhDR0Ro9VLyhnzLwx0o8W1mmgaqlEUx4049qJDlIBRztv5k+MM8vbO3A== -"@noble/secp256k1@1.6.3": - version "1.6.3" - resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.6.3.tgz#7eed12d9f4404b416999d0c87686836c4c5c9b94" - integrity sha512-T04e4iTurVy7I8Sw4+c5OSN9/RkPlo1uKxAomtxQNLq8j1uPAqnsqG1bqvY3Jv7c13gyr6dui0zmh/I3+f/JaQ== +"@noble/secp256k1@1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.0.tgz#d15357f7c227e751d90aa06b05a0e5cf993ba8c1" + integrity sha512-kbacwGSsH/CTout0ZnZWxnW1B+jH/7r/WAAKLBtrRJ/+CUH7lgmQzl3GTrQua3SGKWNSDsS6lmjnDpIJ5Dxyaw== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -655,328 +655,328 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@polkadot/api-augment@9.0.1": - version "9.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/api-augment/-/api-augment-9.0.1.tgz#2f7bbe7be51dc83dcf3fb1deb17bdf23850cf389" - integrity sha512-WAJYH58kXUBHmwAG2mUJPo+yW4CkQwHVsz8qSNtb+qTC1KHUIrrX8f/AltC8yXsw5xWOYUfUBuyJdkzSEJNPwQ== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/api-base" "9.0.1" - "@polkadot/rpc-augment" "9.0.1" - "@polkadot/types" "9.0.1" - "@polkadot/types-augment" "9.0.1" - "@polkadot/types-codec" "9.0.1" - "@polkadot/util" "^10.1.2" - -"@polkadot/api-base@9.0.1": - version "9.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/api-base/-/api-base-9.0.1.tgz#c730560103797bcf5db155a8a35ac73d2290d604" - integrity sha512-cPBSMQyxD2i8ItueN0TOY/KZf00rhsrO3hxdDT4UHZmnLQdgfxs6iBBk7yEBpchXXVRPxyjaTU0Yb6BCaYrscQ== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/rpc-core" "9.0.1" - "@polkadot/types" "9.0.1" - "@polkadot/util" "^10.1.2" - rxjs "^7.5.6" - -"@polkadot/api-derive@9.0.1": - version "9.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-9.0.1.tgz#7a9fda743e9dc56da0182cf08a362d4f329b6956" - integrity sha512-KeuDkZZ9Qz05KEllX6hRkW4zk3YDJpWCMWaK2uw2i7ZdwbiCq11F9rHysNWAfBOYqOKAi4wvg0Ad6V1xNcSalg== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/api" "9.0.1" - "@polkadot/api-augment" "9.0.1" - "@polkadot/api-base" "9.0.1" - "@polkadot/rpc-core" "9.0.1" - "@polkadot/types" "9.0.1" - "@polkadot/types-codec" "9.0.1" - "@polkadot/util" "^10.1.2" - "@polkadot/util-crypto" "^10.1.2" - rxjs "^7.5.6" - -"@polkadot/api@9.0.1", "@polkadot/api@^9.0.1": - version "9.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-9.0.1.tgz#01cf33f9b4e48f37902adf03d6bdcfb55154d6a7" - integrity sha512-t34FM5Q6WpeQ6yuhOXkUk8uBrcmr1Z3IYHkt7dOBLTVfim0+zIkhCU+fVWo2pOZCmF12993Wkg7QWqgXlh86xA== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/api-augment" "9.0.1" - "@polkadot/api-base" "9.0.1" - "@polkadot/api-derive" "9.0.1" - "@polkadot/keyring" "^10.1.2" - "@polkadot/rpc-augment" "9.0.1" - "@polkadot/rpc-core" "9.0.1" - "@polkadot/rpc-provider" "9.0.1" - "@polkadot/types" "9.0.1" - "@polkadot/types-augment" "9.0.1" - "@polkadot/types-codec" "9.0.1" - "@polkadot/types-create" "9.0.1" - "@polkadot/types-known" "9.0.1" - "@polkadot/util" "^10.1.2" - "@polkadot/util-crypto" "^10.1.2" +"@polkadot/api-augment@9.10.2": + version "9.10.2" + resolved "https://registry.yarnpkg.com/@polkadot/api-augment/-/api-augment-9.10.2.tgz#9d1875bffe9d8677a4f03d53ca6df3d0d7e7f53d" + integrity sha512-B0xC7yvPAZqPZpKJzrlFSDfHBawCJISwdV4/nBSs1/AaqQIXVu2ZqPUaSdq7eisZL/EZziptK0SpCtDcb6LpAg== + dependencies: + "@babel/runtime" "^7.20.6" + "@polkadot/api-base" "9.10.2" + "@polkadot/rpc-augment" "9.10.2" + "@polkadot/types" "9.10.2" + "@polkadot/types-augment" "9.10.2" + "@polkadot/types-codec" "9.10.2" + "@polkadot/util" "^10.2.1" + +"@polkadot/api-base@9.10.2": + version "9.10.2" + resolved "https://registry.yarnpkg.com/@polkadot/api-base/-/api-base-9.10.2.tgz#39248e966b468ecff7c0ed00bb61dfca14ca99d4" + integrity sha512-M/Yushqk6eEAfbkF90vy3GCVg+a2uVeSXyTBKbmkjZtcE7x39GiXs7LOJuYkIim51hlwcvVSeInX8HufwnTUMw== + dependencies: + "@babel/runtime" "^7.20.6" + "@polkadot/rpc-core" "9.10.2" + "@polkadot/types" "9.10.2" + "@polkadot/util" "^10.2.1" + rxjs "^7.6.0" + +"@polkadot/api-derive@9.10.2": + version "9.10.2" + resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-9.10.2.tgz#d6b0eb558ee057416b87a304ca2790b19afa4be6" + integrity sha512-Ut1aqbGvqAkxXq7M4HgJ7BVhUyfbQigqt5LISmnjWdGkhroBxtIJ24saOUPYNr0O/c3jocJpoWqGK2CuucL81w== + dependencies: + "@babel/runtime" "^7.20.6" + "@polkadot/api" "9.10.2" + "@polkadot/api-augment" "9.10.2" + "@polkadot/api-base" "9.10.2" + "@polkadot/rpc-core" "9.10.2" + "@polkadot/types" "9.10.2" + "@polkadot/types-codec" "9.10.2" + "@polkadot/util" "^10.2.1" + "@polkadot/util-crypto" "^10.2.1" + rxjs "^7.6.0" + +"@polkadot/api@9.10.2", "@polkadot/api@^9.10.1": + version "9.10.2" + resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-9.10.2.tgz#9a3132f0c8a5de6c2b7d56f9d9e9c9c5ed2bc77e" + integrity sha512-5leF7rxwRkkd/g11tGPho/CcbInVX7ZiuyMsLMTwn+2PDX+Ggv/gmxUboa34eyeLp8/AMui5YbqRD4QExLTxqw== + dependencies: + "@babel/runtime" "^7.20.6" + "@polkadot/api-augment" "9.10.2" + "@polkadot/api-base" "9.10.2" + "@polkadot/api-derive" "9.10.2" + "@polkadot/keyring" "^10.2.1" + "@polkadot/rpc-augment" "9.10.2" + "@polkadot/rpc-core" "9.10.2" + "@polkadot/rpc-provider" "9.10.2" + "@polkadot/types" "9.10.2" + "@polkadot/types-augment" "9.10.2" + "@polkadot/types-codec" "9.10.2" + "@polkadot/types-create" "9.10.2" + "@polkadot/types-known" "9.10.2" + "@polkadot/util" "^10.2.1" + "@polkadot/util-crypto" "^10.2.1" eventemitter3 "^4.0.7" - rxjs "^7.5.6" - -"@polkadot/keyring@^10.1.2": - version "10.1.2" - resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-10.1.2.tgz#a7e70bd091d2ceb48e7fee005cc3dbe6cf8c8d32" - integrity sha512-b6hP3JFGYjsNNT3NO7I8fWRPqovgL4IvjvLttkfzpM6eM1zRRupqQ+Q50Jdl/3YUcr26PcxQcdRqJku4WyDABg== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/util" "10.1.2" - "@polkadot/util-crypto" "10.1.2" - -"@polkadot/networks@10.1.2", "@polkadot/networks@^10.1.2": - version "10.1.2" - resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-10.1.2.tgz#a42c93c5dd1f56b99ca50ec9d4e8076088148086" - integrity sha512-67ZPqdhLYDGNX1jMEa3+hujh9j30Dr9AdqgdjE8Z3GdWoEVRp9Zda3DXMnDIQlRBQ32pRZty7dFhIq61Bv/whQ== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/util" "10.1.2" - "@substrate/ss58-registry" "^1.25.0" - -"@polkadot/rpc-augment@9.0.1": - version "9.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-augment/-/rpc-augment-9.0.1.tgz#1ad3ead609855d6ddeb278f6d841508dfe2f9ca1" - integrity sha512-Oe8O65K3zlameCxMHklEj42Xx3oRfk8+6tyhUc4L5DHutDv0jNwiT8CvvDf49nKyZFNjfnD6EOR84ikMzUf/0g== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/rpc-core" "9.0.1" - "@polkadot/types" "9.0.1" - "@polkadot/types-codec" "9.0.1" - "@polkadot/util" "^10.1.2" - -"@polkadot/rpc-core@9.0.1": - version "9.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-9.0.1.tgz#14e67905d7d0e549fa3c9b090e0551303226d2a6" - integrity sha512-pXuPiPdObpOASNuwl9BpS2jD6K+eLltTwnZjUQkBaNoxgQgQ01YWHHJVDSbRyap1HL886vtR07WHejzMaOgWmg== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/rpc-augment" "9.0.1" - "@polkadot/rpc-provider" "9.0.1" - "@polkadot/types" "9.0.1" - "@polkadot/util" "^10.1.2" - rxjs "^7.5.6" - -"@polkadot/rpc-provider@9.0.1": - version "9.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-9.0.1.tgz#b2f3fd561ad1c61c094441e2aa79294f58b3df76" - integrity sha512-AiyULOrJoBbH2hEfcKrCKz6Mf3/o+SO3dwL8+MKcehAj4ExaX6alcPgZnYWYz8Xl2cnZ8Kc0T/xg2emu+7gFBA== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/keyring" "^10.1.2" - "@polkadot/types" "9.0.1" - "@polkadot/types-support" "9.0.1" - "@polkadot/util" "^10.1.2" - "@polkadot/util-crypto" "^10.1.2" - "@polkadot/x-fetch" "^10.1.2" - "@polkadot/x-global" "^10.1.2" - "@polkadot/x-ws" "^10.1.2" - "@substrate/connect" "0.7.9" + rxjs "^7.6.0" + +"@polkadot/keyring@^10.2.1": + version "10.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-10.2.1.tgz#692d4e24dcbbe294b6945640802fc924ea20348e" + integrity sha512-84/zzxDZANQ4AfsCT1vrjX3I23/mj9WUWl1F7q9ruK6UBFyGsl46Y3ABOopFHij9UXhppndhB65IeDnqoOKqxQ== + dependencies: + "@babel/runtime" "^7.20.6" + "@polkadot/util" "10.2.1" + "@polkadot/util-crypto" "10.2.1" + +"@polkadot/networks@10.2.1", "@polkadot/networks@^10.2.1": + version "10.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-10.2.1.tgz#5095011795afa20291ef3e34a2ad38ed2c63fe09" + integrity sha512-cDZIY4jBo2tlDdSXNbECpuWer0NWlPcJNhHHveTiu2idje2QyIBNxBlAPViNGpz+ScAR0EknEzmQKuHOcSKxzg== + dependencies: + "@babel/runtime" "^7.20.6" + "@polkadot/util" "10.2.1" + "@substrate/ss58-registry" "^1.35.0" + +"@polkadot/rpc-augment@9.10.2": + version "9.10.2" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-augment/-/rpc-augment-9.10.2.tgz#5650aa118d39d0c4b17425a9b327354f7bbf99e5" + integrity sha512-LrGzpSdkqXltZDwuBeBBMev68eVVN1GpgV4auEAytgDYYcjI9XDaeLZm7vUVx9aBO8OYz9hQZeHrWrab/FaKmg== + dependencies: + "@babel/runtime" "^7.20.6" + "@polkadot/rpc-core" "9.10.2" + "@polkadot/types" "9.10.2" + "@polkadot/types-codec" "9.10.2" + "@polkadot/util" "^10.2.1" + +"@polkadot/rpc-core@9.10.2": + version "9.10.2" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-9.10.2.tgz#72362d26012c53397c1079912d5d4aacf910a650" + integrity sha512-qr+q2R3YeRBC++bYxK292jb6t9/KXeLoRheW5z7LbYyre3J60vZPN7WxPxbwm+iCGk1VtvH80Dv1OSCoVC+7hA== + dependencies: + "@babel/runtime" "^7.20.6" + "@polkadot/rpc-augment" "9.10.2" + "@polkadot/rpc-provider" "9.10.2" + "@polkadot/types" "9.10.2" + "@polkadot/util" "^10.2.1" + rxjs "^7.6.0" + +"@polkadot/rpc-provider@9.10.2": + version "9.10.2" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-9.10.2.tgz#83c8e114b3aad75eedaf98a374bc77a2b8cc1dbc" + integrity sha512-mm8l1uZ7DOrsMUN+DELS8apyZVVNIy/SrqEBjHZeZ0AA9noAEbH4ubxR375lG/T32+T97mFudv1rxRnEwXqByg== + dependencies: + "@babel/runtime" "^7.20.6" + "@polkadot/keyring" "^10.2.1" + "@polkadot/types" "9.10.2" + "@polkadot/types-support" "9.10.2" + "@polkadot/util" "^10.2.1" + "@polkadot/util-crypto" "^10.2.1" + "@polkadot/x-fetch" "^10.2.1" + "@polkadot/x-global" "^10.2.1" + "@polkadot/x-ws" "^10.2.1" + "@substrate/connect" "0.7.17" eventemitter3 "^4.0.7" mock-socket "^9.1.5" nock "^13.2.9" -"@polkadot/types-augment@9.0.1": - version "9.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-augment/-/types-augment-9.0.1.tgz#d4bb14284ead28aaeaf69191a8664e08df2d9bab" - integrity sha512-TqpXzcrPqdKhkxHlN97Ua6P6R6XTuDcrInj1o0hgcLc+SabyIgXw7xmR6PMtrBPkehatdnyeLn5hjwh2MklOCQ== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/types" "9.0.1" - "@polkadot/types-codec" "9.0.1" - "@polkadot/util" "^10.1.2" - -"@polkadot/types-codec@9.0.1": - version "9.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-codec/-/types-codec-9.0.1.tgz#bffa8b6d1b7c344c0d49b91391572ba4f70aaa93" - integrity sha512-14cTwi85Sg+w8j6jDplNzZ7Y+s25G3w10YuwSb8QmKH5RhipLry87mtbO9VxreeBE6hP/Ib6BrkushZOWxFLPQ== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/util" "^10.1.2" - "@polkadot/x-bigint" "^10.1.2" - -"@polkadot/types-create@9.0.1": - version "9.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-create/-/types-create-9.0.1.tgz#b49cea1635969511c8cf12e00b3b602dcbdd2e18" - integrity sha512-SjKekEKvNdfpcWkFi4sngZdnunm/LK7Pcvf7uk+dRnGrrW7e7m741yD9O/1848ww60bL5OFzVovS99Gw4lFrxg== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/types-codec" "9.0.1" - "@polkadot/util" "^10.1.2" - -"@polkadot/types-known@9.0.1": - version "9.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-9.0.1.tgz#08efc467c2c4b8d45000df2d20cf3cc3eedff001" - integrity sha512-NU2cb2ww7Z8PM2n2l/gB04yxj2RduN7bHEXNWRzpJpaOX+yeqKaHGlQ+IOLwGftNLpbit4xycxnJeDjrDkYLAA== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/networks" "^10.1.2" - "@polkadot/types" "9.0.1" - "@polkadot/types-codec" "9.0.1" - "@polkadot/types-create" "9.0.1" - "@polkadot/util" "^10.1.2" - -"@polkadot/types-support@9.0.1": - version "9.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/types-support/-/types-support-9.0.1.tgz#08b5ea8f85827cea754f7cb8f09cdf66881ec740" - integrity sha512-wXGQSdV+wEdvWWhcU6Hd73zpCwqPYEYDqiNRdWcPneLTBg6GHtyLTJkIzeOoZCLR4XZUNeioB9f6ZaxOv1eTVg== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/util" "^10.1.2" - -"@polkadot/types@9.0.1", "@polkadot/types@^9.0.1": - version "9.0.1" - resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-9.0.1.tgz#6213d52b7cd7c762bffbc171bf059e0e2af506f0" - integrity sha512-CYiUqK6DR0AI5sCB441QRKlab9KtGwyaiFUzy4mrxofmmZrBiYh+RZgTl2Jcl1B5YZmNDvaHHRaZPtqLadhp/w== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/keyring" "^10.1.2" - "@polkadot/types-augment" "9.0.1" - "@polkadot/types-codec" "9.0.1" - "@polkadot/types-create" "9.0.1" - "@polkadot/util" "^10.1.2" - "@polkadot/util-crypto" "^10.1.2" - rxjs "^7.5.6" - -"@polkadot/util-crypto@10.1.2", "@polkadot/util-crypto@^10.1.2": - version "10.1.2" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-10.1.2.tgz#60779ad64e79542a06302ae7d9a2515482b563f4" - integrity sha512-lSgxSLF/XkksL8St3kyw8SCLic0JvyIf8uOezQZYyjSJKT3Gl8gGu9wCAKNAmboU0FgO8cnLO9AcAEkhCHvnyw== - dependencies: - "@babel/runtime" "^7.18.9" - "@noble/hashes" "1.1.2" - "@noble/secp256k1" "1.6.3" - "@polkadot/networks" "10.1.2" - "@polkadot/util" "10.1.2" - "@polkadot/wasm-crypto" "^6.3.1" - "@polkadot/x-bigint" "10.1.2" - "@polkadot/x-randomvalues" "10.1.2" +"@polkadot/types-augment@9.10.2": + version "9.10.2" + resolved "https://registry.yarnpkg.com/@polkadot/types-augment/-/types-augment-9.10.2.tgz#2dce4ea8a2879d248339ad377ff5479fae884cd5" + integrity sha512-z0M3bAwGi0pGS3ieXyiJZLzDEc5yBvlqaZvaAbf2r+vto83SylhbjjG1wX8ARI5hqptBUWqS9BssUFH0q6l4sg== + dependencies: + "@babel/runtime" "^7.20.6" + "@polkadot/types" "9.10.2" + "@polkadot/types-codec" "9.10.2" + "@polkadot/util" "^10.2.1" + +"@polkadot/types-codec@9.10.2": + version "9.10.2" + resolved "https://registry.yarnpkg.com/@polkadot/types-codec/-/types-codec-9.10.2.tgz#7f0e33c33292bdfcd959945b2427742b941df712" + integrity sha512-zQOPzxq2N6PUP6Gkxc3OVT7Ub8AD3qC0PBeCnc/fhKjgX3CoKQK4TC6tDL8pEaaIVFh4LOHlHvhWJhqaUNe95A== + dependencies: + "@babel/runtime" "^7.20.6" + "@polkadot/util" "^10.2.1" + "@polkadot/x-bigint" "^10.2.1" + +"@polkadot/types-create@9.10.2": + version "9.10.2" + resolved "https://registry.yarnpkg.com/@polkadot/types-create/-/types-create-9.10.2.tgz#eb7dbf5f50eb4d01a965347d324de26a679a25e3" + integrity sha512-U6wDaJe8tZmt0WibxWeDFYVKfvOYa2su8xOwg8HTRraijF6k0/OMugb15bpjEkG6RZ1qg1L7oKrKghugVbRDGQ== + dependencies: + "@babel/runtime" "^7.20.6" + "@polkadot/types-codec" "9.10.2" + "@polkadot/util" "^10.2.1" + +"@polkadot/types-known@9.10.2": + version "9.10.2" + resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-9.10.2.tgz#d37d984eed6aa17b33603aca9f9d006d6eb468cb" + integrity sha512-Kwxoo+xvAAE1w0jZdGqmNoEJHdfJzncO1xrBJ7WjeCuEFoDsWmjP63u/o8VaC1ZNnfrhjRK0vyvquslJ6NQOUA== + dependencies: + "@babel/runtime" "^7.20.6" + "@polkadot/networks" "^10.2.1" + "@polkadot/types" "9.10.2" + "@polkadot/types-codec" "9.10.2" + "@polkadot/types-create" "9.10.2" + "@polkadot/util" "^10.2.1" + +"@polkadot/types-support@9.10.2": + version "9.10.2" + resolved "https://registry.yarnpkg.com/@polkadot/types-support/-/types-support-9.10.2.tgz#eff0ef399a3373421a543059f62ca96b85645f0b" + integrity sha512-RQSCNNBH8+mzXbErB/LUDU9oMQScv0GZ4UmM2MPDPKBcqXNCdJ4dK+ajNfVbgGTUucYUEebpp2m5Az1usjE4Ew== + dependencies: + "@babel/runtime" "^7.20.6" + "@polkadot/util" "^10.2.1" + +"@polkadot/types@9.10.2", "@polkadot/types@^9.10.1": + version "9.10.2" + resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-9.10.2.tgz#1f6647445b055856bdbd949106f698c89a125386" + integrity sha512-B5Bg/IaAMJEwdWzGp3pil5WBukr5fm9x9NFIMuoCS9TyIqpm9rSHrz2n/408R3B4rwqqtx8RQAxiIETFI+m6Rw== + dependencies: + "@babel/runtime" "^7.20.6" + "@polkadot/keyring" "^10.2.1" + "@polkadot/types-augment" "9.10.2" + "@polkadot/types-codec" "9.10.2" + "@polkadot/types-create" "9.10.2" + "@polkadot/util" "^10.2.1" + "@polkadot/util-crypto" "^10.2.1" + rxjs "^7.6.0" + +"@polkadot/util-crypto@10.2.1", "@polkadot/util-crypto@^10.2.1": + version "10.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-10.2.1.tgz#f6ce1c81496336ca50c2ca84975bcde79aa16634" + integrity sha512-UH1J4oD92gkLXMfVTLee3Y2vYadNyp1lmS4P2nZwQ0SOzGZ4rN7khD2CrB1cXS9WPq196Zb5oZdGLnPYnXHtjw== + dependencies: + "@babel/runtime" "^7.20.6" + "@noble/hashes" "1.1.3" + "@noble/secp256k1" "1.7.0" + "@polkadot/networks" "10.2.1" + "@polkadot/util" "10.2.1" + "@polkadot/wasm-crypto" "^6.4.1" + "@polkadot/x-bigint" "10.2.1" + "@polkadot/x-randomvalues" "10.2.1" "@scure/base" "1.1.1" ed2curve "^0.3.0" tweetnacl "^1.0.3" -"@polkadot/util@10.1.2", "@polkadot/util@^10.1.2": - version "10.1.2" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-10.1.2.tgz#2eded0c159c16c4a3c48ff45c4ced05c62fb4660" - integrity sha512-gYSpJyrrw5gZWgTVu6PJ1PBUzi3GqwmaK6XRgi4deHmQRn9TEXTToGtHmleJWnaTCRW8Vvh5B5RNNV2C/+va4w== - dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-bigint" "10.1.2" - "@polkadot/x-global" "10.1.2" - "@polkadot/x-textdecoder" "10.1.2" - "@polkadot/x-textencoder" "10.1.2" - "@types/bn.js" "^5.1.0" +"@polkadot/util@10.2.1", "@polkadot/util@^10.2.1": + version "10.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-10.2.1.tgz#a8c3a4fe87091197448bec70f7ea079b60d5abf6" + integrity sha512-ewGKSOp+VXKEeCvpCCP2Qqi/FVkewBF9vb/N8pRwuNQ2XE9k1lnsOZZeQemVBDhKsZz+h3IeNcWejaF6K3vYHQ== + dependencies: + "@babel/runtime" "^7.20.6" + "@polkadot/x-bigint" "10.2.1" + "@polkadot/x-global" "10.2.1" + "@polkadot/x-textdecoder" "10.2.1" + "@polkadot/x-textencoder" "10.2.1" + "@types/bn.js" "^5.1.1" bn.js "^5.2.1" -"@polkadot/wasm-bridge@6.3.1": - version "6.3.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-bridge/-/wasm-bridge-6.3.1.tgz#439fa78e80947a7cb695443e1f64b25c30bb1487" - integrity sha512-1TYkHsb9AEFhU9uZj3biEnN2yKQNzdrwSjiTvfCYnt97pnEkKsZI6cku+YPZQv5w/x9CQa5Yua9e2DVVZSivGA== +"@polkadot/wasm-bridge@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-bridge/-/wasm-bridge-6.4.1.tgz#e97915dd67ba543ec3381299c2a5b9330686e27e" + integrity sha512-QZDvz6dsUlbYsaMV5biZgZWkYH9BC5AfhT0f0/knv8+LrbAoQdP3Asbvddw8vyU9sbpuCHXrd4bDLBwUCRfrBQ== dependencies: - "@babel/runtime" "^7.18.9" + "@babel/runtime" "^7.20.6" -"@polkadot/wasm-crypto-asmjs@6.3.1": - version "6.3.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-6.3.1.tgz#e8f469c9cf4a7709c8131a96f857291953f3e30a" - integrity sha512-zbombRfA5v/mUWQQhgg2YwaxhRmxRIrvskw65x+lruax3b6xPBFDs7yplopiJU3r8h2pTgQvX/DUksvqz2TCRQ== +"@polkadot/wasm-crypto-asmjs@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-6.4.1.tgz#3cc76bbda5ea4a7a860982c64f9565907b312253" + integrity sha512-UxZTwuBZlnODGIQdCsE2Sn/jU0O2xrNQ/TkhRFELfkZXEXTNu4lw6NpaKq7Iey4L+wKd8h4lT3VPVkMcPBLOvA== dependencies: - "@babel/runtime" "^7.18.9" + "@babel/runtime" "^7.20.6" -"@polkadot/wasm-crypto-init@6.3.1": - version "6.3.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-init/-/wasm-crypto-init-6.3.1.tgz#b590220c53c94b9a54d5dc236d0cbe943db76706" - integrity sha512-9yaUBcu+snwjJLmPPGl3cyGRQ1afyFGm16qzTM0sgG/ZCfUlK4uk8KWZe+sBUKgoxb2oXY7Y4WklKgQI1YBdfw== +"@polkadot/wasm-crypto-init@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-init/-/wasm-crypto-init-6.4.1.tgz#4d9ab0030db52cf177bf707ef8e77aa4ca721668" + integrity sha512-1ALagSi/nfkyFaH6JDYfy/QbicVbSn99K8PV9rctDUfxc7P06R7CoqbjGQ4OMPX6w1WYVPU7B4jPHGLYBlVuMw== dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/wasm-bridge" "6.3.1" - "@polkadot/wasm-crypto-asmjs" "6.3.1" - "@polkadot/wasm-crypto-wasm" "6.3.1" + "@babel/runtime" "^7.20.6" + "@polkadot/wasm-bridge" "6.4.1" + "@polkadot/wasm-crypto-asmjs" "6.4.1" + "@polkadot/wasm-crypto-wasm" "6.4.1" -"@polkadot/wasm-crypto-wasm@6.3.1": - version "6.3.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-6.3.1.tgz#67f720e7f9694fef096abe9d60abbac02e032383" - integrity sha512-idSlzKGVzCfeCMRHsacRvqwojSaTadFxL/Dbls4z1thvfa3U9Ku0d2qVtlwg7Hj+tYWDiuP8Kygs+6bQwfs0XA== +"@polkadot/wasm-crypto-wasm@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-6.4.1.tgz#97180f80583b18f6a13c1054fa5f7e8da40b1028" + integrity sha512-3VV9ZGzh0ZY3SmkkSw+0TRXxIpiO0nB8lFwlRgcwaCihwrvLfRnH9GI8WE12mKsHVjWTEVR3ogzILJxccAUjDA== dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/wasm-util" "6.3.1" + "@babel/runtime" "^7.20.6" + "@polkadot/wasm-util" "6.4.1" -"@polkadot/wasm-crypto@^6.3.1": - version "6.3.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-6.3.1.tgz#63f5798aca2b2ff0696f190e6862d9781d8f280c" - integrity sha512-OO8h0qeVkqp4xYZaRVl4iuWOEtq282pNBHDKb6SOJuI2g59eWGcKh4EQU9Me2VP6qzojIqptrkrVt7KQXC68gA== +"@polkadot/wasm-crypto@^6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-6.4.1.tgz#79310e23ad1ca62362ba893db6a8567154c2536a" + integrity sha512-FH+dcDPdhSLJvwL0pMLtn/LIPd62QDPODZRCmDyw+pFjLOMaRBc7raomWUOqyRWJTnqVf/iscc2rLVLNMyt7ag== dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/wasm-bridge" "6.3.1" - "@polkadot/wasm-crypto-asmjs" "6.3.1" - "@polkadot/wasm-crypto-init" "6.3.1" - "@polkadot/wasm-crypto-wasm" "6.3.1" - "@polkadot/wasm-util" "6.3.1" + "@babel/runtime" "^7.20.6" + "@polkadot/wasm-bridge" "6.4.1" + "@polkadot/wasm-crypto-asmjs" "6.4.1" + "@polkadot/wasm-crypto-init" "6.4.1" + "@polkadot/wasm-crypto-wasm" "6.4.1" + "@polkadot/wasm-util" "6.4.1" -"@polkadot/wasm-util@6.3.1": - version "6.3.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-util/-/wasm-util-6.3.1.tgz#439ebb68a436317af388ed6438b8f879df3afcda" - integrity sha512-12oAv5J7Yoc9m6jixrSaQCxpOkWOyzHx3DMC8qmLjRiwdBWxqLmImOVRVnFsbaxqSbhBIHRuJphVxWE+GZETDg== +"@polkadot/wasm-util@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-util/-/wasm-util-6.4.1.tgz#74aecc85bec427a9225d9874685944ea3dc3ab76" + integrity sha512-Uwo+WpEsDmFExWC5kTNvsVhvqXMZEKf4gUHXFn4c6Xz4lmieRT5g+1bO1KJ21pl4msuIgdV3Bksfs/oiqMFqlw== dependencies: - "@babel/runtime" "^7.18.9" + "@babel/runtime" "^7.20.6" -"@polkadot/x-bigint@10.1.2", "@polkadot/x-bigint@^10.1.2": - version "10.1.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-10.1.2.tgz#5070af6a3a5aa66eba85597837ce6eb44ad7dc02" - integrity sha512-TCwv3NjQdfLb7CBYR8EA5t0CrMfYx3IF4hKjctuplL+mDNI0VzNn4qVKW62AjouI8kMbn7VyBPfoBeuYX8Ixrw== +"@polkadot/x-bigint@10.2.1", "@polkadot/x-bigint@^10.2.1": + version "10.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-10.2.1.tgz#aa2d4384bb4ae6b5a3f333aa25bf6fd64d9006c5" + integrity sha512-asFroI2skC4gYv0oIqqb84DqCCxhNUTSCKobEg57WdXoT4TKrN9Uetg2AMSIHRiX/9lP3EPMhUjM1VVGobTQRQ== dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.2" + "@babel/runtime" "^7.20.6" + "@polkadot/x-global" "10.2.1" -"@polkadot/x-fetch@^10.1.2": - version "10.1.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-10.1.2.tgz#b812d76dd90a52a9ce0466bdc2b31999dfa0bec5" - integrity sha512-Zd7npq9H/kDaehiM2iyPX1+cSfuhCvqDxuS8GLTjARIVGGURBfA+NjRM6o6jsXa3HCtv+lB67Qdw1m/PSxfIpQ== +"@polkadot/x-fetch@^10.2.1": + version "10.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-10.2.1.tgz#cb5b33da1d91787eb2e5207ef62806a75ef3c62f" + integrity sha512-6ASJUZIrbLaKW+AOW7E5CuktwJwa2LHhxxRyJe398HxZUjJRjO2VJPdqoSwwCYvfFa1TcIr3FDWS63ooDfvGMA== dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.2" + "@babel/runtime" "^7.20.6" + "@polkadot/x-global" "10.2.1" "@types/node-fetch" "^2.6.2" - node-fetch "^3.2.9" + node-fetch "^3.3.0" -"@polkadot/x-global@10.1.2", "@polkadot/x-global@^10.1.2": - version "10.1.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-10.1.2.tgz#66c2ceb6ef5043bc6bddd5e944f35e64e9d6a0a9" - integrity sha512-//r3NVLYdYQs0So0IK8Pa0pnL5pPi0geQWE6qjTtPD0oszuN9SUDqDlFQj3I3vqQOwgybbzBGNYRRinP8B2xUg== +"@polkadot/x-global@10.2.1", "@polkadot/x-global@^10.2.1": + version "10.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-10.2.1.tgz#6fbaab05653e680adc8c69c07947eee49afc1238" + integrity sha512-kWmPku2lCcoYKU16+lWGOb95+6Lu9zo1trvzTWmAt7z0DXw2GlD9+qmDTt5iYGtguJsGXoRZDGilDTo3MeFrkA== dependencies: - "@babel/runtime" "^7.18.9" + "@babel/runtime" "^7.20.6" -"@polkadot/x-randomvalues@10.1.2": - version "10.1.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-10.1.2.tgz#8a0f15eb0558f837dd10060ad808707fe8b64c05" - integrity sha512-KOu6iZWye9KD6qoahiqZ0alrT/5FSGL4XXLhVSg69xAqD6yG2oi2aKA6cZpDU19uZGqVneqsgpebDsrZ0nLUEg== +"@polkadot/x-randomvalues@10.2.1": + version "10.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-10.2.1.tgz#1c463625c0b7cf775e94594f522eb21a5229b42e" + integrity sha512-bEwG6j/+HMZ5LIkyzRbTB0N1Wz2lHyxP25pPFgHFqGqon/KZoRN5kxOwEJ1DpPJIv+9PVn5tt7bc4R3qsaZ93g== dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.2" + "@babel/runtime" "^7.20.6" + "@polkadot/x-global" "10.2.1" -"@polkadot/x-textdecoder@10.1.2": - version "10.1.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-10.1.2.tgz#833627fc55b388483857de922b534b70fc349a0a" - integrity sha512-liMlSSKfLGTvcUPz1fMicH2HoKLgSjzxFYsbNfXJOe9GobQfSrAOcprM0j4gNJqN5EoZhze9Sf1rMTORQwomtg== +"@polkadot/x-textdecoder@10.2.1": + version "10.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-10.2.1.tgz#c1778ef35e2aa8db8f11bbe31a5bbf5e46017d7d" + integrity sha512-hpFmrdv/rrSM4UNaV8TJBgMtwXsYlNgBTSUmnKWwJIN3PhOUeYxl1qIbPchxGbJBc35WviJCZe7rlLja9JvFcw== dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.2" + "@babel/runtime" "^7.20.6" + "@polkadot/x-global" "10.2.1" -"@polkadot/x-textencoder@10.1.2": - version "10.1.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-10.1.2.tgz#a728a89d117456749211fcf520ca0e846654df89" - integrity sha512-bSMvesZ43Er6+jogt9IfwWN/E8bhkl4a9nNnpyS/vTh+j6n/DfDQrvYpKDpRIn7oJA6lfs/mL9Jo5jjJTngaxg== +"@polkadot/x-textencoder@10.2.1": + version "10.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-10.2.1.tgz#c09562c73a44659243075d43b007b5c1b39c57a8" + integrity sha512-4gMyY6DCH34KA++bawu/zlUJ0/8+aZJsurwjRBbkdfOS2uLo0K+vJ5GBevAhl0VSznM36ptfh/MpkIBKK/6R0g== dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.2" + "@babel/runtime" "^7.20.6" + "@polkadot/x-global" "10.2.1" -"@polkadot/x-ws@^10.1.2": - version "10.1.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-10.1.2.tgz#9c7d597aa0912b1b6b825b1f1ed56c47bf61174c" - integrity sha512-RQkc6TPM7xOKHMrE3R/8+FdE9fMGJEN7yfK/GixpMGzw98NcVedxJ1xTL19r76hJvOSeZAEks5oqgMxF8K9Pbg== +"@polkadot/x-ws@^10.2.1": + version "10.2.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-10.2.1.tgz#ec119c22a8cb7b9cde00e9909e37b6ba2845efd1" + integrity sha512-oS/WEHc1JSJ+xMArzFXbg1yEeaRrp6GsJLBvObj4DgTyqoWTR5fYkq1G1nHbyqdR729yAnR6755PdaWecIg98g== dependencies: - "@babel/runtime" "^7.18.9" - "@polkadot/x-global" "10.1.2" + "@babel/runtime" "^7.20.6" + "@polkadot/x-global" "10.2.1" "@types/websocket" "^1.0.5" websocket "^1.0.34" @@ -995,26 +995,27 @@ resolved "https://registry.yarnpkg.com/@substrate/connect-extension-protocol/-/connect-extension-protocol-1.0.1.tgz#fa5738039586c648013caa6a0c95c43265dbe77d" integrity sha512-161JhCC1csjH3GE5mPLEd7HbWtwNSPJBg3p1Ksz9SFlTzj/bgEwudiRN2y5i0MoLGCIJRYKyKGMxVnd29PzNjg== -"@substrate/connect@0.7.9": - version "0.7.9" - resolved "https://registry.yarnpkg.com/@substrate/connect/-/connect-0.7.9.tgz#0bb65fef28c70051e6158e10f633005e899fbb5b" - integrity sha512-E6bdBhzsfHNAKlmQSvbTW1jyb0WcIvgbrEBfJ4B6FZ3t1wpGjldL6GrYtegVtKr9/ySQ/pFNn0uVbugukpMDjQ== +"@substrate/connect@0.7.17": + version "0.7.17" + resolved "https://registry.yarnpkg.com/@substrate/connect/-/connect-0.7.17.tgz#b76ce23d24255e89028db81b3cb280c7f86db72e" + integrity sha512-s0XBmGpUCFWZFa+TS0TEvOKtWjJP2uT4xKmvzApH8INB5xbz79wqWFX6WWh3AlK/X1P0Smt+RVEH7HQiLJAYAw== dependencies: "@substrate/connect-extension-protocol" "^1.0.1" - "@substrate/smoldot-light" "0.6.25" + "@substrate/smoldot-light" "0.7.7" eventemitter3 "^4.0.7" -"@substrate/smoldot-light@0.6.25": - version "0.6.25" - resolved "https://registry.yarnpkg.com/@substrate/smoldot-light/-/smoldot-light-0.6.25.tgz#3025ba5134b1be470855f901ffeb028a0f93460c" - integrity sha512-OQ9/bnJJy90xSRg5Vp9MIvrgbrVt/r/FwXYSmyLeBBNbJt6o1gSeshVo8icD+2VWwd/TJ2oHl5CVQWe89MyByA== +"@substrate/smoldot-light@0.7.7": + version "0.7.7" + resolved "https://registry.yarnpkg.com/@substrate/smoldot-light/-/smoldot-light-0.7.7.tgz#ee5f89bb25af64d2014d97548b959b7da4c67f08" + integrity sha512-ksxeAed6dIUtYSl0f8ehgWQjwXnpDGTIJt+WVRIGt3OObZkA96ZdBWx0xP7GrXZtj37u4n/Y1z7TyTm4bwQvrw== dependencies: - websocket "^1.0.32" + pako "^2.0.4" + ws "^8.8.1" -"@substrate/ss58-registry@^1.25.0": - version "1.25.0" - resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.25.0.tgz#0fcd8c9c0e53963a88fbed41f2cbd8a1a5c74cde" - integrity sha512-LmCH4QJRdHaeLsLTPSgJaXguMoIW+Ig9fA9LRPpeya9HefVAJ7gZuUYinldv+QmX7evNm5CL0rspNUS8l1DvXg== +"@substrate/ss58-registry@^1.35.0": + version "1.36.0" + resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.36.0.tgz#22b59fa85cacc0bdf40aa5d8131a377c1b5a8dd8" + integrity sha512-YfQIpe2bIvGg/XWNByycznbOiAknMvpYaUpQJ2sLmNT/OwPx7XjEXk7dLShccuiQDoOQt3trTtF3Frz/Tjv6Fg== "@szmarczak/http-timer@^1.1.2": version "1.1.2" @@ -1057,6 +1058,13 @@ dependencies: "@types/node" "*" +"@types/bn.js@^5.1.1": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682" + integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g== + dependencies: + "@types/node" "*" + "@types/chai@^4.3.1": version "4.3.1" resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.1.tgz#e2c6e73e0bdeb2521d00756d099218e9f5d90a04" @@ -4102,10 +4110,10 @@ node-domexception@^1.0.0: resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== -node-fetch@^3.2.9: - version "3.2.10" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.2.10.tgz#e8347f94b54ae18b57c9c049ef641cef398a85c8" - integrity sha512-MhuzNwdURnZ1Cp4XTazr69K0BTizsBroX7Zx3UgDSVcZYKF/6p0CBe4EUb/hLqmzVhl0UpYfgRljQ4yxE+iCxA== +node-fetch@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.0.tgz#37e71db4ecc257057af828d523a7243d651d91e4" + integrity sha512-BKwRP/O0UvoMKp7GNdwPlObhYGB5DQqwhEDQlNKuoqwVYSxkSZCSbHjnFFmUEtwSKRPU4kNK8PbDYYitwaE3QA== dependencies: data-uri-to-buffer "^4.0.0" fetch-blob "^3.1.4" @@ -4306,6 +4314,11 @@ package-json@^6.3.0: registry-url "^5.0.0" semver "^6.2.0" +pako@^2.0.4: + version "2.1.0" + resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86" + integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug== + parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -4422,10 +4435,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@2.7.1: - version "2.7.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" - integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== +prettier@2.8.1: + version "2.8.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.1.tgz#4e1fd11c34e2421bc1da9aea9bd8127cd0a35efc" + integrity sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg== prettier@^2.1.2: version "2.5.1" @@ -4616,10 +4629,10 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" -regenerator-runtime@^0.13.4: - version "0.13.9" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" - integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== +regenerator-runtime@^0.13.11: + version "0.13.11" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" + integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== regexpp@^3.0.0, regexpp@^3.1.0: version "3.2.0" @@ -4751,10 +4764,10 @@ rxjs@^6.6.0: dependencies: tslib "^1.9.0" -rxjs@^7.5.6: - version "7.5.6" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.6.tgz#0446577557862afd6903517ce7cae79ecb9662bc" - integrity sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw== +rxjs@^7.6.0: + version "7.6.0" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.6.0.tgz#361da5362b6ddaa691a2de0b4f2d32028f1eb5a2" + integrity sha512-DDa7d8TFNUalGC9VqXvQ1euWNN7sc63TrUCuM9J998+ViviahMIjKSOU7rfcgFOF+FCD71BhDRv4hrFz+ImDLQ== dependencies: tslib "^2.1.0" @@ -5787,6 +5800,11 @@ ws@^3.0.0: safe-buffer "~5.1.0" ultron "~1.1.0" +ws@^8.8.1: + version "8.11.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.11.0.tgz#6a0d36b8edfd9f96d8b25683db2f8d7de6e8e143" + integrity sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg== + xdg-basedir@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" From d714d251661e8bb3c534ca6827c90c44fef44790 Mon Sep 17 00:00:00 2001 From: Kailai Wang Date: Sat, 10 Dec 2022 22:10:15 +0000 Subject: [PATCH 25/25] try to fix CI --- ts-tests/tests/bridge.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ts-tests/tests/bridge.test.ts b/ts-tests/tests/bridge.test.ts index e09f45ef67..b40e03e71c 100644 --- a/ts-tests/tests/bridge.test.ts +++ b/ts-tests/tests/bridge.test.ts @@ -72,7 +72,7 @@ describeCrossChainTransfer('Test Cross-chain Transfer', ``, (context) => { handlerBalance .div(BigNumber.from(1000000)) .add(BigNumber.from(100)) - .add(BigNumber.from(fee.toString())), + .add(BigNumber.from(fee.toString())).toString(), receipt, 0 ), @@ -107,7 +107,7 @@ describeCrossChainTransfer('Test Cross-chain Transfer', ``, (context) => { const fee = await context.parachainConfig.api.query.chainBridge.bridgeFee(0); await signAndSend( context.parachainConfig.api.tx.bridgeTransfer.transferNative( - handlerBalance.div(BigNumber.from(1000000)).add(BigNumber.from(fee.toString())), + handlerBalance.div(BigNumber.from(1000000)).add(BigNumber.from(fee.toString())).toString(), receipt, 0 ),