From 1a68129afb9cc04150bcff13d669ccfadd9315fc Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 23 Nov 2022 15:08:59 +0100 Subject: [PATCH] Zombienet for bridge-hub setup --- parachains/runtimes/bridge-hubs/README.md | 43 +++++++++++--- scripts/bridges_rococo_wococo.sh | 4 +- .../bridge_hub_rococo_local_network.toml | 56 +++++++++++++++++++ .../bridge_hub_wococo_local_network.toml | 56 +++++++++++++++++++ .../0004-run_bridge_hubs_rococo.toml | 37 ------------ .../0004-run_bridge_hubs_wococo.toml | 37 ------------ 6 files changed, 150 insertions(+), 83 deletions(-) create mode 100644 zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml create mode 100644 zombienet/bridge-hubs/bridge_hub_wococo_local_network.toml delete mode 100644 zombienet_tests/0004-run_bridge_hubs_rococo.toml delete mode 100644 zombienet_tests/0004-run_bridge_hubs_wococo.toml diff --git a/parachains/runtimes/bridge-hubs/README.md b/parachains/runtimes/bridge-hubs/README.md index 1509df525b..d2065553e3 100644 --- a/parachains/runtimes/bridge-hubs/README.md +++ b/parachains/runtimes/bridge-hubs/README.md @@ -41,6 +41,22 @@ cargo build -p substrate-relay cp target/release/substrate-relay ~/local_bridge_testing/bin/substrate-relay ``` +### Run chains (Rococo + BridgeHub, Wococo + BridgeHub) with zombienet + +``` +# Rococo + BridgeHubWococo +POLKADOT_BINARY_PATH=../../polkadot/target/release/polkadot \ +POLKADOT_PARACHAIN_BINARY_PATH=./target/release/polkadot-parachain \ + ./zombienet-linux --provider native spawn ./zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml +``` + +``` +# Wococo + BridgeHubWococo +POLKADOT_BINARY_PATH=../../polkadot/target/release/polkadot \ +POLKADOT_PARACHAIN_BINARY_PATH=./target/release/polkadot-parachain \ + ./zombienet-linux --provider native spawn ./zombienet/bridge-hubs/bridge_hub_wococo_local_network.toml +``` + ### Run chains (Rococo + BridgeHub, Wococo + BridgeHub) from `./scripts/bridges_rococo_wococo.sh` ``` @@ -75,7 +91,7 @@ or RUST_LOG=runtime=trace,rpc=trace,bridge=trace \ ~/local_bridge_testing/bin/substrate-relay init-bridge rococo-to-bridge-hub-wococo \ --source-host localhost \ - --source-port 48943 \ + --source-port 9942 \ --target-host localhost \ --target-port 8945 \ --target-signer //Bob @@ -84,7 +100,7 @@ RUST_LOG=runtime=trace,rpc=trace,bridge=trace \ RUST_LOG=runtime=trace,rpc=trace,bridge=trace \ ~/local_bridge_testing/bin/substrate-relay init-bridge wococo-to-bridge-hub-rococo \ --source-host localhost \ - --source-port 48945 \ + --source-port 9945 \ --target-host localhost \ --target-port 8943 \ --target-signer //Bob @@ -100,7 +116,7 @@ RUST_LOG=runtime=trace,rpc=trace,bridge=trace \ RUST_LOG=runtime=trace,rpc=trace,bridge=trace \ ~/local_bridge_testing/bin/substrate-relay relay-headers rococo-to-bridge-hub-wococo \ --source-host localhost \ - --source-port 48943 \ + --source-port 9942 \ --target-host localhost \ --target-port 8945 \ --target-signer //Bob \ @@ -110,7 +126,7 @@ RUST_LOG=runtime=trace,rpc=trace,bridge=trace \ RUST_LOG=runtime=trace,rpc=trace,bridge=trace \ ~/local_bridge_testing/bin/substrate-relay relay-headers wococo-to-bridge-hub-rococo \ --source-host localhost \ - --source-port 48945 \ + --source-port 9945 \ --target-host localhost \ --target-port 8943 \ --target-signer //Bob \ @@ -134,7 +150,7 @@ RUST_LOG=runtime=trace,rpc=trace,bridge=trace \ RUST_LOG=runtime=trace,rpc=trace,bridge=trace \ ~/local_bridge_testing/bin/substrate-relay relay-parachains bridge-hub-rococo-to-bridge-hub-wococo \ --source-host localhost \ - --source-port 48943 \ + --source-port 9942 \ --target-host localhost \ --target-port 8945 \ --target-signer //Bob \ @@ -144,7 +160,7 @@ RUST_LOG=runtime=trace,rpc=trace,bridge=trace \ RUST_LOG=runtime=trace,rpc=trace,bridge=trace \ ~/local_bridge_testing/bin/substrate-relay relay-parachains bridge-hub-wococo-to-bridge-hub-rococo \ --source-host localhost \ - --source-port 48945 \ + --source-port 9945 \ --target-host localhost \ --target-port 8943 \ --target-signer //Bob \ @@ -176,7 +192,20 @@ RUST_LOG=runtime=trace,rpc=trace,bridge=trace \ --target-transactions-mortality=4 \ --lane 00000002 ``` -TODO: + +``` +# Wococo -> Rococo +RUST_LOG=runtime=trace,rpc=trace,bridge=trace \ + ~/local_bridge_testing/bin/substrate-relay relay-messages bridge-hub-wococo-to-bridge-hub-rococo \ + --source-host localhost \ + --source-port 8945 \ + --source-signer //Charlie \ + --target-host localhost \ + --target-port 8943 \ + --target-signer //Charlie \ + --target-transactions-mortality=4 \ + --lane 00000001 +``` --- diff --git a/scripts/bridges_rococo_wococo.sh b/scripts/bridges_rococo_wococo.sh index 53d7dc974a..f6d2630af6 100755 --- a/scripts/bridges_rococo_wococo.sh +++ b/scripts/bridges_rococo_wococo.sh @@ -138,7 +138,7 @@ case "$1" in RUST_LOG=runtime=trace,rpc=trace,bridge=trace \ ~/local_bridge_testing/bin/substrate-relay init-bridge rococo-to-bridge-hub-wococo \ --source-host localhost \ - --source-port 48943 \ + --source-port 9942 \ --target-host localhost \ --target-port 8945 \ --target-signer //Bob @@ -148,7 +148,7 @@ case "$1" in RUST_LOG=runtime=trace,rpc=trace,bridge=trace \ ~/local_bridge_testing/bin/substrate-relay init-bridge wococo-to-bridge-hub-rococo \ --source-host localhost \ - --source-port 48945 \ + --source-port 9945 \ --target-host localhost \ --target-port 8943 \ --target-signer //Bob diff --git a/zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml b/zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml new file mode 100644 index 0000000000..e6ca8b893f --- /dev/null +++ b/zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml @@ -0,0 +1,56 @@ +[relaychain] +default_command = "{{POLKADOT_BINARY_PATH}}" +default_args = [ "-lparachain=debug,xcm::weight=trace,xcm::filter_asset_location=trace,xcm::send_xcm=trace,xcm::barriers=trace,xcm::barrier=trace,xcm::execute_xcm=trace,xcm::contains=trace,xcm::execute_xcm_in_credit,xcm::process_instruction=trace,xcm::currency_adapter=trace,xcm::origin_conversion=trace,xcm::fungibles_adapter=trace,xcm::process=trace,xcm::execute=trace" ] +chain = "rococo-local" + + [[relaychain.nodes]] + name = "alice-validator" + validator = true + rpc_port = 9932 + ws_port = 9942 + extra_args = ["--no-mdns --bootnodes {{'bob-validator'|zombie('multiAddress')}}"] + + [[relaychain.nodes]] + name = "bob-validator" + validator = true + rpc_port = 9933 + ws_port = 9943 + extra_args = ["--no-mdns --bootnodes {{'alice-validator'|zombie('multiAddress')}}"] + + [[relaychain.nodes]] + name = "charlie-validator" + validator = true + rpc_port = 9934 + ws_port = 9944 + extra_args = ["--no-mdns --bootnodes {{'alice-validator'|zombie('multiAddress')}}"] + +[[parachains]] +id = 1013 +chain = "bridge-hub-rococo-local" +cumulus_based = true + + # run alice as parachain collator + [[parachains.collators]] + name = "alice-collator" + validator = true + command = "{{POLKADOT_PARACHAIN_BINARY_PATH}}" + rpc_port = 8933 + ws_port = 8943 + extra_args = [ + "-lparachain=debug,runtime::bridge-hub=trace,runtime::bridge=trace,runtime::bridge-dispatch=trace,bridge=trace,runtime::bridge-messages=trace,xcm::weight=trace,xcm::filter_asset_location=trace,xcm::send_xcm=trace,xcm::barriers=trace,xcm::barrier=trace,xcm::execute_xcm=trace,xcm::contains=trace,xcm::execute_xcm_in_credit,xcm::process_instruction=trace,xcm::currency_adapter=trace,xcm::origin_conversion=trace,xcm::fungibles_adapter=trace,xcm::process=trace,xcm::execute=trace", + "--force-authoring", "--no-mdns", "--bootnodes {{'bob-collator'|zombie('multiAddress')}}", + "-- --port 41333 --rpc-port 48933 --ws-port 48943 --no-mdns", "--bootnodes {{'alice-validator'|zombie('multiAddress')}}" + ] + + # run bob as parachain collator + [[parachains.collators]] + name = "bob-collator" + validator = true + command = "{{POLKADOT_PARACHAIN_BINARY_PATH}}" + rpc_port = 8934 + ws_port = 8944 + extra_args = [ + "-lparachain=trace,runtime::bridge-hub=trace,runtime::bridge=trace,runtime::bridge-dispatch=trace,bridge=trace,runtime::bridge-messages=trace,xcm::weight=trace,xcm::filter_asset_location=trace,xcm::send_xcm=trace,xcm::barriers=trace,xcm::barrier=trace,xcm::execute_xcm=trace,xcm::contains=trace,xcm::execute_xcm_in_credit,xcm::process_instruction=trace,xcm::currency_adapter=trace,xcm::origin_conversion=trace,xcm::fungibles_adapter=trace,xcm::process=trace,xcm::execute=trace", + "--force-authoring", "--no-mdns", "--bootnodes {{'alice-collator'|zombie('multiAddress')}}", + "-- --port 41334 --rpc-port 48934 --ws-port 48944 --no-mdns", "--bootnodes {{'bob-validator'|zombie('multiAddress')}}" + ] diff --git a/zombienet/bridge-hubs/bridge_hub_wococo_local_network.toml b/zombienet/bridge-hubs/bridge_hub_wococo_local_network.toml new file mode 100644 index 0000000000..cc28741961 --- /dev/null +++ b/zombienet/bridge-hubs/bridge_hub_wococo_local_network.toml @@ -0,0 +1,56 @@ +[relaychain] +default_command = "{{POLKADOT_BINARY_PATH}}" +default_args = [ "-lparachain=debug,xcm::weight=trace,xcm::filter_asset_location=trace,xcm::send_xcm=trace,xcm::barriers=trace,xcm::barrier=trace,xcm::execute_xcm=trace,xcm::contains=trace,xcm::execute_xcm_in_credit,xcm::process_instruction=trace,xcm::currency_adapter=trace,xcm::origin_conversion=trace,xcm::fungibles_adapter=trace,xcm::process=trace,xcm::execute=trace" ] +chain = "wococo-local" + + [[relaychain.nodes]] + name = "alice-validator-wo" + validator = true + rpc_port = 9935 + ws_port = 9945 + extra_args = ["--no-mdns --bootnodes {{'bob-validator-wo'|zombie('multiAddress')}}"] + + [[relaychain.nodes]] + name = "bob-validator-wo" + validator = true + rpc_port = 9936 + ws_port = 9946 + extra_args = ["--no-mdns --bootnodes {{'alice-validator-wo'|zombie('multiAddress')}}"] + + [[relaychain.nodes]] + name = "charlie-validator-wo" + validator = true + rpc_port = 9937 + ws_port = 9947 + extra_args = ["--no-mdns --bootnodes {{'alice-validator-wo'|zombie('multiAddress')}}"] + +[[parachains]] +id = 1014 +chain = "bridge-hub-wococo-local" +cumulus_based = true + + # run alice as parachain collator + [[parachains.collators]] + name = "alice-collator-wo" + validator = true + command = "{{POLKADOT_PARACHAIN_BINARY_PATH}}" + rpc_port = 8935 + ws_port = 8945 + extra_args = [ + "-lparachain=debug,runtime::mmr=info,substrate=info,runtime=info,runtime::bridge-hub=trace,runtime::bridge=trace,runtime::bridge-dispatch=trace,bridge=trace,runtime::bridge-messages=trace,xcm::weight=trace,xcm::filter_asset_location=trace,xcm::send_xcm=trace,xcm::barriers=trace,xcm::barrier=trace,xcm::execute_xcm=trace,xcm::contains=trace,xcm::execute_xcm_in_credit,xcm::process_instruction=trace,xcm::currency_adapter=trace,xcm::origin_conversion=trace,xcm::fungibles_adapter=trace,xcm::process=trace,xcm::execute=trace", + "--force-authoring", "--no-mdns", "--bootnodes {{'bob-collator-wo'|zombie('multiAddress')}}", + "-- --port 41335 --rpc-port 48935 --ws-port 48945 --no-mdns", "--bootnodes {{'alice-validator-wo'|zombie('multiAddress')}}" + ] + + # run bob as parachain collator + [[parachains.collators]] + name = "bob-collator-wo" + validator = true + command = "{{POLKADOT_PARACHAIN_BINARY_PATH}}" + rpc_port = 8936 + ws_port = 8946 + extra_args = [ + "-lparachain=trace,runtime::mmr=info,substrate=info,runtime=info,runtime::bridge-hub=trace,runtime::bridge=trace,runtime::bridge-dispatch=trace,bridge=trace,runtime::bridge-messages=trace,xcm::weight=trace,xcm::filter_asset_location=trace,xcm::send_xcm=trace,xcm::barriers=trace,xcm::barrier=trace,xcm::execute_xcm=trace,xcm::contains=trace,xcm::execute_xcm_in_credit,xcm::process_instruction=trace,xcm::currency_adapter=trace,xcm::origin_conversion=trace,xcm::fungibles_adapter=trace,xcm::process=trace,xcm::execute=trace", + "--force-authoring", "--no-mdns", "--bootnodes {{'alice-collator-wo'|zombie('multiAddress')}}", + "-- --port 41336 --rpc-port 48936 --ws-port 48946 --no-mdns", "--bootnodes {{'bob-validator-wo'|zombie('multiAddress')}}" + ] diff --git a/zombienet_tests/0004-run_bridge_hubs_rococo.toml b/zombienet_tests/0004-run_bridge_hubs_rococo.toml deleted file mode 100644 index 9c9c9c49d1..0000000000 --- a/zombienet_tests/0004-run_bridge_hubs_rococo.toml +++ /dev/null @@ -1,37 +0,0 @@ -[relaychain] -default_command = "{{POLKADOT_BINARY_PATH}}" -default_args = [ "-lparachain=debug" ] - -chain = "rococo-local" - - [[relaychain.nodes]] - name = "alice" - validator = true - - [[relaychain.nodes]] - name = "bob" - validator = true - - [[relaychain.nodes]] - name = "charlie" - validator = true - -[[parachains]] -id = 1013 -cumulus_based = true -chain = "bridge-hub-rococo-local" - - [[parachains.collators]] - name = "alice" - command = "{{POLKADOT_PARACHAIN_BINARY_PATH}}" - args = ["-lparachain=debug"] - - [[parachains.collators]] - name = "bob" - command = "{{POLKADOT_PARACHAIN_BINARY_PATH}}" - args = ["-lparachain=debug"] - - [[parachains.collators]] - name = "charlie" - command = "{{POLKADOT_PARACHAIN_BINARY_PATH}}" - args = ["-lparachain=debug"] diff --git a/zombienet_tests/0004-run_bridge_hubs_wococo.toml b/zombienet_tests/0004-run_bridge_hubs_wococo.toml deleted file mode 100644 index b938b1672d..0000000000 --- a/zombienet_tests/0004-run_bridge_hubs_wococo.toml +++ /dev/null @@ -1,37 +0,0 @@ -[relaychain] -default_command = "{{POLKADOT_BINARY_PATH}}" -default_args = [ "-lparachain=debug" ] - -chain = "wococo-local" - - [[relaychain.nodes]] - name = "alice" - validator = true - - [[relaychain.nodes]] - name = "bob" - validator = true - - [[relaychain.nodes]] - name = "charlie" - validator = true - -[[parachains]] -id = 1013 -cumulus_based = true -chain = "bridge-hub-wococo-local" - - [[parachains.collators]] - name = "alice" - command = "{{POLKADOT_PARACHAIN_BINARY_PATH}}" - args = ["-lparachain=debug"] - - [[parachains.collators]] - name = "bob" - command = "{{POLKADOT_PARACHAIN_BINARY_PATH}}" - args = ["-lparachain=debug"] - - [[parachains.collators]] - name = "charlie" - command = "{{POLKADOT_PARACHAIN_BINARY_PATH}}" - args = ["-lparachain=debug"]