paritytech / zombienet

A cli tool to easily spawn ephemeral Polkadot/Substrate networks and perform tests against them.
https://paritytech.github.io/zombienet/
GNU General Public License v3.0
157 stars 92 forks source link

`1.3.64` adds duplicate balances to plain spec #1270

Closed timbrinded closed 1 year ago

timbrinded commented 1 year ago

Issue Description

In Zombienet versions CLI:1.3.64 and orchestrator:0.0.51 attempting to launch a network causes a panic due to build-spec attempting to process a duplicate balance added to the zombienet appended moonbeam plain spec.

There is a collision between the first four dev accounts getting funded and the collator being getting funded.

Steps to reproduce the issue

Using a very simple network spec, e.g.:

{
  "settings": {
    "provider": "native"
  },
  "relaychain": {
    "chain": "rococo-local",
    "default_command": "./polkadot",
    "nodes": [
      {
        "name": "alice",
        "validator": true
      },
      {
        "name": "bob",
        "validator": true
      }
    ]
  },
  "parachains": [
    {
      "chain": "moonbase-local",
      "id": 2000,
      "collator": {
        "command": "./moonbeam",
        "name": "alith"
      }
    }
  ]
}

Attempt to spawn e.g. zombienet spawn moonbeam.json

Describe the results you received

Panic due to multiple balances:

Error:       Error: Command failed with exit code 1: bash -c ./moonbeam build-spec --chain /tmp/zombie-4adb2c0eaf1d486e840693aada5e98ab_-898105-PVOHSK85fMET/moonbase-local-2000-rococo-local-plain.json --disable-default-bootnode  --raw > /tmp/zombie-4adb2c0eaf1d486e840693aada5e98ab_-898105-PVOHSK85fMET/moonbase-local-2000-rococo-local-raw.json
2023-08-23 09:07:34 Building chain spec    

In the moonbase plain spec, here is the balances section:

 "balances": {
        "balances": [
          [
            "0xf24ff3a9cf04c71dbc94d0b566f7a27b94566cac",
            1208925819614629174706176
          ],
          [
            "0x3cd0a705a2dc65e5b1e1205896baa2be8a07c6e0",
            1208925819614629174706176
          ],
          [
            "0x798d4ba9baf0064ec19eb4f0a1a45785ae9d6dfc",
            1208925819614629174706176
          ],
          [
            "0x773539d4ac0e786233d90a233654ccee26a613d9",
            1208925819614629174706176
          ],
          [
            "0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac",
            1100000000000000000000
          ]
        ]
      },

Describe the results you expected

I would expect that the function that modifies the plain spec to emplace the map, as in do a lookup - and append if it exists, or creates if none found.

Zombienet version

CLI: 1.3.65 , Orchestrator: 0.0.52

Provider

Native

Provider version

polkadot 1.0.0-1ed6e2e50a4
moonbeam 0.31.1-b71106f4510

Upstream Latest Release

Yes

Additional environment details

Additional environment details

Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

Screenshots

image

pepoviola commented 1 year ago

Thanks for report @timbrinded, I will take a look asap. Thx!

timbrinded commented 1 year ago

Just a reminder, this is still an issue on latest pkg versions

pepoviola commented 1 year ago

Ahh, sorry about the delay @timbrinded. I though it was resolved. I will take a look on this today. Thanks!!

pepoviola commented 1 year ago

@timbrinded, can you please try this pr (https://github.com/paritytech/zombienet/pull/1329). Now I get this error on native provider "cannot deserialize module: UnknownOpcode(192)" but I'm not sure the root cause.

Logs:

2023-09-06 01:13:15 🏷  Node name: alith
2023-09-06 01:13:15 👤 Role: AUTHORITY
2023-09-06 01:13:15 💾 Database: RocksDb at /tmp/zombie-c00cf30a0b169f888527970fa0e39ddf_-3525562-RguCJvBh7JMf/alith/data/chains/moonbase_local/db/full
2023-09-06 01:13:15 ⛓  Native runtime: moonbase-2400 (moonbase-0.tx2.au4)
2023-09-06 01:13:16 Parachain id: Id(2000)
2023-09-06 01:13:16 Parachain Account: 5Ec4AhPUwPeyTFyuhGuBbD224mY85LKLMSqSSo33JYWCazU4
2023-09-06 01:13:16 Parachain genesis state: 0x000000000000000000000000000000000000000000000000000000000000000000aa76c1412a635050c865fba07612b68f5e0abb36a6b852d0ea1ac82222355ab503170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c11131400
2023-09-06 01:13:16 Is collating: yes
2023-09-06 01:13:16 [🌗] Cannot create a runtime error=Other("cannot deserialize module: UnknownOpcode(192)")
Error: Service(Client(VersionInvalid("cannot deserialize module: UnknownOpcode(192)")))

Thanks!

timbrinded commented 1 year ago

UnknownOpCode(192) is usually due to wrong rust compiler version and is a long standing substrate quirk.

Where are you seeing that error? I would have assumed you'd just downloading the moonbeam binary from Moonbeam GH Releases

pepoviola commented 1 year ago

I compiled from tag v0.31.1 in linux using rust 1.72.0. I will check also using k8s. Thx!


update: works ok on k8s with the official image. It will be included in the next version (I plan to release today). Thx!