git.delta.rocks / unique-network / refs/commits / 15ffc18e7f8a

difftreelog

refactor(zombienet) minor fixes and clarity

Fahrrader2023-04-28parent: #48f9af6.patch.diff
in: master

3 files changed

modified.docker/forkless-config/zombienet-forkless-nodata.tomldiffbeforeafterboth
--- a/.docker/forkless-config/zombienet-forkless-nodata.toml
+++ b/.docker/forkless-config/zombienet-forkless-nodata.toml
@@ -18,12 +18,6 @@
 
 [[parachains]]
 id = 1000
-chain_spec_modifier_commands = [[
-  "chainql",
-  "--tla-code=rawSpec=import '{{'raw'|chainSpec}}'",
-  "--tla-str=forkFrom={{ REPLICA_FROM }}",
-  "fork.jsonnet",
-]]
 
   [[parachains.collators]]
   name = "alice"
modifiedlaunch-zombienet.tomldiffbeforeafterboth
before · launch-zombienet.toml
1# To launch this zombienet out-of-the-box, you can use `yarn frankenstein` in the `tests` folder.23[settings]4provider = "native"56[relaychain]7# RELAY_DIR is an environment variable. You should likely specify it as ../polkadot/8default_command = "{{RELAY_DIR}}target/release/polkadot"9default_args = [ "-lparachain::candidate_validation=debug", "-lxcm=trace", ]10chain = "rococo-local"1112  [[relaychain.nodes]]13  name = "relay-alice"14  ws_port = 984415  rpc_port = 984316  p2p_port = 304441718  [[relaychain.node_groups]]19  name = "relay"20  count = 42122[[parachains]]23id = 10002425  [[parachains.collators]]26  name = "alice"27  # PARA_DIR is an environment variable. You should likely specify it as ./28  command = "{{PARA_DIR}}target/release/unique-collator"29  ws_port = 994430  rpc_port = 993331  p2p_port = 3120032  args = [ "-lxcm=trace", ]3334  [[parachains.collators]]35  name = "bob"36  # PARA_DIR is an environment variable. You should likely specify it as ./37  command = "{{PARA_DIR}}target/release/unique-collator"38  ws_port = 994539  rpc_port = 993440  p2p_port = 3120141  args = [ "-lxcm=trace", ]
after · launch-zombienet.toml
1# To launch this zombienet out-of-the-box, run `yarn frankenstein` in the `tests` folder.23[settings]4provider = "native"56[relaychain]7# RELAY_DIR is an environment variable. If you're launching ZN from the repository's root, you should likely specify it as ../polkadot/8default_command = "{{RELAY_DIR}}target/release/polkadot"9default_args = [ "-lparachain::candidate_validation=debug", "-lxcm=trace", ]10chain = "rococo-local"1112  [[relaychain.nodes]]13  name = "relay-alice"14  ws_port = 984415  rpc_port = 984316  p2p_port = 304441718  [[relaychain.node_groups]]19  name = "relay"20  count = 42122[[parachains]]23id = 10002425  [[parachains.collators]]26  name = "alice"27  # PARA_DIR is an environment variable. If you're launching ZN from the repository's root, you should likely specify it as ./28  command = "{{PARA_DIR}}target/release/unique-collator"29  ws_port = 994430  rpc_port = 993331  p2p_port = 3120032  args = [ "-lxcm=trace", ]3334  [[parachains.collators]]35  name = "bob"36  # PARA_DIR is an environment variable. If you're launching ZN from the repository's root, you should likely specify it as ./37  command = "{{PARA_DIR}}target/release/unique-collator"38  ws_port = 994539  rpc_port = 993440  p2p_port = 3120141  args = [ "-lxcm=trace", ]
modifiedtests/src/util/frankenstein.tsdiffbeforeafterboth
--- a/tests/src/util/frankenstein.ts
+++ b/tests/src/util/frankenstein.ts
@@ -96,7 +96,7 @@
 }
 
 const raiseZombienet = async (): Promise<void> => {
-  const isUpgradeTesting = !!NEW_RELAY_BIN || !!NEW_RELAY_WASM || !!NEW_RELAY_BIN && !!NEW_PARA_WASM;
+  const isUpgradeTesting = !!NEW_RELAY_BIN || !!NEW_RELAY_WASM || !!NEW_PARA_BIN || !!NEW_PARA_WASM;
   /*
   // If there is nothing to upgrade, what is the point
   if (!isUpgradeTesting) {
@@ -120,18 +120,19 @@
 
   await cryptoWaitReady();
 
+  // Launch Zombienet!
+  network = await zombie.start(ZOMBIENET_CREDENTIALS, networkConfig, {silent: false});
+
   // Get the relay chain info like the epoch length and spec version
   // Then restart each parachain's binaries
   // // Stop and restart each node
   // // Send specified keys to parachain nodes in case the parachain requires it
   // If it is not needed to upgrade runtimes themselves, the job is done!
 
-  network = await zombie.start(ZOMBIENET_CREDENTIALS, networkConfig, {silent: false});
-
   // Record some required information regarding the relay chain
   await network.relay[0].connectApi();
   let relayInfo = getRelayInfo(network.relay[0].apiInstance!);
-  await network.relay[0].apiInstance?.disconnect();
+  await network.relay[0].apiInstance!.disconnect();
   if (isUpgradeTesting) {
     console.log('Relay stats:', relayInfo);
   }
@@ -172,6 +173,7 @@
 
         await node.restart();
         // applyaurakey?
+        // Zombienet handles it on first-time node creation
       }
     }