2

Originally I had this network definition file:

[relaychain]
default_image = "docker.io/paritypr/polkadot-debug:master"
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"
  image = "docker.io/paritypr/colander:master"
  command = "adder-collator"

[types.Header]
number = "u64"
parent_hash = "Hash"
post_state = "Hash"

and my test file:

Description: Small Network test
Network: ./z01-small-network.toml
Creds: config

# well know functions
alice: is up
bob: is up
alice: parachain 100 is registered within 225 seconds

# logs
bob: log line matches glob "*rted #1*" within 10 seconds
bob: log line matches "Imported #[0-9]+" within 10 seconds
bob: log line matches "Imported new block." within 10 seconds

alice: parachain 100 block height is at least 6 within 150 seconds

# Tracing
# alice: trace with traceID 94c1501a78a0d83c498cc92deec264d9 contains ["answer-chunk-request", "answer-chunk-request"]

# metrics
alice: reports node_roles is 4
alice: reports sub_libp2p_is_major_syncing is 0

# histogram
#alice: reports histogram polkadot_pvf_execution_time has at least 2 samples in buckets ["0.1", "0.25", "0.5", "+Inf"] within 100 seconds

# system events
bob: system event contains "A candidate was included" within 20 seconds
alice: system event matches glob "*was backed*" within 10 seconds

The test ran successfully.

Then I changed the parachain id from 100 to 2000 in my network definition file:

[[parachains]]
id = 2000

and changed it in my test file

alice: parachain 2000 is registered within 225 seconds
alice: parachain 2000 block height is at least 6 within 150 seconds

then block height test failed !!!??? What happened?

    ✔ alice: is up (159ms)
    ✔ bob: is up (93ms)
2022-05-12 21:43:44        API/INIT: RPC methods not decorated: beefy_getFinalizedHead, mmr_generateBatchProof, state_trieMigrationStatus
    ✔ alice: parachain 2000 is registered within 225 seconds (3035ms)
    ✔ bob: log line matches glob "*rted #1*" within 10 seconds (194ms)
    ✔ bob: log line matches "Imported #[0-9]+" within 10 seconds (195ms)
    ✔ bob: log line matches "Imported new block." within 10 seconds (123ms)

     Error:  
         Timeout(150), "getting desired parachain block height 6 within 150 secs".

    1) alice: parachain 2000 block height is at least 6 within 150 seconds
    ✔ alice: reports node_roles is 4
    ✔ alice: reports sub_libp2p_is_major_syncing is 0
2022-05-12 21:46:18        API/INIT: RPC methods not decorated: beefy_getFinalizedHead, mmr_generateBatchProof, state_trieMigrationStatus
    2) bob: system event contains "A candidate was included" within 20 seconds
2022-05-12 21:46:38        API/INIT: RPC methods not decorated: beefy_getFinalizedHead, mmr_generateBatchProof, state_trieMigrationStatus
    3) alice: system event matches glob "*was backed*" within 10 seconds

     Node's logs are available in /tmp/zombie-540455ef8ad2e803ca8f34df7aba359c_-267460-xyaOcnkB7UwG/logs

     Deleting network
2022-05-12 21:46:48        RPC-CORE: health(): Health:: disconnected from ws://127.0.0.1:41881: 1000:: Normal connection closure
2022-05-12 21:46:55        RPC-CORE: getStorage(key: StorageKey, at?: BlockHash): StorageData:: disconnected from ws://127.0.0.1:41881: 1006:: Connection dropped by remote peer.
2022-05-12 21:46:55        RPC-CORE: health(): Health:: disconnected from ws://127.0.0.1:41881: 1006:: Connection dropped by remote peer.
child process exited


  8 passing (6m)
  3 failing

  1) small network( Small Network test )
       alice: parachain 2000 block height is at least 6 within 150 seconds:

      AssertionError: expected 0 to be at least 6
      + expected - actual

      -0
      +6
      
      at /snapshot/zombienet/dist/test-runner/index.js:265:37
      at Generator.next (<anonymous>)
      at fulfilled (/snapshot/zombienet/dist/test-runner/index.js:24:58)

  2) small network( Small Network test )
       bob: system event contains "A candidate was included" within 20 seconds:
     AssertionError: expected false to be truthy
      at /snapshot/zombienet/dist/test-runner/index.js:367:32
      at Generator.next (<anonymous>)
      at fulfilled (/snapshot/zombienet/dist/test-runner/index.js:24:58)
      at runNextTicks (node:internal/process/task_queues:61:5)
      at processTimers (node:internal/timers:497:9)

  3) small network( Small Network test )
       alice: system event matches glob "*was backed*" within 10 seconds:
     AssertionError: expected false to be truthy
      at /snapshot/zombienet/dist/test-runner/index.js:367:32
      at Generator.next (<anonymous>)
      at fulfilled (/snapshot/zombienet/dist/test-runner/index.js:24:58)

What is wrong?

I think I got some clues from the collor01 log:

kubectl logs -f collator01 -c collator01 -n zombie-540455ef8...

The collator logs:

2022-05-12 13:43:53 📦 Highest known block at #0    
2022-05-12 13:43:53 〽️ Prometheus exporter started at 127.0.0.1:9615    
2022-05-12 13:43:53 Running JSON-RPC HTTP server: addr=0.0.0.0:9933, allowed origins=None    
2022-05-12 13:43:53 Running JSON-RPC WS server: addr=0.0.0.0:9944, allowed origins=None    
2022-05-12 13:43:53 Running adder collator for parachain id: 100    
2022-05-12 13:43:53 Genesis state: 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000011b4d03dd8c01f1049143cf9c4c817e4b167f1d1b83e5c6f0f10d89ba1e7bce    
2022-05-12 13:43:53 Validation code: 0x52bc537646db8e0528b52ffd

Can you see parachain id: 100 from above log? ... That is not correct! It should have been 2000!

Then the logs continue:

2022-05-12 13:43:53 👶 New epoch 0 launching at block 0x71a4…bf72 (block slot 275393835 >= start slot 275393835).    
2022-05-12 13:43:53 👶 Next epoch starts at slot 275393845    
2022-05-12 13:43:53 ParentBlockRandomness did not provide entropy    
2022-05-12 13:43:53 ✨ Imported #1 (0x71a4…bf72)    
2022-05-12 13:43:53 ✨ Imported #2 (0xbdb6…88d8)    
2022-05-12 13:43:53 ✨ Imported #3 (0xd762…e188)    
2022-05-12 13:43:53 ✨ Imported #4 (0x3d10…f120)    
2022-05-12 13:43:54 ✨ Imported #5 (0x829d…0813)    
2022-05-12 13:43:58 💤 Idle (2 peers), best: #5 (0x829d…0813), finalized #2 (0xbdb6…88d8), ⬇ 4.1kiB/s ⬆ 3.1kiB/s    
2022-05-12 13:44:00 ✨ Imported #6 (0xf678…876a)    
2022-05-12 13:44:03 💤 Idle (2 peers), best: #6 (0xf678…876a), finalized #2 (0xbdb6…88d8), ⬇ 0.6kiB/s ⬆ 0.4kiB/s    
2022-05-12 13:44:06 ✨ Imported #7 (0x52b3…2894)    
2022-05-12 13:44:08 💤 Idle (2 peers), best: #7 (0x52b3…2894), finalized #4 (0x3d10…f120), ⬇ 0.6kiB/s ⬆ 0.3kiB/s    
2022-05-12 13:44:12 ✨ Imported #8 (0x67d0…b6ea)    
2022-05-12 13:44:13 💤 Idle (2 peers), best: #8 (0x67d0…b6ea), finalized #4 (0x3d10…f120), ⬇ 0.6kiB/s ⬆ 0.3kiB/s    
2022-05-12 13:44:18 ✨ Imported #9 (0x3fa7…f515)    
2022-05-12 13:44:18 ✨ Imported #9 (0x802e…c090)    
2022-05-12 13:44:18 💤 Idle (2 peers), best: #9 (0x3fa7…f515), finalized #5 (0x829d…0813), ⬇ 1.1kiB/s ⬆ 0.4kiB/s    
2022-05-12 13:44:23 💤 Idle (2 peers), best: #9 (0x3fa7…f515), finalized #6 (0xf678…876a), ⬇ 0.3kiB/s ⬆ 0.2kiB/s    
2022-05-12 13:44:24 ✨ Imported #10 (0x2141…a0f2)    
2022-05-12 13:44:28 💤 Idle (2 peers), best: #10 (0x2141…a0f2), finalized #6 (0xf678…876a), ⬇ 0.8kiB/s ⬆ 0.5kiB/s    
2022-05-12 13:44:30 👶 New epoch 1 launching at block 0x79b1…6fe6 (block slot 275393845 >= start slot 275393845).    
2022-05-12 13:44:30 👶 Next epoch starts at slot 275393855    
2022-05-12 13:44:30 ✨ Imported #11 (0x79b1…6fe6)    
2022-05-12 13:44:30 Advanced session window for approvals update=Advanced { prev_window_start: 0, prev_window_end: 0, new_window_start: 0, new_window_end: 1 }
2022-05-12 13:44:33 💤 Idle (2 peers), best: #11 (0x79b1…6fe6), finalized #8 (0x67d0…b6ea), ⬇ 0.8kiB/s ⬆ 0.4kiB/s    
2022-05-12 13:44:36 ✨ Imported #12 (0x5d1b…193a)    
2022-05-12 13:44:38 💤 Idle (2 peers), best: #12 (0x5d1b…193a), finalized #9 (0x3fa7…f515), ⬇ 0.7kiB/s ⬆ 0.4kiB/s    
2022-05-12 13:44:42 ✨ Imported #13 (0x2bbe…b677)    
2022-05-12 13:44:43 💤 Idle (2 peers), best: #13 (0x2bbe…b677), finalized #9 (0x3fa7…f515), ⬇ 0.7kiB/s ⬆ 0.4kiB/s    
2022-05-12 13:44:48 ✨ Imported #14 (0xe1fd…55f4)    
2022-05-12 13:44:48 💤 Idle (2 peers), best: #14 (0xe1fd…55f4), finalized #10 (0x2141…a0f2), ⬇ 0.6kiB/s ⬆ 0.3kiB/s    
2022-05-12 13:44:53 💤 Idle (2 peers), best: #14 (0xe1fd…55f4), finalized #10 (0x2141…a0f2), ⬇ 0.1kiB/s ⬆ 0.1kiB/s    
2022-05-12 13:44:54 ✨ Imported #15 (0xef73…58aa)    
2022-05-12 13:44:58 💤 Idle (2 peers), best: #15 (0xef73…58aa), finalized #12 (0x5d1b…193a), ⬇ 1.0kiB/s ⬆ 0.6kiB/s    
2022-05-12 13:45:00 ✨ Imported #16 (0xe38e…e485)    
2022-05-12 13:45:03 💤 Idle (2 peers), best: #16 (0xe38e…e485), finalized #13 (0x2bbe…b677), ⬇ 0.8kiB/s ⬆ 0.5kiB/s    
2022-05-12 13:45:06 ✨ Imported #17 (0xa379…9ad5)    
2022-05-12 13:45:08 💤 Idle (2 peers), best: #17 (0xa379…9ad5), finalized #13 (0x2bbe…b677), ⬇ 0.5kiB/s ⬆ 0.3kiB/s    
2022-05-12 13:45:12 ✨ Imported #18 (0x6eaf…c841)    
2022-05-12 13:45:13 💤 Idle (2 peers), best: #18 (0x6eaf…c841), finalized #14 (0xe1fd…55f4), ⬇ 0.7kiB/s ⬆ 0.4kiB/s    
2022-05-12 13:45:18 ✨ Imported #19 (0x0359…55b3)    
2022-05-12 13:45:18 💤 Idle (2 peers), best: #19 (0x0359…55b3), finalized #16 (0xe38e…e485), ⬇ 0.8kiB/s ⬆ 0.5kiB/s    
2022-05-12 13:45:23 💤 Idle (2 peers), best: #19 (0x0359…55b3), finalized #16 (0xe38e…e485), ⬇ 0.1kiB/s ⬆ 0.1kiB/s    
2022-05-12 13:45:24 ✨ Imported #20 (0x247a…3829)    
2022-05-12 13:45:28 💤 Idle (2 peers), best: #20 (0x247a…3829), finalized #17 (0xa379…9ad5), ⬇ 0.7kiB/s ⬆ 0.4kiB/s    
2022-05-12 13:45:30 👶 New epoch 2 launching at block 0xa37b…ff93 (block slot 275393855 >= start slot 275393855).    
2022-05-12 13:45:30 👶 Next epoch starts at slot 275393865    
2022-05-12 13:45:30 ✨ Imported #21 (0xa37b…ff93)    
2022-05-12 13:45:30 Advanced session window for approvals update=Advanced { prev_window_start: 0, prev_window_end: 1, new_window_start: 0, new_window_end: 2 }
2022-05-12 13:45:33 💤 Idle (2 peers), best: #21 (0xa37b…ff93), finalized #17 (0xa379…9ad5), ⬇ 0.9kiB/s ⬆ 0.6kiB/s    
2022-05-12 13:45:36 ✨ Imported #22 (0xa43c…2cac)    
2022-05-12 13:45:38 💤 Idle (2 peers), best: #22 (0xa43c…2cac), finalized #18 (0x6eaf…c841), ⬇ 0.8kiB/s ⬆ 0.5kiB/s    
2022-05-12 13:45:42 ✨ Imported #23 (0x4cfd…b4da)    
2022-05-12 13:45:42 ✨ Imported #23 (0x068d…70fe)    
2022-05-12 13:45:43 💤 Idle (2 peers), best: #23 (0x4cfd…b4da), finalized #20 (0x247a…3829), ⬇ 1.2kiB/s ⬆ 0.5kiB/s    
2022-05-12 13:45:48 ✨ Imported #24 (0xb9b6…778e)    
2022-05-12 13:45:48 💤 Idle (2 peers), best: #24 (0xb9b6…778e), finalized #20 (0x247a…3829), ⬇ 0.6kiB/s ⬆ 0.3kiB/s    
2022-05-12 13:45:49 👴 Applying authority set change scheduled at block #21    
2022-05-12 13:45:49 👴 Applying GRANDPA set change to new set [(Public(a40f9c22185e85da8b7bd994b4305dbdab004da2288cc77061cb216bb264f0cc (5FmpM6me...)), 1), (Public(e922806258d9c1257d168f05bdbaa87e33c0e90bc38803c9af6c56dbf0206898 (5HLPGEGr...)), 1)]    
2022-05-12 13:45:53 💤 Idle (2 peers), best: #24 (0xb9b6…778e), finalized #21 (0xa37b…ff93), ⬇ 0.2kiB/s ⬆ 0.2kiB/s    
2022-05-12 13:45:54 ✨ Imported #25 (0x4d0f…3ccb)    
2022-05-12 13:45:58 💤 Idle (2 peers), best: #25 (0x4d0f…3ccb), finalized #22 (0xa43c…2cac), ⬇ 0.8kiB/s ⬆ 0.5kiB/s    
2022-05-12 13:46:00 ✨ Imported #26 (0xc6a3…c6cf)    
2022-05-12 13:46:03 💤 Idle (2 peers), best: #26 (0xc6a3…c6cf), finalized #22 (0xa43c…2cac), ⬇ 0.7kiB/s ⬆ 0.4kiB/s    
2022-05-12 13:46:06 ✨ Imported #27 (0xae85…8571)    
2022-05-12 13:46:08 💤 Idle (2 peers), best: #27 (0xae85…8571), finalized #24 (0xb9b6…778e), ⬇ 0.5kiB/s ⬆ 0.3kiB/s    
2022-05-12 13:46:12 ✨ Imported #28 (0x9d19…13c4)    
2022-05-12 13:46:13 💤 Idle (2 peers), best: #28 (0x9d19…13c4), finalized #24 (0xb9b6…778e), ⬇ 0.7kiB/s ⬆ 0.3kiB/s    
2022-05-12 13:46:18 ✨ Imported #29 (0xf8c2…4e06)    
2022-05-12 13:46:18 ✨ Imported #29 (0x59aa…25c4)    
2022-05-12 13:46:18 💤 Idle (2 peers), best: #29 (0xf8c2…4e06), finalized #25 (0x4d0f…3ccb), ⬇ 1.3kiB/s ⬆ 0.5kiB/s    
2022-05-12 13:46:23 💤 Idle (2 peers), best: #29 (0xf8c2…4e06), finalized #26 (0xc6a3…c6cf), ⬇ 0.3kiB/s ⬆ 0.2kiB/s    
2022-05-12 13:46:24 ✨ Imported #30 (0x1299…4771)    
2022-05-12 13:46:28 💤 Idle (2 peers), best: #30 (0x1299…4771), finalized #26 (0xc6a3…c6cf), ⬇ 0.6kiB/s ⬆ 0.3kiB/s    
2022-05-12 13:46:30 👶 New epoch 3 launching at block 0x0c6a…262c (block slot 275393865 >= start slot 275393865).    
2022-05-12 13:46:30 👶 Next epoch starts at slot 275393875    
2022-05-12 13:46:30 ✨ Imported #31 (0x0c6a…262c)    
2022-05-12 13:46:30 Advanced session window for approvals update=Advanced { prev_window_start: 0, prev_window_end: 2, new_window_start: 0, new_window_end: 3 }
2022-05-12 13:46:33 💤 Idle (2 peers), best: #31 (0x0c6a…262c), finalized #28 (0x9d19…13c4), ⬇ 1.0kiB/s ⬆ 0.6kiB/s    
2022-05-12 13:46:36 ✨ Imported #32 (0x0e5a…2db8)    
2022-05-12 13:46:38 💤 Idle (2 peers), best: #32 (0x0e5a…2db8), finalized #29 (0xf8c2…4e06), ⬇ 1.0kiB/s ⬆ 0.4kiB/s    
2022-05-12 13:46:42 ✨ Imported #33 (0x9cd3…0317)    
2022-05-12 13:46:42 ✨ Imported #33 (0x0f64…393a)    
2022-05-12 13:46:43 💤 Idle (2 peers), best: #33 (0x9cd3…0317), finalized #29 (0xf8c2…4e06), ⬇ 1.2kiB/s ⬆ 0.5kiB/s    
2022-05-12 13:46:48 ♻️  Reorg on #33,0x9cd3…0317 to #34,0x8365…1cb9, common ancestor #32,0x0e5a…2db8    
2022-05-12 13:46:48 ✨ Imported #34 (0x8365…1cb9)    
2022-05-12 13:46:48 💤 Idle (2 peers), best: #34 (0x8365…1cb9), finalized #30 (0x1299…4771), ⬇ 0.6kiB/s ⬆ 0.3kiB/s    
2022-05-12 13:46:53 💤 Idle (2 peers), best: #34 (0x8365…1cb9), finalized #30 (0x1299…4771), ⬇ 0.3kiB/s ⬆ 0.3kiB/s    
2022-05-12 13:46:53 👴 Applying authority set change scheduled at block #31    

I can see Imported #33 so the parachain collator had been producing many blocks.

So why the block height test failed???

I am using the latest zombienet-linux v1.2.32

3 Answers 3

3

https://github.com/paritytech/polkadot/blob/decdbedea6d49b0604fee3241970a7ff383fe1db/parachain/test-parachains/adder/collator/src/main.rs#L87

If there is none provided via the CLI, the adder collator will assume 100 as default.

Note that adder-collator is the utmost basic collator one can imagine, it should only be used for basic smoke tests.

3
1

From version v1.2.34, parachain-id argument is handled automatically by zombienet so this configuration should works as expected.

[relaychain]
default_image = "docker.io/parity/polkadot:v0.9.18"
default_command = "polkadot"
default_args = [ "-lparachain=debug" ]

chain = "rococo-local"

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

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

[[parachains]]
id = 2000

  [parachains.collator]
  name = "collator01"
  image = "docker.io/paritypr/colander:master"
  command = "adder-collator"

[types.Header]
number = "u64"
parent_hash = "Hash"
post_state = "Hash"
0

add this line: args = ["--parachain-id 2000"] so network definition file:

[relaychain]
default_image = "docker.io/parity/polkadot:v0.9.18"
default_command = "polkadot"
default_args = [ "-lparachain=debug" ]

chain = "rococo-local"

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

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

[[parachains]]
id = 2000

  [parachains.collator]
  name = "collator01"
  image = "docker.io/paritypr/colander:master"
  command = "adder-collator"
  args = ["--parachain-id 2000"]

[types.Header]
number = "u64"
parent_hash = "Hash"
post_state = "Hash"
2
  • 2
    Hi @Russo, I just push a change draft a new release v1.2.34 where you don't need to set the parachain-id argument anymore. Thanks for your feedback!
    – pepoviola
    May 16, 2022 at 19:34
  • It works! Thank you :)
    – Russo
    May 17, 2022 at 4:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.