paritytech / zombienet-sdk

ZombieNet SDK
https://paritytech.github.io/zombienet-sdk/zombienet_sdk/
GNU General Public License v3.0
28 stars 8 forks source link

Bootnodes are not customized for parachains #224

Closed patriciobcs closed 1 month ago

patriciobcs commented 1 month ago

Issue Description

While running a network composed of 1 node (rococo-local) and 2 collators (asset-hub-rococo-local), the parachain doesn't finalize the blocks (but it is producing them). However, the relay chain is finalizing the blocks. The problem is probably that the nodes can't discover each other as the bootnodes are not customized for the parachains. This can be checked by openning the base_dir and inpecting the asset-hub specs where the bootNodes vector is empty.

The logs show something like this:

2024-06-04 10:37:02.925  INFO tokio-runtime-worker substrate: [Relaychain] 💤 Idle (1 peers), best: #98 (0x7917…a8d7), finalized #95 (0xc01f…5a80), ⬇ 0.4kiB/s ⬆ 0.1kiB/s    
2024-06-04 10:37:02.925  INFO tokio-runtime-worker substrate: [Parachain] 💤 Idle (0 peers), best: #3 (0x0158…be24), finalized #0 (0xc293…a480), ⬇ 0 ⬆ 0    

Steps to reproduce the issue

Steps to reproduce the issue

  1. Create a new bin, add the following code and run.
  2. Check the logs to see that the blocks are not being finalized.
  3. Check the parachain spec in base_dir to see the empty bootnodes vector.
use zombienet_sdk::{NetworkConfigBuilder, NetworkConfigExt};

#[tokio::main]
async fn main() {
    tracing_subscriber::fmt::init();
    let config = NetworkConfigBuilder::new()
        .with_relaychain(|r| {
            r.with_chain("rococo-local")
                .with_default_command("polkadot")
                .with_default_args(vec!["-lparachain=debug".into()])
                .with_node(|node| {
                    node.with_name("polkadot")
                    .with_args(vec![
                        "--alice".into(),
                    ])
                })
        })
        .with_parachain(|p| {
            p.with_id(100)
                .with_chain("asset-hub-rococo-local")
                .with_collator(|n| {
                    n.with_name("asset-hub")
                        .with_args(vec!["-lruntime=debug,parachain=trace".into()])
                        .with_ws_port(42068)
                        .with_command("polkadot-parachain")
                })
                .with_collator(|n| {
                    n.with_name("asset-hub2")
                        .with_args(vec!["-lruntime=debug,parachain=trace".into()])
                        .with_ws_port(42069)
                        .with_command("polkadot-parachain")
                })
        })
        .with_global_settings(|s| {
            s.with_node_spawn_timeout(1000)
                .with_network_spawn_timeout(1000)
        })
        .build()
        .unwrap()
        .spawn_native()
        .await.unwrap();

    loop { }
}

Dependencies

tokio = "1.37.0"
tracing-subscriber = "0.3.18"
zombienet-sdk = "0.2.3"

Describe the results you received

The asset hub generated specs:

{
  "name": "Rococo Asset Hub Local",
  "id": "asset-hub-rococo-local",
  "chainType": "Local",
  "bootNodes": [],
  "telemetryEndpoints": null,
  "protocolId": null,
  "properties": {
    "ss58Format": 42,
    "tokenDecimals": 12,
    "tokenSymbol": "ROC"
  },
  "relay_chain": "rococo_local_testnet",
  "para_id": 100,
  "codeSubstitutes": {},
  "genesis": {
    "raw": {
      "top": {
...

The logs:

2024-06-04 10:27:32.468  INFO tokio-runtime-worker substrate: [Parachain] 💤 Idle (0 peers), best: #0 (0xc293…a480), finalized #0 (0xc293…a480), ⬇ 0 ⬆ 0    
2024-06-04 10:27:32.468  INFO tokio-runtime-worker substrate: [Relaychain] 💤 Idle (1 peers), best: #3 (0x4fc9…f4bc), finalized #1 (0x99dd…e8c4), ⬇ 0.5kiB/s ⬆ 0.3kiB/s    

Describe the results you expected

Parachain bootnodes are correctly customized, so the relay chain can sync with the parachain and blocks are finalized accordingly.

Zombienet version

0.2.3

Provider

Native

Provider version

## For binaries
polkadot 1.11.0-0bb6249268c
polkadot-parachain 1.11.0-0bb6249268c

Upstream Latest Release

Yes

Additional environment details

MacOS

Additional information

No response

Screenshots

No response

pepoviola commented 1 month ago

Fixed by #225 , thanks for the feedback!