From 39e141082733f4ad4afd069bee089670c35f278f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=B3nal=20Murray?= Date: Thu, 22 Aug 2024 12:22:03 +0200 Subject: [PATCH 1/5] Propagate on-chain-release-build to chain-spec-generator --- chain-spec-generator/Cargo.toml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/chain-spec-generator/Cargo.toml b/chain-spec-generator/Cargo.toml index 66640c7e1b..157c51981a 100644 --- a/chain-spec-generator/Cargo.toml +++ b/chain-spec-generator/Cargo.toml @@ -46,3 +46,19 @@ runtime-benchmarks = [ "people-polkadot-runtime/runtime-benchmarks", "polkadot-runtime/runtime-benchmarks", ] + +on-chain-release-build = [ + "asset-hub-kusama-runtime/on-chain-release-build", + "asset-hub-polkadot-runtime/on-chain-release-build", + "bridge-hub-kusama-runtime/on-chain-release-build", + "bridge-hub-polkadot-runtime/on-chain-release-build", + "collectives-polkadot-runtime/on-chain-release-build", + "coretime-kusama-runtime/on-chain-release-build", + "coretime-polkadot-runtime/on-chain-release-build", + "encointer-kusama-runtime/on-chain-release-build", + "glutton-kusama-runtime/on-chain-release-build", + "kusama-runtime/on-chain-release-build", + "people-kusama-runtime/on-chain-release-build", + "people-polkadot-runtime/on-chain-release-build", + "polkadot-runtime/on-chain-release-build", +] From f8ece0bb82bc77f13e8c70cffaedf3212a7b250c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=B3nal=20Murray?= Date: Tue, 13 Aug 2024 11:10:56 +0100 Subject: [PATCH 2/5] Use preset from wasm --- .../src/system_parachains_specs.rs | 36 ++++++------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/chain-spec-generator/src/system_parachains_specs.rs b/chain-spec-generator/src/system_parachains_specs.rs index db726d7f0d..dd37d8d7b2 100644 --- a/chain-spec-generator/src/system_parachains_specs.rs +++ b/chain-spec-generator/src/system_parachains_specs.rs @@ -66,7 +66,7 @@ pub fn asset_hub_polkadot_local_testnet_config() -> Result, S .with_name("Polkadot Asset Hub Local") .with_id("asset-hub-polkadot-local") .with_chain_type(ChainType::Local) - .with_genesis_config_patch(asset_hub_polkadot_runtime::genesis_config_presets::asset_hub_polkadot_local_testnet_genesis(1000.into())) + .with_genesis_config_preset_name("local_testnet") .with_properties(properties) .build(), )) @@ -86,7 +86,7 @@ pub fn asset_hub_kusama_local_testnet_config() -> Result, Str .with_name("Kusama Asset Hub Local") .with_id("asset-hub-kusama-local") .with_chain_type(ChainType::Local) - .with_genesis_config_patch(asset_hub_kusama_runtime::genesis_config_presets::asset_hub_kusama_local_testnet_genesis(1000.into())) + .with_genesis_config_preset_name("local_testnet") .with_properties(properties) .build(), )) @@ -107,7 +107,7 @@ pub fn collectives_polkadot_local_testnet_config() -> Result, .with_name("Polkadot Collectives Local") .with_id("collectives-polkadot-local") .with_chain_type(ChainType::Local) - .with_genesis_config_patch(collectives_polkadot_runtime::genesis_config_presets::collectives_polkadot_local_testnet_genesis(1001.into())) + .with_genesis_config_preset_name("local_testnet") .with_properties(properties) .build(), )) @@ -128,7 +128,7 @@ pub fn bridge_hub_polkadot_local_testnet_config() -> Result, .with_name("Polkadot Bridge Hub Local") .with_id("bridge-hub-polkadot-local") .with_chain_type(ChainType::Local) - .with_genesis_config_patch(bridge_hub_polkadot_runtime::genesis_config_presets::bridge_hub_polkadot_local_testnet_genesis(1002.into())) + .with_genesis_config_preset_name("local_testnet") .with_properties(properties) .build(), )) @@ -148,7 +148,7 @@ pub fn bridge_hub_kusama_local_testnet_config() -> Result, St .with_name("Kusama Bridge Hub Local") .with_id("bridge-hub-kusama-local") .with_chain_type(ChainType::Local) - .with_genesis_config_patch(bridge_hub_kusama_runtime::genesis_config_presets::bridge_hub_kusama_local_testnet_genesis(1002.into())) + .with_genesis_config_preset_name("local_testnet") .with_properties(properties) .build(), )) @@ -166,11 +166,7 @@ pub fn glutton_kusama_local_testnet_config() -> Result, Strin .with_name("Kusama Glutton Local") .with_id("glutton-kusama-local") .with_chain_type(ChainType::Local) - .with_genesis_config_patch( - glutton_kusama_runtime::genesis_config_presets::glutton_kusama_local_testnet_genesis( - 1300.into(), - ), - ) + .with_genesis_config_preset_name("local_testnet") .with_properties(properties) .build(), )) @@ -190,7 +186,7 @@ pub fn encointer_kusama_local_testnet_config() -> Result, Str .with_name("Kusama Encointer Local") .with_id("encointer-kusama-local") .with_chain_type(ChainType::Local) - .with_genesis_config_patch(encointer_kusama_runtime::genesis_config_presets::encointer_kusama_local_testnet_genesis(1001.into())) + .with_genesis_config_preset_name("local_testnet") .with_properties(properties) .build(), )) @@ -210,11 +206,7 @@ pub fn coretime_kusama_local_testnet_config() -> Result, Stri .with_name("Kusama Coretime Local") .with_id("coretime-kusama-local") .with_chain_type(ChainType::Local) - .with_genesis_config_patch( - coretime_kusama_runtime::genesis_config_presets::coretime_kusama_local_testnet_genesis( - 1005.into(), - ), - ) + .with_genesis_config_preset_name("local_testnet") .with_properties(properties) .build(), )) @@ -327,11 +319,7 @@ pub fn people_kusama_local_testnet_config() -> Result, String .with_name("Kusama People Local") .with_id("people-kusama-local") .with_chain_type(ChainType::Local) - .with_genesis_config_patch( - people_kusama_runtime::genesis_config_presets::people_kusama_local_testnet_genesis( - 1004.into(), - ), - ) + .with_genesis_config_preset_name("local_testnet") .with_properties(properties) .build(), )) @@ -351,11 +339,7 @@ pub fn people_polkadot_local_testnet_config() -> Result, Stri .with_name("Polkadot People Local") .with_id("people-polkadot-local") .with_chain_type(ChainType::Local) - .with_genesis_config_patch( - people_polkadot_runtime::genesis_config_presets::people_polkadot_local_testnet_genesis( - 1004.into(), - ), - ) + .with_genesis_config_preset_name("local_testnet") .with_properties(properties) .build(), )) From ff2a00e49fcbfea25e6b8d0dc4412db674ecbb6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=B3nal=20Murray?= Date: Thu, 22 Aug 2024 12:35:17 +0200 Subject: [PATCH 3/5] Move preset_names to genesis_config_presets for all runtimes --- relay/kusama/src/genesis_config_presets.rs | 6 ++++++ relay/kusama/src/lib.rs | 5 +---- relay/polkadot/src/genesis_config_presets.rs | 6 ++++++ relay/polkadot/src/lib.rs | 5 +---- .../asset-hub-kusama/src/genesis_config_presets.rs | 6 ++++++ system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs | 5 +---- .../asset-hub-polkadot/src/genesis_config_presets.rs | 6 ++++++ system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs | 5 +---- .../bridge-hub-kusama/src/genesis_config_presets.rs | 6 ++++++ system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs | 5 +---- .../bridge-hub-polkadot/src/genesis_config_presets.rs | 6 ++++++ .../bridge-hubs/bridge-hub-polkadot/src/lib.rs | 5 +---- .../collectives-polkadot/src/genesis_config_presets.rs | 6 ++++++ .../collectives/collectives-polkadot/src/lib.rs | 5 +---- .../coretime/coretime-kusama/src/genesis_config_presets.rs | 6 ++++++ system-parachains/coretime/coretime-kusama/src/lib.rs | 5 +---- .../coretime-polkadot/src/genesis_config_presets.rs | 2 +- system-parachains/encointer/src/genesis_config_presets.rs | 6 ++++++ system-parachains/encointer/src/lib.rs | 5 +---- .../gluttons/glutton-kusama/src/genesis_config_presets.rs | 6 ++++++ system-parachains/gluttons/glutton-kusama/src/lib.rs | 5 +---- .../people/people-kusama/src/genesis_config_presets.rs | 6 ++++++ system-parachains/people/people-kusama/src/lib.rs | 5 +---- .../people/people-polkadot/src/genesis_config_presets.rs | 6 ++++++ system-parachains/people/people-polkadot/src/lib.rs | 5 +---- 25 files changed, 85 insertions(+), 49 deletions(-) diff --git a/relay/kusama/src/genesis_config_presets.rs b/relay/kusama/src/genesis_config_presets.rs index dda349608b..804c296fa3 100644 --- a/relay/kusama/src/genesis_config_presets.rs +++ b/relay/kusama/src/genesis_config_presets.rs @@ -23,6 +23,7 @@ use pallet_staking::{Forcing, StakerStatus}; use polkadot_primitives::{AccountPublic, AssignmentId, AsyncBackingParams}; use runtime_parachains::configuration::HostConfiguration; use sp_core::{sr25519, Pair, Public}; +use sp_genesis_builder::PresetId; use sp_runtime::{traits::IdentifyAccount, Perbill}; #[cfg(not(feature = "std"))] use sp_std::alloc::format; @@ -224,6 +225,11 @@ pub fn kusama_development_config_genesis() -> serde_json::Value { ) } +/// Provides the names of the predefined genesis configs for this runtime. +pub fn preset_names() -> Vec { + vec![PresetId::from("development"), PresetId::from("local_testnet")] +} + /// Provides the JSON representation of predefined genesis config for given `id`. pub fn get_preset(id: &sp_genesis_builder::PresetId) -> Option> { let patch = match id.try_into() { diff --git a/relay/kusama/src/lib.rs b/relay/kusama/src/lib.rs index f36bbe75cc..469a48a7c1 100644 --- a/relay/kusama/src/lib.rs +++ b/relay/kusama/src/lib.rs @@ -2511,10 +2511,7 @@ sp_api::impl_runtime_apis! { } fn preset_names() -> Vec { - vec![ - sp_genesis_builder::PresetId::from("local_testnet"), - sp_genesis_builder::PresetId::from("development"), - ] + genesis_config_presets::preset_names() } } diff --git a/relay/polkadot/src/genesis_config_presets.rs b/relay/polkadot/src/genesis_config_presets.rs index 38abd8e48f..8d8afb6ad0 100644 --- a/relay/polkadot/src/genesis_config_presets.rs +++ b/relay/polkadot/src/genesis_config_presets.rs @@ -23,6 +23,7 @@ use polkadot_primitives::{AccountPublic, AssignmentId, AsyncBackingParams}; use polkadot_runtime_constants::currency::UNITS as DOT; use runtime_parachains::configuration::HostConfiguration; use sp_core::{sr25519, Pair, Public}; +use sp_genesis_builder::PresetId; use sp_runtime::{traits::IdentifyAccount, Perbill}; #[cfg(not(feature = "std"))] use sp_std::alloc::format; @@ -224,6 +225,11 @@ pub fn polkadot_development_config_genesis() -> serde_json::Value { ) } +/// Provides the names of the predefined genesis configs for this runtime. +pub fn preset_names() -> Vec { + vec![PresetId::from("development"), PresetId::from("local_testnet")] +} + /// Provides the JSON representation of predefined genesis config for given `id`. pub fn get_preset(id: &sp_genesis_builder::PresetId) -> Option> { let patch = match id.try_into() { diff --git a/relay/polkadot/src/lib.rs b/relay/polkadot/src/lib.rs index bb7ec1344f..3d2ab3c628 100644 --- a/relay/polkadot/src/lib.rs +++ b/relay/polkadot/src/lib.rs @@ -2679,10 +2679,7 @@ sp_api::impl_runtime_apis! { } fn preset_names() -> Vec { - vec![ - sp_genesis_builder::PresetId::from("local_testnet"), - sp_genesis_builder::PresetId::from("development"), - ] + genesis_config_presets::preset_names() } } diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/genesis_config_presets.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/genesis_config_presets.rs index 09aef4c37d..f092687fe6 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/genesis_config_presets.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/genesis_config_presets.rs @@ -17,6 +17,7 @@ //! Genesis configs presets for the AssetHubKusama runtime use crate::*; +use sp_genesis_builder::PresetId; use sp_std::vec::Vec; use system_parachains_constants::genesis_presets::*; @@ -72,6 +73,11 @@ fn asset_hub_kusama_development_genesis(para_id: ParaId) -> serde_json::Value { asset_hub_kusama_local_testnet_genesis(para_id) } +/// Provides the names of the predefined genesis configs for this runtime. +pub fn preset_names() -> Vec { + vec![PresetId::from("development"), PresetId::from("local_testnet")] +} + /// Provides the JSON representation of predefined genesis config for given `id`. pub fn get_preset(id: &sp_genesis_builder::PresetId) -> Option> { let patch = match id.try_into() { diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs index 0e3db3440f..4515b3d2a0 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs @@ -1372,10 +1372,7 @@ impl_runtime_apis! { } fn preset_names() -> Vec { - vec![ - sp_genesis_builder::PresetId::from("local_testnet"), - sp_genesis_builder::PresetId::from("development"), - ] + genesis_config_presets::preset_names() } } diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/genesis_config_presets.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/genesis_config_presets.rs index 2f87b6b3b8..4d60c808d8 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/genesis_config_presets.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/genesis_config_presets.rs @@ -19,6 +19,7 @@ use crate::*; use parachains_common::AssetHubPolkadotAuraId; use sp_core::sr25519; +use sp_genesis_builder::PresetId; use sp_std::vec::Vec; use system_parachains_constants::genesis_presets::*; @@ -88,6 +89,11 @@ fn asset_hub_polkadot_development_genesis(para_id: ParaId) -> serde_json::Value asset_hub_polkadot_local_testnet_genesis(para_id) } +/// Provides the names of the predefined genesis configs for this runtime. +pub fn preset_names() -> Vec { + vec![PresetId::from("development"), PresetId::from("local_testnet")] +} + /// Provides the JSON representation of predefined genesis config for given `id`. pub fn get_preset(id: &sp_genesis_builder::PresetId) -> Option> { let patch = match id.try_into() { diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs index 67522fcd60..18e634b06f 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs @@ -1340,10 +1340,7 @@ impl_runtime_apis! { } fn preset_names() -> Vec { - vec![ - sp_genesis_builder::PresetId::from("local_testnet"), - sp_genesis_builder::PresetId::from("development"), - ] + genesis_config_presets::preset_names() } } diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/genesis_config_presets.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/genesis_config_presets.rs index 24f1a87143..d9850b62a7 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/genesis_config_presets.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/genesis_config_presets.rs @@ -17,6 +17,7 @@ //! Genesis configs presets for the BridgeHubKusama runtime use crate::*; +use sp_genesis_builder::PresetId; use sp_std::vec::Vec; use system_parachains_constants::genesis_presets::*; @@ -72,6 +73,11 @@ fn bridge_hub_kusama_development_genesis(para_id: ParaId) -> serde_json::Value { bridge_hub_kusama_local_testnet_genesis(para_id) } +/// Provides the names of the predefined genesis configs for this runtime. +pub fn preset_names() -> Vec { + vec![PresetId::from("development"), PresetId::from("local_testnet")] +} + /// Provides the JSON representation of predefined genesis config for given `id`. pub fn get_preset(id: &sp_genesis_builder::PresetId) -> Option> { let patch = match id.try_into() { diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs index 405eaa4891..5b06329ed9 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -812,10 +812,7 @@ impl_runtime_apis! { } fn preset_names() -> Vec { - vec![ - sp_genesis_builder::PresetId::from("local_testnet"), - sp_genesis_builder::PresetId::from("development"), - ] + genesis_config_presets::preset_names() } } diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/genesis_config_presets.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/genesis_config_presets.rs index 0d549d3c2e..e4ee542bea 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/genesis_config_presets.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/genesis_config_presets.rs @@ -17,6 +17,7 @@ //! Genesis configs presets for the BridgeHubPolkadot runtime use crate::*; +use sp_genesis_builder::PresetId; use sp_std::vec::Vec; use system_parachains_constants::genesis_presets::*; @@ -77,6 +78,11 @@ fn bridge_hub_polkadot_development_genesis(para_id: ParaId) -> serde_json::Value bridge_hub_polkadot_local_testnet_genesis(para_id) } +/// Provides the names of the predefined genesis configs for this runtime. +pub fn preset_names() -> Vec { + vec![PresetId::from("development"), PresetId::from("local_testnet")] +} + /// Provides the JSON representation of predefined genesis config for given `id`. pub fn get_preset(id: &sp_genesis_builder::PresetId) -> Option> { let patch = match id.try_into() { diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs index 8c2aa532f3..10cf516cc3 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs @@ -814,10 +814,7 @@ impl_runtime_apis! { } fn preset_names() -> Vec { - vec![ - sp_genesis_builder::PresetId::from("local_testnet"), - sp_genesis_builder::PresetId::from("development"), - ] + genesis_config_presets::preset_names() } } diff --git a/system-parachains/collectives/collectives-polkadot/src/genesis_config_presets.rs b/system-parachains/collectives/collectives-polkadot/src/genesis_config_presets.rs index 8ad0b4dcdf..0fcbb37305 100644 --- a/system-parachains/collectives/collectives-polkadot/src/genesis_config_presets.rs +++ b/system-parachains/collectives/collectives-polkadot/src/genesis_config_presets.rs @@ -17,6 +17,7 @@ //! Genesis configs presets for the CollectivesPolkadot runtime use crate::*; +use sp_genesis_builder::PresetId; use sp_std::vec::Vec; use system_parachains_constants::genesis_presets::*; @@ -72,6 +73,11 @@ fn collectives_polkadot_development_genesis(para_id: ParaId) -> serde_json::Valu collectives_polkadot_local_testnet_genesis(para_id) } +/// Provides the names of the predefined genesis configs for this runtime. +pub fn preset_names() -> Vec { + vec![PresetId::from("development"), PresetId::from("local_testnet")] +} + /// Provides the JSON representation of predefined genesis config for given `id`. pub fn get_preset(id: &sp_genesis_builder::PresetId) -> Option> { let patch = match id.try_into() { diff --git a/system-parachains/collectives/collectives-polkadot/src/lib.rs b/system-parachains/collectives/collectives-polkadot/src/lib.rs index 8dcd46e3ea..d3ee3616db 100644 --- a/system-parachains/collectives/collectives-polkadot/src/lib.rs +++ b/system-parachains/collectives/collectives-polkadot/src/lib.rs @@ -1021,10 +1021,7 @@ impl_runtime_apis! { } fn preset_names() -> Vec { - vec![ - sp_genesis_builder::PresetId::from("local_testnet"), - sp_genesis_builder::PresetId::from("development"), - ] + genesis_config_presets::preset_names() } } diff --git a/system-parachains/coretime/coretime-kusama/src/genesis_config_presets.rs b/system-parachains/coretime/coretime-kusama/src/genesis_config_presets.rs index 545d0a87e4..dbefac5c74 100644 --- a/system-parachains/coretime/coretime-kusama/src/genesis_config_presets.rs +++ b/system-parachains/coretime/coretime-kusama/src/genesis_config_presets.rs @@ -19,6 +19,7 @@ use crate::*; use hex_literal::hex; use sp_core::crypto::UncheckedInto; +use sp_genesis_builder::PresetId; use sp_std::vec::Vec; use system_parachains_constants::genesis_presets::*; @@ -131,6 +132,11 @@ fn coretime_kusama_live_genesis(para_id: ParaId) -> serde_json::Value { ) } +/// Provides the names of the predefined genesis configs for this runtime. +pub fn preset_names() -> Vec { + vec![PresetId::from("development"), PresetId::from("local_testnet")] +} + /// Provides the JSON representation of predefined genesis config for given `id`. pub fn get_preset(id: &sp_genesis_builder::PresetId) -> Option> { let patch = match id.try_into() { diff --git a/system-parachains/coretime/coretime-kusama/src/lib.rs b/system-parachains/coretime/coretime-kusama/src/lib.rs index 4efe55b25f..ed70d64f79 100644 --- a/system-parachains/coretime/coretime-kusama/src/lib.rs +++ b/system-parachains/coretime/coretime-kusama/src/lib.rs @@ -1107,10 +1107,7 @@ impl_runtime_apis! { } fn preset_names() -> Vec { - vec![ - sp_genesis_builder::PresetId::from("local_testnet"), - sp_genesis_builder::PresetId::from("development"), - ] + genesis_config_presets::preset_names() } } } diff --git a/system-parachains/coretime/coretime-polkadot/src/genesis_config_presets.rs b/system-parachains/coretime/coretime-polkadot/src/genesis_config_presets.rs index 509a23d52e..38f3aceed7 100644 --- a/system-parachains/coretime/coretime-polkadot/src/genesis_config_presets.rs +++ b/system-parachains/coretime/coretime-polkadot/src/genesis_config_presets.rs @@ -133,7 +133,7 @@ fn coretime_polkadot_live_genesis(para_id: ParaId) -> serde_json::Value { ) } -pub(super) fn preset_names() -> Vec { +pub fn preset_names() -> Vec { vec![PresetId::from("live"), PresetId::from("development"), PresetId::from("local_testnet")] } diff --git a/system-parachains/encointer/src/genesis_config_presets.rs b/system-parachains/encointer/src/genesis_config_presets.rs index 906c77e505..8f25c9ae86 100644 --- a/system-parachains/encointer/src/genesis_config_presets.rs +++ b/system-parachains/encointer/src/genesis_config_presets.rs @@ -17,6 +17,7 @@ //! Genesis configs presets for the EncointerKusama runtime use crate::*; +use sp_genesis_builder::PresetId; use sp_std::vec::Vec; use system_parachains_constants::genesis_presets::*; @@ -72,6 +73,11 @@ fn encointer_kusama_development_genesis(para_id: ParaId) -> serde_json::Value { encointer_kusama_local_testnet_genesis(para_id) } +/// Provides the names of the predefined genesis configs for this runtime. +pub fn preset_names() -> Vec { + vec![PresetId::from("development"), PresetId::from("local_testnet")] +} + /// Provides the JSON representation of predefined genesis config for given `id`. pub fn get_preset(id: &sp_genesis_builder::PresetId) -> Option> { let patch = match id.try_into() { diff --git a/system-parachains/encointer/src/lib.rs b/system-parachains/encointer/src/lib.rs index c071af71b2..d3ced65e49 100644 --- a/system-parachains/encointer/src/lib.rs +++ b/system-parachains/encointer/src/lib.rs @@ -1037,10 +1037,7 @@ impl_runtime_apis! { } fn preset_names() -> Vec { - vec![ - sp_genesis_builder::PresetId::from("local_testnet"), - sp_genesis_builder::PresetId::from("development"), - ] + genesis_config_presets::preset_names() } } diff --git a/system-parachains/gluttons/glutton-kusama/src/genesis_config_presets.rs b/system-parachains/gluttons/glutton-kusama/src/genesis_config_presets.rs index aa6b3f67ba..c951b4e538 100644 --- a/system-parachains/gluttons/glutton-kusama/src/genesis_config_presets.rs +++ b/system-parachains/gluttons/glutton-kusama/src/genesis_config_presets.rs @@ -18,6 +18,7 @@ use crate::*; use cumulus_primitives_core::ParaId; +use sp_genesis_builder::PresetId; fn glutton_kusama_genesis(id: ParaId) -> serde_json::Value { serde_json::json!({ @@ -36,6 +37,11 @@ fn glutton_kusama_development_genesis(para_id: ParaId) -> serde_json::Value { glutton_kusama_local_testnet_genesis(para_id) } +/// Provides the names of the predefined genesis configs for this runtime. +pub fn preset_names() -> Vec { + vec![PresetId::from("development"), PresetId::from("local_testnet")] +} + /// Provides the JSON representation of predefined genesis config for given `id`. pub fn get_preset(id: &sp_genesis_builder::PresetId) -> Option> { let patch = match id.try_into() { diff --git a/system-parachains/gluttons/glutton-kusama/src/lib.rs b/system-parachains/gluttons/glutton-kusama/src/lib.rs index 6392e0a9d8..140763101c 100644 --- a/system-parachains/gluttons/glutton-kusama/src/lib.rs +++ b/system-parachains/gluttons/glutton-kusama/src/lib.rs @@ -399,10 +399,7 @@ impl_runtime_apis! { } fn preset_names() -> Vec { - vec![ - sp_genesis_builder::PresetId::from("local_testnet"), - sp_genesis_builder::PresetId::from("development"), - ] + genesis_config_presets::preset_names() } } diff --git a/system-parachains/people/people-kusama/src/genesis_config_presets.rs b/system-parachains/people/people-kusama/src/genesis_config_presets.rs index 74aa13cf80..1254ed4469 100644 --- a/system-parachains/people/people-kusama/src/genesis_config_presets.rs +++ b/system-parachains/people/people-kusama/src/genesis_config_presets.rs @@ -17,6 +17,7 @@ //! Genesis configs presets for the PeopleKusama runtime use crate::*; +use sp_genesis_builder::PresetId; use sp_std::vec::Vec; use system_parachains_constants::genesis_presets::*; @@ -72,6 +73,11 @@ fn people_kusama_development_genesis(para_id: ParaId) -> serde_json::Value { people_kusama_local_testnet_genesis(para_id) } +/// Provides the names of the predefined genesis configs for this runtime. +pub fn preset_names() -> Vec { + vec![PresetId::from("development"), PresetId::from("local_testnet")] +} + /// Provides the JSON representation of predefined genesis config for given `id`. pub fn get_preset(id: &sp_genesis_builder::PresetId) -> Option> { let patch = match id.try_into() { diff --git a/system-parachains/people/people-kusama/src/lib.rs b/system-parachains/people/people-kusama/src/lib.rs index 651473abcb..5c5b8f1503 100644 --- a/system-parachains/people/people-kusama/src/lib.rs +++ b/system-parachains/people/people-kusama/src/lib.rs @@ -1077,10 +1077,7 @@ impl_runtime_apis! { } fn preset_names() -> Vec { - vec![ - sp_genesis_builder::PresetId::from("local_testnet"), - sp_genesis_builder::PresetId::from("development"), - ] + genesis_config_presets::preset_names() } } } diff --git a/system-parachains/people/people-polkadot/src/genesis_config_presets.rs b/system-parachains/people/people-polkadot/src/genesis_config_presets.rs index 6847d7ca73..f48e219922 100644 --- a/system-parachains/people/people-polkadot/src/genesis_config_presets.rs +++ b/system-parachains/people/people-polkadot/src/genesis_config_presets.rs @@ -17,6 +17,7 @@ //! Genesis configs presets for the PeoplePolkadot runtime use crate::*; +use sp_genesis_builder::PresetId; use sp_std::vec::Vec; use system_parachains_constants::genesis_presets::*; @@ -72,6 +73,11 @@ fn people_polkadot_development_genesis(para_id: ParaId) -> serde_json::Value { people_polkadot_local_testnet_genesis(para_id) } +/// Provides the names of the predefined genesis configs for this runtime. +pub fn preset_names() -> Vec { + vec![PresetId::from("development"), PresetId::from("local_testnet")] +} + /// Provides the JSON representation of predefined genesis config for given `id`. pub fn get_preset(id: &sp_genesis_builder::PresetId) -> Option> { let patch = match id.try_into() { diff --git a/system-parachains/people/people-polkadot/src/lib.rs b/system-parachains/people/people-polkadot/src/lib.rs index 3333957713..4f723ac4ac 100644 --- a/system-parachains/people/people-polkadot/src/lib.rs +++ b/system-parachains/people/people-polkadot/src/lib.rs @@ -1042,10 +1042,7 @@ impl_runtime_apis! { } fn preset_names() -> Vec { - vec![ - sp_genesis_builder::PresetId::from("local_testnet"), - sp_genesis_builder::PresetId::from("development"), - ] + genesis_config_presets::preset_names() } } } From ba7f0b952e344ea6dc77d7a941d4022d561c5470 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=B3nal=20Murray?= Date: Fri, 30 Aug 2024 15:15:12 +0100 Subject: [PATCH 4/5] Update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9e9397901..69e26a1be3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ Changelog for the runtimes governed by the Polkadot Fellowship. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## Unreleased + +### Fixed +- Chain-spec generator: propagate the `on_chain_release_build` feature to the chain-spec generator. Without this the live/genesis chain-specs contain a wrongly-configured WASM blob ([polkadot-fellows/runtimes#450](https://github.com/polkadot-fellows/runtimes/pull/450)). + ## [1.3.2] 27.08.2024 ### Fixed From d9ef0a9a3c0268aeb27c686e2c93f969a72481c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=B3nal=20Murray?= Date: Fri, 30 Aug 2024 15:23:55 +0100 Subject: [PATCH 5/5] Brace yourself --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69e26a1be3..13846ff859 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ Changelog for the runtimes governed by the Polkadot Fellowship. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## Unreleased +## [Unreleased] ### Fixed - Chain-spec generator: propagate the `on_chain_release_build` feature to the chain-spec generator. Without this the live/genesis chain-specs contain a wrongly-configured WASM blob ([polkadot-fellows/runtimes#450](https://github.com/polkadot-fellows/runtimes/pull/450)).