asset-hub-rococo: genesis config presets added#3996
asset-hub-rococo: genesis config presets added#3996michalkucharczyk merged 14 commits intomasterfrom
Conversation
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/genesis_config_presets.rs
Outdated
Show resolved
Hide resolved
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/genesis_config_presets.rs
Outdated
Show resolved
Hide resolved
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/genesis_config_presets.rs
Show resolved
Hide resolved
|
Do you think we can merge it? |
|
cool, I would need this for other testnet runtimes also: #4405 |
seadanda
left a comment
There was a problem hiding this comment.
Just one query about naming, but looks like a nice change.
| pub mod preset_names { | ||
| pub const PRESET_DEVELOPMENT: &str = "development"; | ||
| pub const PRESET_LOCAL: &str = "local"; | ||
| pub const PRESET_GENESIS: &str = "genesis"; |
There was a problem hiding this comment.
This has previously been called "Live", any reason for the change to genesis?
There was a problem hiding this comment.
@seadanda Thanks for spotting this. I took the name from here (and I know it is far from being perfect) :
polkadot-sdk/cumulus/polkadot-parachain/src/command.rs
Lines 171 to 172 in 6daa939
But I am open to any other name. Should I call it "live"?
I am not sure what is purpose of this particular config.
ps. I did not notice Live name anywhere.
There was a problem hiding this comment.
| pub const PRESET_GENESIS: &str = "genesis"; | |
| pub const PRESET_GENESIS: &str = "live"; |
?
There was a problem hiding this comment.
Not sure we need this at all? live and genesis are really not that expressive names...
There was a problem hiding this comment.
I mean I assume it is for generating the gensis of the live networks, but yeah we probably don't need it.
There was a problem hiding this comment.
Live is what I had seen along with Local and Development for the ChainTypes
I also am not too sure what that specific config is for. Is that the only place this preset will be used? Maybe my reasoning for live is actually wrong then here
There was a problem hiding this comment.
Actually preset names here are simply reflecting the names of predefined chain-specs exported by polkadot-parachain binary which are:
"asset-hub-rococo-dev"
"asset-hub-rococo-local"
"asset-hub-rococo-genesis"
This one: "asset-hub-rococo-genesis", actually is a ChainType::Live, so I can rename it. But it is also not very informative name. Not sure what is the purpose of each chain-spec flavor.
There was a problem hiding this comment.
For now I propose to keep it for compatibility reasons, we can always remove them in future.
I also would prefer the keep "genesis" name to allow easy mapping to corresponding chain-spec name,
At some point we will be removing predefined (e.g. "asset-hub-rococo-dev|local|genesis") chain spec flavors from the omni-node. We could remove unused presets at the same time.
There was a problem hiding this comment.
@kianenigma what are your thoughts on this?
Co-authored-by: Dónal Murray <donal.murray@parity.io>
| pub mod preset_names { | ||
| pub const PRESET_DEVELOPMENT: &str = "development"; | ||
| pub const PRESET_LOCAL: &str = "local"; | ||
| pub const PRESET_GENESIS: &str = "genesis"; |
There was a problem hiding this comment.
Not sure we need this at all? live and genesis are really not that expressive names...
| serde_json::json!({ | ||
| "balances": crate::BalancesConfig { |
There was a problem hiding this comment.
Why are we not using the concrete GenesisConfig type here? And then transform this into a json?
There was a problem hiding this comment.
A preset is meant to be patch. This is the only reason.
If GenesisConfig struct would be used here, then the preset would contain all the fields of the genesis config. That would be less convenient / a little harder to read when displaying presets with some external tools (e.g. chain-spec-builder).
| pub mod preset_names { | ||
| pub const PRESET_DEVELOPMENT: &str = "development"; | ||
| pub const PRESET_LOCAL: &str = "local"; | ||
| pub const PRESET_GENESIS: &str = "genesis"; |
There was a problem hiding this comment.
I mean I assume it is for generating the gensis of the live networks, but yeah we probably don't need it.
|
Left some nitpicks. Generally looking good. Good work 👍 |
Co-authored-by: Bastian Köcher <git@kchr.de>
|
The CI pipeline was cancelled due to failure one of the required jobs. |
|
|
||
| /// Generate the session keys from individual elements. | ||
| /// | ||
| /// The input must be a tuple of individual keys (a single arg for now since we have just one key). |
There was a problem hiding this comment.
Not sure about this comment and naming, why exactly will this change to a tuple?
There was a problem hiding this comment.
Just moved that function from other place w/o thinking too much about it:
https://github.com/paritytech/polkadot-sdk/blob/master/cumulus/polkadot-parachain/src/chain_spec/asset_hubs.rs#L37
Gensis config presets moved from
polkadot-parachainbinary intoasset-hub-rococoruntime.relates to: #3944