-
Notifications
You must be signed in to change notification settings - Fork 770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bridge testing: Add manual test for P<>K asset transfer #3429
Changes from 5 commits
99babfd
cfdefdb
6c9218c
6306e36
2564a33
750779b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,23 +9,37 @@ To start those tests, you need to: | |
|
||
- download latest [zombienet release](https://github.com/paritytech/zombienet/releases); | ||
|
||
- build Polkadot binary by running `cargo build -p polkadot --release --features fast-runtime` command in the | ||
[`polkadot-sdk`](https://github.com/paritytech/polkadot-sdk) repository clone; | ||
- build Polkadot binary by running `cargo build -p polkadot --release --features fast-runtime` command in the | ||
[`polkadot-sdk`](https://github.com/paritytech/polkadot-sdk) repository clone; | ||
|
||
- build Polkadot Parachain binary by running `cargo build -p polkadot-parachain-bin --release` command in the | ||
[`polkadot-sdk`](https://github.com/paritytech/polkadot-sdk) repository clone; | ||
[`polkadot-sdk`](https://github.com/paritytech/polkadot-sdk) repository clone; | ||
|
||
- ensure that you have [`node`](https://nodejs.org/en) installed. Additionally, we'll need globally installed | ||
`polkadot/api-cli` package (use `npm install -g @polkadot/api-cli@beta` to install it); | ||
`polkadot/api-cli` package (use `yarn global add @polkadot/api-cli` to install it); | ||
|
||
- build Substrate relay by running `cargo build -p substrate-relay --release` command in the | ||
[`parity-bridges-common`](https://github.com/paritytech/parity-bridges-common) repository clone. | ||
[`parity-bridges-common`](https://github.com/paritytech/parity-bridges-common) repository clone. | ||
|
||
- copy fresh `substrate-relay` binary, built in previous point, to the `~/local_bridge_testing/bin/substrate-relay`; | ||
|
||
- change the `POLKADOT_SDK_PATH` and `ZOMBIENET_BINARY_PATH` (and ensure that the nearby variables | ||
have correct values) in the `./run-tests.sh`. | ||
- change the `ZOMBIENET_BINARY_PATH` (and ensure that the nearby variables have correct values) in | ||
the `./run-new-test.sh`. | ||
|
||
After that, you could run tests with the `./run-tests.sh` command. Hopefully, it'll show the | ||
"All tests have completed successfully" message in the end. Otherwise, it'll print paths to zombienet | ||
process logs, which, in turn, may be used to track locations of all spinned relay and parachain nodes. | ||
Extra steps for the Polkadot<>Kusama test: | ||
|
||
- clone the [`polkadot-fellows/runtimes`](https://github.com/polkadot-fellows/runtimes) locally and do the following | ||
adaptations (as an example see: | ||
https://github.com/serban300/runtimes/commit/4e5da529e8b3543e0400a6e524d5e883db1610ed): | ||
- Add the `sudo` pallet to the Polkadot and Kusama runtimes and give sudo rights to Alice. | ||
- Modify the Polkadot and Kusama runtimes such that the epoch time = 1 minute. The `chain-spec-generator` can't be | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd also suggest to automate this step by etiher fixing the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea. Opened a PR in the |
||
compiled with the `fast-runtime` feature. | ||
- Modify the Polkadot BridgeHub and the Kusama BridgeHub genesis config in order to make Alice bridge owner. | ||
serban300 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- build the chain spec generator by running `cargo build --release -p chain-spec-generator` command in the | ||
[`polkadot-fellows/runtimes`](https://github.com/polkadot-fellows/runtimes) repository clone. | ||
|
||
- copy fresh `chain-spec-generator` binary, built in previous point to `~/local_bridge_testing/bin/chain-spec-generator` | ||
|
||
After that, you could run tests with the `./run-new-test.sh <test>` command. Hopefully, it'll complete successfully. | ||
Otherwise, it'll print paths to zombienet logs and command logs, which can be used for debugging failures. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
[settings] | ||
node_spawn_timeout = 240 | ||
|
||
[relaychain] | ||
default_command = "{{POLKADOT_BINARY}}" | ||
default_args = ["-lparachain=debug,xcm=trace"] | ||
chain = "kusama-local" | ||
chain_spec_command = "{{CHAIN_SPEC_GEN_BINARY}} {% raw %} {{chainName}} {% endraw %}" | ||
|
||
[[relaychain.nodes]] | ||
name = "alice" | ||
validator = true | ||
rpc_port = 9935 | ||
ws_port = 9945 | ||
balance = 2000000000000 | ||
|
||
[[relaychain.nodes]] | ||
name = "bob" | ||
validator = true | ||
rpc_port = 9936 | ||
ws_port = 9946 | ||
balance = 2000000000000 | ||
|
||
[[relaychain.nodes]] | ||
name = "charlie" | ||
validator = true | ||
rpc_port = 9937 | ||
ws_port = 9947 | ||
balance = 2000000000000 | ||
|
||
[[parachains]] | ||
id = 1000 | ||
chain = "asset-hub-kusama-local" | ||
chain_spec_command = "{{CHAIN_SPEC_GEN_BINARY}} {% raw %} {{chainName}} {% endraw %}" | ||
cumulus_based = true | ||
|
||
[[parachains.collators]] | ||
name = "asset-hub-kusama-collator-1" | ||
rpc_port = 9011 | ||
ws_port = 9010 | ||
command = "{{POLKADOT_PARACHAIN_BINARY}}" | ||
args = [ | ||
"-lparachain=debug,xcm=trace,runtime::bridge-transfer=trace" | ||
] | ||
|
||
[[parachains.collators]] | ||
name = "asset-hub-kusama-collator-2" | ||
command = "{{POLKADOT_PARACHAIN_BINARY}}" | ||
args = [ | ||
"-lparachain=debug,xcm=trace,runtime::bridge-transfer=trace" | ||
] | ||
|
||
[[parachains]] | ||
id = 1002 | ||
chain = "bridge-hub-kusama-local" | ||
chain_spec_command = "{{CHAIN_SPEC_GEN_BINARY}} {% raw %} {{chainName}} {% endraw %}" | ||
cumulus_based = true | ||
|
||
# run alice as parachain collator | ||
[[parachains.collators]] | ||
name = "bridge-hub-kusama-collator-1" | ||
validator = true | ||
command = "{{POLKADOT_PARACHAIN_BINARY}}" | ||
rpc_port = 8935 | ||
ws_port = 8945 | ||
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=trace" | ||
] | ||
|
||
# run bob as parachain collator | ||
[[parachains.collators]] | ||
name = "bridge-hub-kusama-collator-2" | ||
validator = true | ||
command = "{{POLKADOT_PARACHAIN_BINARY}}" | ||
rpc_port = 8936 | ||
ws_port = 8946 | ||
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=trace" | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
[settings] | ||
node_spawn_timeout = 240 | ||
|
||
[relaychain] | ||
default_command = "{{POLKADOT_BINARY}}" | ||
default_args = ["-lparachain=debug,xcm=trace"] | ||
chain = "polkadot-local" | ||
chain_spec_command = "{{CHAIN_SPEC_GEN_BINARY}} {% raw %} {{chainName}} {% endraw %}" | ||
|
||
[[relaychain.nodes]] | ||
name = "alice" | ||
validator = true | ||
rpc_port = 9932 | ||
ws_port = 9942 | ||
balance = 2000000000000 | ||
|
||
[[relaychain.nodes]] | ||
name = "bob" | ||
validator = true | ||
rpc_port = 9933 | ||
ws_port = 9943 | ||
balance = 2000000000000 | ||
|
||
[[relaychain.nodes]] | ||
name = "charlie" | ||
validator = true | ||
rpc_port = 9934 | ||
ws_port = 9944 | ||
balance = 2000000000000 | ||
|
||
[[parachains]] | ||
id = 1000 | ||
chain = "asset-hub-polkadot-local" | ||
chain_spec_command = "{{CHAIN_SPEC_GEN_BINARY}} {% raw %} {{chainName}} {% endraw %}" | ||
cumulus_based = true | ||
|
||
[[parachains.collators]] | ||
name = "asset-hub-polkadot-collator-1" | ||
rpc_port = 9911 | ||
ws_port = 9910 | ||
command = "{{POLKADOT_PARACHAIN_BINARY}}" | ||
args = [ | ||
"-lparachain=debug,xcm=trace,runtime::bridge-transfer=trace" | ||
] | ||
|
||
[[parachains.collators]] | ||
name = "asset-hub-polkadot-collator-2" | ||
command = "{{POLKADOT_PARACHAIN_BINARY}}" | ||
args = [ | ||
"-lparachain=debug,xcm=trace,runtime::bridge-transfer=trace" | ||
] | ||
|
||
[[parachains]] | ||
id = 1002 | ||
chain = "bridge-hub-polkadot-local" | ||
chain_spec_command = "{{CHAIN_SPEC_GEN_BINARY}} {% raw %} {{chainName}} {% endraw %}" | ||
cumulus_based = true | ||
|
||
[[parachains.collators]] | ||
name = "bridge-hub-polkadot-collator-1" | ||
validator = true | ||
command = "{{POLKADOT_PARACHAIN_BINARY}}" | ||
rpc_port = 8933 | ||
ws_port = 8943 | ||
args = [ | ||
"-lparachain=debug,runtime::bridge-hub=trace,runtime::bridge=trace,runtime::bridge-dispatch=trace,bridge=trace,runtime::bridge-messages=trace,xcm=trace" | ||
] | ||
|
||
[[parachains.collators]] | ||
name = "bridge-hub-polkadot-collator-2" | ||
validator = true | ||
command = "{{POLKADOT_PARACHAIN_BINARY}}" | ||
rpc_port = 8934 | ||
ws_port = 8944 | ||
args = [ | ||
"-lparachain=trace,runtime::bridge-hub=trace,runtime::bridge=trace,runtime::bridge-dispatch=trace,bridge=trace,runtime::bridge-messages=trace,xcm=trace" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use a
sudofi
to add pallet to runtimes. For chain specs, maybe: maybe we could patchchain-spec-generator
for that? I.e. addsudo
feature? Alternatively, we could prepare a chain spec patch and ajq
call to patch chain spec, generated bychain-spec-generator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(also: please do not consider this as a requirement - the current version looks good as is, but we may improve it in the future)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion. I didn't know about
sudofi
. Will try.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sudofi
doesn't seem to work correctly on theruntimes
repo, and I'm not sure if we could patch the chain spec. For example I don't know if we could open the HRMP channels by patching the chain spec. I would keep this step manual for the moment and maybe improve it in the future.