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

parachain chainspec: stakingValidatorCount overwritten by zombienet generated chainspec #1974

Closed
niklasad1 opened this issue Mar 3, 2025 · 1 comment

Comments

@niklasad1
Copy link
Member

niklasad1 commented Mar 3, 2025

Issue Description

Hey hey,

I'm trying to launch a local parachain with a custom chainspec that is configured for asset-hub-next which has the following zombienet configuration:

[relaychain]
default_command = "polkadot"
chain = "rococo-local"

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

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

[[parachains]]
id = 1100
chain_spec_path = "./chain_spec.json"

[parachains.collator]
name = "charlie"
rpc_port = 9966
args = [ "-lruntime::system=debug,runtime::multiblock-election=debug,runtime::staking=debug"]

The chainspec itself has the following settings of interest:

        "staking": {
          "canceledPayout": 0,
          "devStakers": [
            1000,
            25000
          ],
          "forceEra": "NotForcing",
          "invulnerables": [],
          "maxNominatorCount": null,
          "maxValidatorCount": null,
          "minNominatorBond": 0,
          "minValidatorBond": 0,
          "minimumValidatorCount": 50,
          "slashRewardFraction": 0,
          "stakers": [],
          "validatorCount": 500
        },

Steps to reproduce the issue

Steps to reproduce the issue

  1. $ git clone [email protected]:paritytech/polkadot-sdk.git && checkout donal-ah-next-westend
  2. $ ./cumulus/parachains/runtimes/assets/asset-hub-next-westend/build-and-run-zn.sh
  3. Use polkadot-js/apps then read storage stakingValidatorCount
  4. Or inspect the generated chainspec /tmp/zombie-xxx/1100-rococo-local-plain.json

Describe the results you received

When I start up the network/parachain validatorCount is set to 0 but I expect it be 500 and the generated chainspec by zombienet called "1100-rococo-local-plain.json" it has the following staking configuration:

        "staking": {
          "canceledPayout": 0,
          "devStakers": [
            1000,
            25000
          ],
          "forceEra": "NotForcing",
          "invulnerables": [],
          "maxNominatorCount": null,
          "maxValidatorCount": null,
          "minNominatorBond": 0,
          "minValidatorBond": 0,
          "minimumValidatorCount": 50,
          "slashRewardFraction": 0,
          "stakers": [],
          "validatorCount": 0
        },

Describe the results you expected

As you can see it's only "validatorCount that is "wrong" I expect it to be 500 and not 0. So, my question is really whether I'm doing something wrong or if this is a bug?

Zombienet version

1.3.120

Provider

Native

Provider version

## For binaries
polkadot 1.17.1-096b33adbd0
polkadot-parachain 1.17.1-096b33adbd0

Upstream Latest Release

No

Additional environment details

No response

Additional information

Adding some extra logs from the zombienet launch if that is helpful

✅ creating chain spec
✅ launching ZN
Provider : native
Namespace : zombie-a965ac61427bc8f812d7509b4f982e88
Temp Dir : /tmp/zombie-a965ac61427bc8f812d7509b4f982e88_-129089-xF5TR5z6xdYa
Pod : temp
Status : Launching
Command : bash -c polkadot build-spec --chain rococo-local --disable-default-bootnode > /tmp/zo mbie-a965ac61427bc8f812d7509b4f982e88_-129089-xF5TR5z6xdYa/cfg/rococo-local-plain.json
Pod : temp
Status : Ready
🧹 Starting with a fresh authority set...
👤 Added Genesis Authority : charlie : 5Ck5SLSHYac6WFt5UZRSsdJjwmpSZq85fd5TRNAdZQVzEAPT
👤 Added CollatorSelection  : charlie : 5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y
Pod : temp-1
Status : Launching
Command : bash -c polkadot-parachain build-spec  --disable-default-bootnode --chain /tmp/zombie -a965ac61427bc8f812d7509b4f982e88_-129089-xF5TR5z6xdYa/1100-rococo-local-plain.json  --raw  > /tmp/zombie-a965ac61427bc8f812d7509b4f982e88_-129089-xF5TR5z6xdYa/1100-rococo-local-raw .json
Pod : temp-1
Status : Ready
Pod : temp-collator
Status : Launching
Command : bash -c polkadot-parachain export-genesis-head -d /tmp/zombie-a965ac61427bc8f812d7509 b4f982e88_-129089-xF5TR5z6xdYa/export-genesis-state/1100 --chain /tmp/zombie-a965ac61427bc 8f812d7509b4f982e88_-129089-xF5TR5z6xdYa/1100-rococo-local.json /tmp/zombie-a965ac61427bc8 f812d7509b4f982e88_-129089-xF5TR5z6xdYa/cfg/genesis-state-1100 && polkadot-parachain expor t-genesis-wasm --chain /tmp/zombie-a965ac61427bc8f812d7509b4f982e88_-129089-xF5TR5z6xdYa/1 100-rococo-local.json /tmp/zombie-a965ac61427bc8f812d7509b4f982e88_-129089-xF5TR5z6xdYa/cf g/genesis-wasm-1100
Pod : temp-collator
Status : Ready
✓ Added Genesis Parachain 1100
🧹 Starting with a fresh authority set...
👤 Added Balance 2000000000000 for alice - 5GNJqTPyNqANBkUVMN1LPPrxXnFouWXoe2wNSmmEoLctxiZY
👤 Added Balance 2000000000000 for bob - 5HpG9w8EBLe5XCrbczpwq5TSXvedjrBGCwqxK1iQ7qUsSWFc
👤 Added Genesis Authority : alice : 5GNJqTPyNqANBkUVMN1LPPrxXnFouWXoe2wNSmmEoLctxiZY
👤 Added Genesis Authority : bob : 5HpG9w8EBLe5XCrbczpwq5TSXvedjrBGCwqxK1iQ7qUsSWFc
Pod : temp-2
Status : Launching
Command : bash -c polkadot build-spec --chain /tmp/zombie-a965ac61427bc8f812d7509b4f982e88_-129 089-xF5TR5z6xdYa/rococo-local-plain.json --disable-default-bootnode  --raw > /tmp/zombie-a 965ac61427bc8f812d7509b4f982e88_-129089-xF5TR5z6xdYa/rococo-local-raw.json
Pod : temp-2
Status : Ready
Chain name: Rococo Local Testnet
Rococo Local Testnet ⚙ Clear Boot Nodes
Pod : alice
Status : Launching
Command : polkadot --chain /tmp/zombie-a965ac61427bc8f812d7509b4f982e88_-129089-xF5TR5z6xdYa/al ice/cfg/rococo-local.json --name alice --rpc-cors all --unsafe-rpc-external --rpc-methods  unsafe --no-mdns --node-key 2bd806c97f0e00af1a1fc3328fa763a9269723c8db8fac4f93af71db186d6e 90 --no-telemetry --prometheus-external --validator --insecure-validator-i-know-what-i-do  --prometheus-port 45789 --rpc-port 9944 --listen-addr /ip4/0.0.0.0/tcp/37469/ws --base-pat h /tmp/zombie-a965ac61427bc8f812d7509b4f982e88_-129089-xF5TR5z6xdYa/alice/data
Pod : alice
Status : Ready
Pod : alice
Status : Running
You can follow the logs of the node by running this command:
tail -f  /tmp/zombie-a965ac61427bc8f812d7509b4f982e88_-129089-xF5TR5z6xdYa/alice.log


Rococo Local Testnet ⚙ Added Boot Nodes
/ip4/127.0.0.1/tcp/37469/ws/p2p/12D3KooWQCkBm1BYtkHpocxCwMgR8yjitEeHGx8spzcDLGt2gkBm
Pod : bob
Status : Launching
Command : polkadot --chain /tmp/zombie-a965ac61427bc8f812d7509b4f982e88_-129089-xF5TR5z6xdYa/bo b/cfg/rococo-local.json --name bob --rpc-cors all --unsafe-rpc-external --rpc-methods unsa fe --no-mdns --node-key 81b637d8fcd2c6da6359e6963113a1170de795e4b725b84d1e0b4cfd9ec58ce9 - -no-telemetry --prometheus-external --validator --insecure-validator-i-know-what-i-do --bo otnodes /ip4/127.0.0.1/tcp/37469/ws/p2p/12D3KooWQCkBm1BYtkHpocxCwMgR8yjitEeHGx8spzcDLGt2gk Bm --prometheus-port 42837 --rpc-port 9955 --listen-addr /ip4/0.0.0.0/tcp/43281/ws --base- path /tmp/zombie-a965ac61427bc8f812d7509b4f982e88_-129089-xF5TR5z6xdYa/bob/data
Pod : bob
Status : Ready
Pod : bob
Status : Running
You can follow the logs of the node by running this command:
tail -f  /tmp/zombie-a965ac61427bc8f812d7509b4f982e88_-129089-xF5TR5z6xdYa/bob.log


All relay chain nodes spawned...
Pod : charlie
Status : Launching
Command : polkadot-parachain --name charlie --node-key b9dd960c1753459a78115d3cb845a57d924b6877 e805b08bd01086ccdf34433c --chain /tmp/zombie-a965ac61427bc8f812d7509b4f982e88_-129089-xF5T R5z6xdYa/charlie/cfg/rococo-local-1100.json --base-path /tmp/zombie-a965ac61427bc8f812d750 9b4f982e88_-129089-xF5TR5z6xdYa/charlie/data --listen-addr /ip4/0.0.0.0/tcp/34879/ws --pro metheus-external --rpc-cors all --unsafe-rpc-external --rpc-methods unsafe --prometheus-po rt 46561 --rpc-port 9966 --collator -lruntime::system=debug,runtime::multiblock-election=d ebug,runtime::staking=debug -- --base-path /tmp/zombie-a965ac61427bc8f812d7509b4f982e88_-1 29089-xF5TR5z6xdYa/charlie/relay-data --chain /tmp/zombie-a965ac61427bc8f812d7509b4f982e88 _-129089-xF5TR5z6xdYa/charlie/cfg/rococo-local.json --execution wasm --port 35277 --rpc-po rt 37961 --prometheus-port 35451
Pod : charlie
Status : Ready
Pod : charlie
Status : Running
You can follow the logs of the node by running this command:
tail -f  /tmp/zombie-a965ac61427bc8f812d7509b4f982e88_-129089-xF5TR5z6xdYa/charlie.log


Custom ⚙ Added Boot Nodes
/ip4/127.0.0.1/tcp/34879/ws/p2p/12D3KooWPKzmmE2uYgF3z13xjpbFTp63g9dZFag8pG6MgnpSLF4S
(node:129089) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `zombienet --trace-warnings ...` to show where the warning was created)
Namespace : zombie-a965ac61427bc8f812d7509b4f982e88
Provider : native
Node Information
Name : alice
Direct Link : https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9944#/explorer
Prometheus Link : http://127.0.0.1:45789/metrics
Log Cmd : tail -f  /tmp/zombie-a965ac61427bc8f812d7509b4f982e88_-129089-xF5TR5z6xdYa/alice.log
Node Information
Name : bob
Direct Link : https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9955#/explorer
Prometheus Link : http://127.0.0.1:42837/metrics
Log Cmd : tail -f  /tmp/zombie-a965ac61427bc8f812d7509b4f982e88_-129089-xF5TR5z6xdYa/bob.log
Node Information
Name : charlie
Direct Link : https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9966#/explorer
Prometheus Link : http://127.0.0.1:46561/metrics
Log Cmd : tail -f  /tmp/zombie-a965ac61427bc8f812d7509b4f982e88_-129089-xF5TR5z6xdYa/charlie.log
Parachain ID : 1100
ChainSpec Path : /tmp/zombie-a965ac61427bc8f812d7509b4f982e88_-129089-xF5TR5z6xdYa/1100-rococo-local.json

Screenshots

No response

@pepoviola
Copy link
Collaborator

Fixed in #1977 . Will be part of next version (I plan to release today).
Thx!

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

No branches or pull requests

2 participants