-
Notifications
You must be signed in to change notification settings - Fork 732
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
asset-hub-rococo: genesis config presets added #3996
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 |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has previously been called "Live", any reason for the change to genesis?
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.
@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
"asset-hub-rococo-genesis" => | |
Box::new(chain_spec::asset_hubs::asset_hub_rococo_genesis_config()), |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub const PRESET_GENESIS: &str = "genesis"; | |
pub const PRESET_GENESIS: &str = "live"; |
?
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.
Not sure we need this at all? live
and genesis
are really not that expressive names...
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Live
is what I had seen along with Local
and Development
for the ChainType
s
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kianenigma what are your thoughts on this?
Co-authored-by: Dónal Murray <[email protected]>
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we not using the concrete GenesisConfig
type here? And then transform this into a json?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
The CI pipeline was cancelled due to failure one of the required jobs. |
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.
looks good, just one nit,
so I will adjust and continue with others here: #5327
|
||
/// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this comment and naming, why exactly will this change to a tuple?
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.
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-parachain
binary intoasset-hub-rococo
runtime.relates to: #3944