paritytech/zombienet

Explicitly specify a data directory when exporting parachain genesis state

JoshOrndorff opened this issue · 4 comments

When zombienet exports the parachain genesis state it uses a command like the following:

parachain-template-node export-genesis-state --chain /tmp/zombie-91732cca35cc89d9bc40d256bff11459_-279173-rjyW4YgPKWMA/2000-rococo-local.json > /tmp/zombie-91732cca35cc89d9bc40d256bff11459_-279173-rjyW4YgPKWMA/cfg/genesis-state-2000

This has worked reliably so far, but only because of a bug in cumulus that I am now fixing. (See paritytech/polkadot-sdk#2326 and paritytech/polkadot-sdk#2331 for context.) Previously, Cumulus made some assumptions about the genesis block, and created a new one on the fly whenever you asked to export the genesis state. With this bug fixed, cumulus will now read the genesis block from the database instead of re-generating it 🚀

But that means that you will now need to make sure you are not implicitly using some pre-existing un-purged data directory.

Hi @JoshOrndorff, thanks for the heads up :)

We can fix in zombienet by ensuring we just pass a unique tmp base path, but I think we can also add --tmp flag (is not available in the `export-genesis-* commands) to make more easy to use to others. Wdyt? I can add the code on top of your pr if you are agree.

Thx!

I also considered using --tmp and found it doesn't exist on the export-genesis-state subcommand.

If you want to add --tmp I'm fine with it, but that would be a change in cumulus obviously.

I'm also fine if you just want to pass -d /tmp/some/collision/resistant/place.

Another option is to just consider that the first collator generate's the genesis state. You already created a dedicated data directory for that collator anyway. I guess that's not a great idea actually because maybe you want to support having zero nodes on a parachain just to test the registration process.

FYI, paritytech/polkadot-sdk#2331 is merged now, so this issue will be important soon.

FYI, paritytech/polkadot-sdk#2331 is merged now, so this issue will be important soon.

Thanks for the heads up @JoshOrndorff! I will fix asap and ping you for testing.
Thx!!