Skip to content
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

E2E test for parachain teleportation #231

Closed
rzadp opened this issue Mar 14, 2023 · 1 comment · Fixed by #236
Closed

E2E test for parachain teleportation #231

rzadp opened this issue Mar 14, 2023 · 1 comment · Fixed by #236

Comments

@rzadp
Copy link
Contributor

rzadp commented Mar 14, 2023

The current test for teleporting assets is not quite real:

https://github.com/paritytech/substrate-matrix-faucet/blob/86a71d061a2aede66672285d0a6df7ff2fa7394f/src/faucet.e2e.ts#L73-L81

The bot simply sends a XCM message, and doesn't verify that it actually has the final effect.
Similarly this current test just checks that the bot accepted the message and responded, but doesn't verify the balances before/after. (And it can't do it, because in current E2E setup there is no parachain to teleport to.

I'm creating this issue for discussion and help around this topic.

@rzadp
Copy link
Contributor Author

rzadp commented Mar 14, 2023

I've been experimenting with crafting this test and I am quite stuck.

What I'm doing

I have built locally:

  • polkadot version v0.9.39 with cargo build --profile testnet
  • In same repo, built a parachain with cargo build --profile testnet -p test-parachain-adder-collator
  • Added resulting binaries polkadot and adder-collator to PATH
  • Run zombienet using native binaries with ./zombienet-macos --provider native spawn examples/0001-small-network.toml and the following config:
# modified zombienet/examples/0001-small-network.toml
[relaychain]
default_image = "docker.io/parity/polkadot:latest"
default_command = "polkadot"
default_args = [ "-lparachain=debug" ]

chain = "rococo-local"

  [[relaychain.nodes]]
  name = "alice"
  validator = true

  [[relaychain.nodes]]
  name = "bob"
  validator = true

[[parachains]]
id = 100

  [parachains.collator]
  name = "collator01"
  command = "adder-collator"
  args = ["-lparachain=debug"]

It successfully spins up a local testnet with a parachain:

Screenshot 2023-03-14 at 12 33 09

Next, I'm trying to teleport tokens to parachain 100 in the same way the bot would do it, in the UI (before I move on to automating it in a test).

Screen Shot 2023-03-14 at 13 53 33-fullpage

Results

The XCM seem to be sent and execution is attempted, but it has no further effect. The balance of Alice does not decrease appropriately and no other effect is observed.

Screenshot 2023-03-14 at 13 54 20

Screenshot 2023-03-14 at 13 54 29

Questions I have

  1. What am I missing here, how can I proceed here?
  2. Is the adder-collator a proper parachain for this use case? Or does it some pallet or the ability to pick up XCM messages?
  3. How to check a balance of a given account on the parachain, using @polkadot/api in JS or using polkadot.js.org UI? Seems like something simple but I could not find this information.

Things I have discovered along the way

  • There is this issue which has been fixed in a recent release of Polkadot, but not in Cumulus yet. So this prevents me from running polkadot-parachain from Cumulus on macOS.
  • A parachain seem to require at least 2 validators of the main relay node, otherwise it doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant