-
Notifications
You must be signed in to change notification settings - Fork 378
Conversation
This was never planned to be a permanent feature. This was mainly added for testing purposes, but now was copied by everybody. The users should be more specific about the para id and set this properly in the chain spec.
This is still a useful feature for testing. e.g. when doing e2e XCM testing, we need multiple instances of a parachain with different parachain id. Maybe rename it to |
I see the reasoning to keep this for testing purposes. The name change might be enough to break functionality and we update the docs to prevent people from using it in production. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and I support the change to prevent more issues with incorrect parachain IDs.
@xlc has a good point but I'm not sure if this is the best way to handle a test case.
If you need this in your parachain, you can just create your own |
What I mean is that you can just wrap this another time: Line 123 in 0b492ba
|
* Update Cumulus, Polkadot, and Substrate dependencies * Fix some breaking changes in the runtime * Update XCM configuration Relevant PR: paritytech/polkadot#4150 * Update commit in README * Bump Cumulus and friends again * Get rid of ParaID parameter See: paritytech/cumulus#739 * Move the ParaID to a `const` * Appease Clippy * Revert changes in `polkadot-launch` config * Update ParaID to that used on Rococo
Generally speaking, it's not a good idea to use The parachain id is burned into the chain-spec, as a part of the genesis storage. For production parachains, the id should definitely be fixed in the chain spec generation code, as well as the raw chain spec file embedded in the node client. For test parachains, it still holds: the parachain id should still be tied to the chain spec once it's generated. Therefore I made this PR to skip the parachain id parameter and read the id from the storage whenever possible: The case @xlc mentioned is mainly for the on-the-fly chain-spec generation for local testnet. A lot of parachains used to have this parameter, passing to the chain spec generation function to write the parachain id to the storage. However this is problematic. In Substrate a lot of code assumes each chain spec should have an unique name, and if you give a different So what to do instead for the on-the-fly chain-spec generation? My suggestion is to allow a dynamic chain name. At Phala, we allow to specify a chain name like "khala-dev-2004". The "-2004" prefix indicating the parachain id for this chain spec instance. In the code, it parses the parachain id from the name, and generate the chain spec based on it. In this way, it's very easy to distinguish the parachain instances with different parachain id. Sample code here: |
This was never planned to be a permanent feature. This was mainly added for testing purposes, but
now was copied by everybody. The users should be more specific about the para id and set this
properly in the chain spec.