Skip to content
Snippets Groups Projects
Unverified Commit 5fc7622c authored by Serban Iorga's avatar Serban Iorga Committed by GitHub
Browse files

Bridge zombienet tests - move all test scripts to the same folder (#3333)

Related to https://github.com/paritytech/polkadot-sdk/issues/3242
parent 150a360c
No related merge requests found
Pipeline #445404 failed with stages
in 48 minutes and 24 seconds
Showing
with 15 additions and 148 deletions
File moved
#!/bin/bash
$POLKADOT_SDK_PATH/cumulus/scripts/bridges_rococo_westend.sh "$@"
Description: User is able to transfer ROC from Rococo Asset Hub to Westend Asset Hub and back
Network: ../../../cumulus/zombienet/bridge-hubs/bridge_hub_westend_local_network.toml
Creds: config
# step 0: start relayer
# (started by sibling 0001-asset-transfer-works-westend-to-rococo.zndsl test)
# step 1: initialize Westend AH
asset-hub-westend-collator1: run ../scripts/invoke-script.sh with "init-asset-hub-westend-local" within 60 seconds
# step 2: initialize Westend bridge hub
bridge-hub-westend-collator1: run ../scripts/invoke-script.sh with "init-bridge-hub-westend-local" within 60 seconds
# step 3: ensure that initialization has completed
asset-hub-westend-collator1: js-script ../helpers/wait-hrmp-channel-opened.js with "1002" within 600 seconds
# step 4: relay is already started - let's wait until with-Rococo GRANPDA pallet is initialized at Westend
bridge-hub-westend-collator1: js-script ../helpers/best-finalized-header-at-bridged-chain.js with "Rococo,0" within 400 seconds
# step 5: send WND to //Alice on Rococo AH
# (that's a required part of a sibling 0001-asset-transfer-works-westend-to-rococo.zndsl test)
asset-hub-westend-collator1: run ../scripts/invoke-script.sh with "reserve-transfer-assets-from-asset-hub-westend-local" within 60 seconds
# step 6: elsewhere Rococo has sent ROC to //Alice - let's wait for it
asset-hub-westend-collator1: js-script ../helpers/wrapped-assets-balance.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,0,Rococo" within 600 seconds
# step 7: check that the relayer //Charlie is rewarded by both our AH and target AH
bridge-hub-westend-collator1: js-script ../helpers/relayer-rewards.js with "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y,0x00000002,0x6268726f,BridgedChain,0" within 300 seconds
bridge-hub-westend-collator1: js-script ../helpers/relayer-rewards.js with "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y,0x00000002,0x6268726F,ThisChain,0" within 300 seconds
# step 8: send wROC back to Alice at Rococo AH
asset-hub-westend-collator1: run ../scripts/invoke-script.sh with "withdraw-reserve-assets-from-asset-hub-westend-local" within 60 seconds
# step 9: elsewhere Rococo has sent wWND to //Alice - let's wait for it
# (we wait until //Alice account increases here - there are no other transactionc that may increase it)
asset-hub-westend-collator1: js-script ../helpers/native-assets-balance-increased.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" within 600 seconds
# wait until other network test has completed OR exit with an error too
asset-hub-westend-collator1: run ../scripts/sync-exit.sh within 600 seconds
Description: User is able to transfer WND from Westend Asset Hub to Rococo Asset Hub and back
Network: ../../../cumulus/zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml
Creds: config
# step 0: start relayer
bridge-hub-rococo-collator1: run ../scripts/start-relayer.sh within 60 seconds
# step 1: initialize Rococo AH
asset-hub-rococo-collator1: run ../scripts/invoke-script.sh with "init-asset-hub-rococo-local" within 60 seconds
# step 2: initialize Rococo bridge hub
bridge-hub-rococo-collator1: run ../scripts/invoke-script.sh with "init-bridge-hub-rococo-local" within 60 seconds
# step 3: ensure that initialization has completed
asset-hub-rococo-collator1: js-script ../helpers/wait-hrmp-channel-opened.js with "1013" within 600 seconds
# step 4: relay is already started - let's wait until with-Westend GRANPDA pallet is initialized at Rococo
bridge-hub-rococo-collator1: js-script ../helpers/best-finalized-header-at-bridged-chain.js with "Westend,0" within 400 seconds
# step 5: send ROC to //Alice on Westend AH
# (that's a required part of a sibling 0001-asset-transfer-works-rococo-to-westend.zndsl test)
asset-hub-rococo-collator1: run ../scripts/invoke-script.sh with "reserve-transfer-assets-from-asset-hub-rococo-local" within 60 seconds
# step 6: elsewhere Westend has sent WND to //Alice - let's wait for it
asset-hub-rococo-collator1: js-script ../helpers/wrapped-assets-balance.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,0,Westend" within 600 seconds
# step 7: check that the relayer //Charlie is rewarded by both our AH and target AH
bridge-hub-rococo-collator1: js-script ../helpers/relayer-rewards.js with "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y,0x00000002,0x62687764,BridgedChain,0" within 300 seconds
bridge-hub-rococo-collator1: js-script ../helpers/relayer-rewards.js with "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y,0x00000002,0x62687764,ThisChain,0" within 300 seconds
# step 8: send wWND back to Alice at Westend AH
asset-hub-rococo-collator1: run ../scripts/invoke-script.sh with "withdraw-reserve-assets-from-asset-hub-rococo-local" within 60 seconds
# step 9: elsewhere Westend has sent wROC to //Alice - let's wait for it
# (we wait until //Alice account increases here - there are no other transactionc that may increase it)
asset-hub-rococo-collator1: js-script ../helpers/native-assets-balance-increased.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" within 600 seconds
# wait until other network test has completed OR exit with an error too
asset-hub-rococo-collator1: run ../scripts/sync-exit.sh within 600 seconds
Description: While relayer is idle, we only sync mandatory Rococo (and a single Rococo BH) headers to Westend BH.
Network: ../../../cumulus/zombienet/bridge-hubs/bridge_hub_westend_local_network.toml
Creds: config
# step 1: initialize Westend bridge hub
bridge-hub-westend-collator1: run ../scripts/invoke-script.sh with "init-bridge-hub-westend-local" within 60 seconds
# step 2: sleep some time before starting relayer. We want to sleep for at least 1 session, which is expected to
# be 60 seconds for test environment.
sleep 120 seconds
# step 3: start relayer
# (it is started by the sibling 0002-mandatory-headers-synced-while-idle-westend-to-rococo.zndsl test file)
# it also takes some time for relayer to initialize bridge, so let's sleep for 5 minutes to be sure that parachain
# header has been synced
# step 4: ensure that relayer is only syncing mandatory headers while idle. This includes both headers that were
# born while relay was offline and those in the next 100 seconds while script is active.
bridge-hub-westend-collator1: js-script ../helpers/only-mandatory-headers-synced-when-idle.js with "300,rococo-at-westend" within 600 seconds
# wait until other network test has completed OR exit with an error too
asset-hub-westend-collator1: run ../scripts/sync-exit.sh within 600 seconds
# wait until other network test has completed OR exit with an error too
asset-hub-westend-collator1: run ../scripts/sync-exit.sh within 600 seconds
Description: While relayer is idle, we only sync mandatory Westend (and a single Westend BH) headers to Rococo BH.
Network: ../../../cumulus/zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml
Creds: config
# step 1: initialize Rococo bridge hub
bridge-hub-rococo-collator1: run ../scripts/invoke-script.sh with "init-bridge-hub-rococo-local" within 60 seconds
# step 2: sleep some time before starting relayer. We want to sleep for at least 1 session, which is expected to
# be 60 seconds for test environment.
sleep 120 seconds
# step 3: start relayer
bridge-hub-rococo-collator1: run ../scripts/start-relayer.sh within 60 seconds
# it also takes some time for relayer to initialize bridge, so let's sleep for 5 minutes to be sure that parachain
# header has been synced
# step 4: ensure that relayer is only syncing mandatory headers while idle. This includes both headers that were
# born while relay was offline and those in the next 100 seconds while script is active.
bridge-hub-rococo-collator1: js-script ../helpers/only-mandatory-headers-synced-when-idle.js with "300,westend-at-rococo" within 600 seconds
# wait until other network test has completed OR exit with an error too
asset-hub-rococo-collator1: run ../scripts/sync-exit.sh within 600 seconds
# wait until other network test has completed OR exit with an error too
asset-hub-rococo-collator1: run ../scripts/sync-exit.sh within 600 seconds
......@@ -91,7 +91,7 @@ cd <polkadot-sdk-git-repo-dir>
# Rococo + BridgeHubRococo + AssetHub for Rococo (mirroring Kusama)
POLKADOT_BINARY=~/local_bridge_testing/bin/polkadot \
POLKADOT_PARACHAIN_BINARY=~/local_bridge_testing/bin/polkadot-parachain \
~/local_bridge_testing/bin/zombienet-linux --provider native spawn ./cumulus/zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml
~/local_bridge_testing/bin/zombienet-linux --provider native spawn ./bridges/testing/environments/rococo-westend/bridge_hub_rococo_local_network.toml
```
```
......@@ -100,7 +100,7 @@ cd <polkadot-sdk-git-repo-dir>
# Westend + BridgeHubWestend + AssetHub for Westend (mirroring Polkadot)
POLKADOT_BINARY=~/local_bridge_testing/bin/polkadot \
POLKADOT_PARACHAIN_BINARY=~/local_bridge_testing/bin/polkadot-parachain \
~/local_bridge_testing/bin/zombienet-linux --provider native spawn ./cumulus/zombienet/bridge-hubs/bridge_hub_westend_local_network.toml
~/local_bridge_testing/bin/zombienet-linux --provider native spawn ./bridges/testing/environments/rococo-westend/bridge_hub_westend_local_network.toml
```
### Init bridge and run relayer between BridgeHubRococo and BridgeHubWestend
......@@ -112,7 +112,7 @@ POLKADOT_PARACHAIN_BINARY=~/local_bridge_testing/bin/polkadot-parachain \
```
cd <polkadot-sdk-git-repo-dir>
./cumulus/scripts/bridges_rococo_westend.sh run-relay
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh run-relay
```
**Check relay-chain headers relaying:**
......@@ -135,10 +135,10 @@ This initialization does several things:
```
cd <polkadot-sdk-git-repo-dir>
./cumulus/scripts/bridges_rococo_westend.sh init-asset-hub-rococo-local
./cumulus/scripts/bridges_rococo_westend.sh init-bridge-hub-rococo-local
./cumulus/scripts/bridges_rococo_westend.sh init-asset-hub-westend-local
./cumulus/scripts/bridges_rococo_westend.sh init-bridge-hub-westend-local
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh init-asset-hub-rococo-local
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh init-bridge-hub-rococo-local
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh init-asset-hub-westend-local
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh init-bridge-hub-westend-local
```
### Send messages - transfer asset over bridge (ROCs/WNDs)
......@@ -148,13 +148,13 @@ Do reserve-backed transfers:
cd <polkadot-sdk-git-repo-dir>
# ROCs from Rococo's Asset Hub to Westend's.
./cumulus/scripts/bridges_rococo_westend.sh reserve-transfer-assets-from-asset-hub-rococo-local
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh reserve-transfer-assets-from-asset-hub-rococo-local
```
```
cd <polkadot-sdk-git-repo-dir>
# WNDs from Westend's Asset Hub to Rococo's.
./cumulus/scripts/bridges_rococo_westend.sh reserve-transfer-assets-from-asset-hub-westend-local
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh reserve-transfer-assets-from-asset-hub-westend-local
```
- open explorers: (see zombienets)
......@@ -169,13 +169,13 @@ Do reserve withdraw transfers: (when previous is finished)
cd <polkadot-sdk-git-repo-dir>
# wrappedWNDs from Rococo's Asset Hub to Westend's.
./cumulus/scripts/bridges_rococo_westend.sh withdraw-reserve-assets-from-asset-hub-rococo-local
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh withdraw-reserve-assets-from-asset-hub-rococo-local
```
```
cd <polkadot-sdk-git-repo-dir>
# wrappedROCs from Westend's Asset Hub to Rococo's.
./cumulus/scripts/bridges_rococo_westend.sh withdraw-reserve-assets-from-asset-hub-westend-local
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh withdraw-reserve-assets-from-asset-hub-westend-local
```
### Claim relayer's rewards on BridgeHubRococo and BridgeHubWestend
......@@ -188,10 +188,10 @@ cd <polkadot-sdk-git-repo-dir>
cd <polkadot-sdk-git-repo-dir>
# Claim rewards on BridgeHubWestend:
./cumulus/scripts/bridges_rococo_westend.sh claim-rewards-bridge-hub-rococo-local
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh claim-rewards-bridge-hub-rococo-local
# Claim rewards on BridgeHubWestend:
./cumulus/scripts/bridges_rococo_westend.sh claim-rewards-bridge-hub-westend-local
./bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh claim-rewards-bridge-hub-westend-local
```
- open explorers: (see zombienets)
......
......@@ -22,7 +22,7 @@ LABEL io.parity.image.authors="devops-team@parity.io" \
io.parity.image.source="https://github.com/paritytech/polkadot-sdk/blob/${VCS_REF}/docker/dockerfiles/bridges_zombienet_tests_injected.Dockerfile" \
io.parity.image.revision="${VCS_REF}" \
io.parity.image.created="${BUILD_DATE}" \
io.parity.image.documentation="https://github.com/paritytech/polkadot-sdk/bridges/zombienet"
io.parity.image.documentation="https://github.com/paritytech/polkadot-sdk/bridges/testing"
# show backtraces
ENV RUST_BACKTRACE 1
......@@ -45,7 +45,7 @@ RUN mkdir -p /home/nonroot/bridges-polkadot-sdk
COPY ./artifacts/bridges-polkadot-sdk /home/nonroot/bridges-polkadot-sdk
# also prepare `generate_hex_encoded_call` for running
RUN set -eux; \
cd /home/nonroot/bridges-polkadot-sdk/cumulus/scripts/generate_hex_encoded_call; \
cd /home/nonroot/bridges-polkadot-sdk/bridges/testing/utils/generate_hex_encoded_call; \
npm install
# check if executable works in this container
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment