Skip to content
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

GenesisConfig presets for runtime #2714

Merged
merged 93 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from 85 commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
39bb0ce
GenesisBuilder: new function
michalkucharczyk Oct 10, 2023
d7ed0bb
rococo: some initial thing
michalkucharczyk Oct 10, 2023
8eb684d
sc-chain-spec: some ground work
michalkucharczyk Oct 11, 2023
24f33f2
chain-spec: genesis-builder improvements
michalkucharczyk Oct 11, 2023
c54368a
test-runtime: patch in runtime
michalkucharczyk Oct 12, 2023
f58e4eb
sc-chain-spec: testing
michalkucharczyk Dec 14, 2023
05ff32d
test-runtime: dev
michalkucharczyk Dec 14, 2023
6e8214e
sc-chain-spec: EHF + named patch fixes
michalkucharczyk Dec 14, 2023
f339fe9
test-runtime: testing
michalkucharczyk Dec 14, 2023
fde2be7
test-runtime: testing
michalkucharczyk Dec 14, 2023
ed0bd96
sp-genesis-builder: APIv2
michalkucharczyk Dec 14, 2023
51a3d0b
test-runtime: genesis-builder api v2
michalkucharczyk Dec 14, 2023
0bd44d7
build_condfig -> build_state
michalkucharczyk Dec 14, 2023
53272c6
sp-genesis-builder: APIv2 c.d.
michalkucharczyk Dec 14, 2023
f7eb376
genesis-builder-helper: get_preset added
michalkucharczyk Dec 14, 2023
3205235
test-runtime: tests fixed
michalkucharczyk Dec 14, 2023
554dd16
kitchensink: genesis-builder fixes
michalkucharczyk Dec 14, 2023
df03313
sc-chain-spec: support for genesis-builder v2
michalkucharczyk Dec 14, 2023
1fcb298
sc-chain-spec: little steps
michalkucharczyk Dec 14, 2023
2b4626c
chain-spec-builder: presets added
michalkucharczyk Dec 14, 2023
249b813
sp-genesis-builder: some doc added
michalkucharczyk Dec 14, 2023
b597ccc
doc fixed
michalkucharczyk Dec 15, 2023
c238595
Revert "rococo: some initial thing"
michalkucharczyk Dec 15, 2023
a76dffe
test-runtime: fix
michalkucharczyk Dec 15, 2023
0a51ea8
rococo-runtime: presets added
michalkucharczyk Dec 15, 2023
ffddbfa
Cargo.lock updated
michalkucharczyk Dec 15, 2023
7c6bccb
naming: named_patch -> named_preset
michalkucharczyk Dec 15, 2023
2caffaa
naming: patch_name -> preset_name
michalkucharczyk Dec 15, 2023
9ce209c
fmt
michalkucharczyk Dec 15, 2023
0c98000
preset_names/get_preset implemented for runtimes
michalkucharczyk Dec 15, 2023
0353773
polkadot-service: rococo-based chain-spec fixes
michalkucharczyk Dec 15, 2023
6e4dcb2
String -> &str
michalkucharczyk Dec 15, 2023
02e6b24
fmt
michalkucharczyk Dec 15, 2023
618fd1b
fixes
michalkucharczyk Dec 15, 2023
9ba33b6
Cargo.lock updated
michalkucharczyk Dec 15, 2023
ceeca12
wococo, versi presets added
michalkucharczyk Dec 16, 2023
68dea0a
Merge branch 'master' into mku-chain-spec-support-in-runtime
michalkucharczyk Dec 16, 2023
d2eafd7
Merge remote-tracking branch 'origin/master' into mku-chain-spec-supp…
michalkucharczyk Jan 2, 2024
c017a19
Merge branch 'master' into mku-chain-spec-support-in-runtime
michalkucharczyk Jan 2, 2024
9c7a865
Merge remote-tracking branch 'origin/master' into mku-chain-spec-supp…
michalkucharczyk Mar 13, 2024
7bf267b
merging to master leftovers
michalkucharczyk Mar 13, 2024
8d65c04
Cargo.lock
michalkucharczyk Mar 13, 2024
0d45b94
fixes
michalkucharczyk Mar 13, 2024
a4d61fc
fix
michalkucharczyk Mar 13, 2024
8ef837f
coretime/people westend/rococo fixes
michalkucharczyk Mar 13, 2024
67e8af8
rococo: bitvec fix
michalkucharczyk Mar 13, 2024
0b51cfd
substrate-test-runtime: fixes
michalkucharczyk Mar 13, 2024
410c042
fix
michalkucharczyk Mar 13, 2024
0c47977
Merge remote-tracking branch 'origin/master' into mku-chain-spec-supp…
michalkucharczyk Mar 13, 2024
e1726d2
one more
michalkucharczyk Mar 13, 2024
d77e59e
...
michalkucharczyk Mar 13, 2024
22ea184
polkadot-parachain: compilation fix
michalkucharczyk Mar 13, 2024
ccb667d
Merge remote-tracking branch 'origin/master' into mku-chain-spec-supp…
michalkucharczyk Mar 19, 2024
7419a0b
GenesisBuilder: api: create_default_config and v2 removed
michalkucharczyk Mar 19, 2024
d1b8126
GenesisBuilder: impls: create_default_config removed
michalkucharczyk Mar 19, 2024
c186869
fmt
michalkucharczyk Mar 19, 2024
699224c
GenesisBuilder: api: PresetId added
michalkucharczyk Mar 19, 2024
50aaee1
GenesisBuilder: test-runtime: PresetId added
michalkucharczyk Mar 19, 2024
d50a372
GenesisBuilder: &PresetId
michalkucharczyk Mar 19, 2024
458d458
GenesisBuilder: runtimes update
michalkucharczyk Mar 19, 2024
d397a72
GenesisBuilder: runtimes update 2
michalkucharczyk Mar 19, 2024
686f5b8
taplo happy
michalkucharczyk Mar 19, 2024
5fc94e0
fixes
michalkucharczyk Mar 19, 2024
53a79a7
GenesisBuilder: rococo: PresetId added
michalkucharczyk Mar 19, 2024
08885a5
GenesisBuilder: tests and doc fixes
michalkucharczyk Mar 19, 2024
74869da
fix
michalkucharczyk Mar 19, 2024
1932cf1
Cargo.lock
michalkucharczyk Mar 19, 2024
5a954c9
doc
michalkucharczyk Mar 20, 2024
3b41d66
doc
michalkucharczyk Mar 20, 2024
5a430f8
better error handling
michalkucharczyk Mar 22, 2024
2c1783e
Merge remote-tracking branch 'origin/master' into mku-chain-spec-supp…
michalkucharczyk Mar 26, 2024
730cc87
test fixed
michalkucharczyk Mar 26, 2024
23067cd
chain-spec-builder: list preset output fixed
michalkucharczyk Mar 26, 2024
71589d9
PresetId: BoundedVec used
michalkucharczyk Mar 26, 2024
3fbbb89
Update polkadot/runtime/rococo/src/genesis_config_presets.rs
michalkucharczyk Mar 26, 2024
758fd45
Update substrate/primitives/genesis-builder/src/lib.rs
michalkucharczyk Mar 26, 2024
92e6824
doc: non-frame runtime mentioned
michalkucharczyk Mar 26, 2024
c3c1452
fix
michalkucharczyk Mar 26, 2024
671d52a
fmt
michalkucharczyk Mar 26, 2024
f990e64
prdoc + bump crates versions
michalkucharczyk Mar 26, 2024
a234e59
prdoc fixed
michalkucharczyk Mar 26, 2024
0028492
made taplo happy
michalkucharczyk Mar 26, 2024
fc22eac
Merge remote-tracking branch 'origin/master' into mku-chain-spec-supp…
michalkucharczyk Apr 2, 2024
468ed2d
prdoc fix
michalkucharczyk Apr 2, 2024
1a3fcb3
fix
michalkucharczyk Apr 2, 2024
4d04418
Merge remote-tracking branch 'origin/master' into mku-chain-spec-supp…
michalkucharczyk Apr 2, 2024
c374a37
PresetId is RuntimeString
michalkucharczyk Apr 2, 2024
b1e5230
genesis_builder_helper: closure added
michalkucharczyk Apr 2, 2024
a39c4bb
test-runtime: fix
michalkucharczyk Apr 2, 2024
436494e
rococo: fixes
michalkucharczyk Apr 2, 2024
a773494
runtimes: closure added
michalkucharczyk Apr 2, 2024
f273a87
Update substrate/test-utils/runtime/src/lib.rs
michalkucharczyk Apr 2, 2024
9146b12
Merge branch 'master' into mku-chain-spec-support-in-runtime
michalkucharczyk Apr 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ use cumulus_primitives_core::ParaId;
use frame_support::{
construct_runtime, derive_impl,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
genesis_builder_helper::{build_state, get_preset},
ord_parameter_types, parameter_types,
traits::{
fungible, fungibles, tokens::imbalance::ResolveAssetTo, AsEnsureOriginWithArg, ConstBool,
Expand Down Expand Up @@ -1648,12 +1648,16 @@ impl_runtime_apis! {
}

impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
fn create_default_config() -> Vec<u8> {
create_default_config::<RuntimeGenesisConfig>()
fn build_state(config: Vec<u8>) -> sp_genesis_builder::Result {
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
build_state::<RuntimeGenesisConfig>(config)
}

fn build_config(config: Vec<u8>) -> sp_genesis_builder::Result {
build_config::<RuntimeGenesisConfig>(config)
fn get_preset(id: &Option<sp_genesis_builder::PresetId>) -> Option<Vec<u8>> {
get_preset::<RuntimeGenesisConfig>(id)
}

fn preset_names() -> Vec<sp_genesis_builder::PresetId> {
michalkucharczyk marked this conversation as resolved.
Show resolved Hide resolved
vec![]
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down
14 changes: 9 additions & 5 deletions cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use cumulus_primitives_core::{AggregateMessageOrigin, ParaId};
use frame_support::{
construct_runtime, derive_impl,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
genesis_builder_helper::{build_state, get_preset},
ord_parameter_types, parameter_types,
traits::{
fungible, fungibles,
Expand Down Expand Up @@ -1725,12 +1725,16 @@ impl_runtime_apis! {
}

impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
fn create_default_config() -> Vec<u8> {
create_default_config::<RuntimeGenesisConfig>()
fn build_state(config: Vec<u8>) -> sp_genesis_builder::Result {
build_state::<RuntimeGenesisConfig>(config)
}

fn build_config(config: Vec<u8>) -> sp_genesis_builder::Result {
build_config::<RuntimeGenesisConfig>(config)
fn get_preset(id: &Option<sp_genesis_builder::PresetId>) -> Option<Vec<u8>> {
get_preset::<RuntimeGenesisConfig>(id)
}

fn preset_names() -> Vec<sp_genesis_builder::PresetId> {
vec![]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ use cumulus_primitives_core::ParaId;
use frame_support::{
construct_runtime, derive_impl,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
genesis_builder_helper::{build_state, get_preset},
parameter_types,
traits::{ConstBool, ConstU32, ConstU64, ConstU8, TransformOrigin},
weights::{ConstantMultiplier, Weight},
Expand Down Expand Up @@ -1457,12 +1457,16 @@ impl_runtime_apis! {
}

impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
fn create_default_config() -> Vec<u8> {
create_default_config::<RuntimeGenesisConfig>()
fn build_state(config: Vec<u8>) -> sp_genesis_builder::Result {
build_state::<RuntimeGenesisConfig>(config)
}

fn build_config(config: Vec<u8>) -> sp_genesis_builder::Result {
build_config::<RuntimeGenesisConfig>(config)
fn get_preset(id: &Option<sp_genesis_builder::PresetId>) -> Option<Vec<u8>> {
get_preset::<RuntimeGenesisConfig>(id)
}

fn preset_names() -> Vec<sp_genesis_builder::PresetId> {
vec![]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ use bridge_hub_common::{
use frame_support::{
construct_runtime, derive_impl,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
genesis_builder_helper::{build_state, get_preset},
parameter_types,
traits::{ConstBool, ConstU32, ConstU64, ConstU8, TransformOrigin},
weights::{ConstantMultiplier, Weight},
Expand Down Expand Up @@ -1111,12 +1111,16 @@ impl_runtime_apis! {
}

impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
fn create_default_config() -> Vec<u8> {
create_default_config::<RuntimeGenesisConfig>()
fn build_state(config: Vec<u8>) -> sp_genesis_builder::Result {
build_state::<RuntimeGenesisConfig>(config)
}

fn build_config(config: Vec<u8>) -> sp_genesis_builder::Result {
build_config::<RuntimeGenesisConfig>(config)
fn get_preset(id: &Option<sp_genesis_builder::PresetId>) -> Option<Vec<u8>> {
get_preset::<RuntimeGenesisConfig>(id)
}

fn preset_names() -> Vec<sp_genesis_builder::PresetId> {
vec![]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ use cumulus_primitives_core::{AggregateMessageOrigin, ParaId};
use frame_support::{
construct_runtime, derive_impl,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
genesis_builder_helper::{build_state, get_preset},
parameter_types,
traits::{
fungible::HoldConsideration, ConstBool, ConstU16, ConstU32, ConstU64, ConstU8,
Expand Down Expand Up @@ -1061,12 +1061,16 @@ impl_runtime_apis! {
}

impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
fn create_default_config() -> Vec<u8> {
create_default_config::<RuntimeGenesisConfig>()
fn build_state(config: Vec<u8>) -> sp_genesis_builder::Result {
build_state::<RuntimeGenesisConfig>(config)
}

fn build_config(config: Vec<u8>) -> sp_genesis_builder::Result {
build_config::<RuntimeGenesisConfig>(config)
fn get_preset(id: &Option<sp_genesis_builder::PresetId>) -> Option<Vec<u8>> {
get_preset::<RuntimeGenesisConfig>(id)
}

fn preset_names() -> Vec<sp_genesis_builder::PresetId> {
vec![]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use sp_version::RuntimeVersion;
use frame_support::{
construct_runtime, derive_impl,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
genesis_builder_helper::{build_state, get_preset},
parameter_types,
traits::{ConstBool, ConstU16, ConstU32, ConstU64, ConstU8},
weights::{ConstantMultiplier, Weight},
Expand Down Expand Up @@ -793,12 +793,16 @@ impl_runtime_apis! {
}

impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
fn create_default_config() -> Vec<u8> {
create_default_config::<RuntimeGenesisConfig>()
fn build_state(config: Vec<u8>) -> sp_genesis_builder::Result {
build_state::<RuntimeGenesisConfig>(config)
}

fn build_config(config: Vec<u8>) -> sp_genesis_builder::Result {
build_config::<RuntimeGenesisConfig>(config)
fn get_preset(id: &Option<sp_genesis_builder::PresetId>) -> Option<Vec<u8>> {
get_preset::<RuntimeGenesisConfig>(id)
}

fn preset_names() -> Vec<sp_genesis_builder::PresetId> {
vec![]
}
}
}
Expand Down
14 changes: 9 additions & 5 deletions cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use cumulus_primitives_core::{AggregateMessageOrigin, ParaId};
use frame_support::{
construct_runtime, derive_impl,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
genesis_builder_helper::{build_state, get_preset},
parameter_types,
traits::{ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, TransformOrigin},
weights::{ConstantMultiplier, Weight},
Expand Down Expand Up @@ -877,12 +877,16 @@ impl_runtime_apis! {
}

impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
fn create_default_config() -> Vec<u8> {
create_default_config::<RuntimeGenesisConfig>()
fn build_state(config: Vec<u8>) -> sp_genesis_builder::Result {
build_state::<RuntimeGenesisConfig>(config)
}

fn build_config(config: Vec<u8>) -> sp_genesis_builder::Result {
build_config::<RuntimeGenesisConfig>(config)
fn get_preset(id: &Option<sp_genesis_builder::PresetId>) -> Option<Vec<u8>> {
get_preset::<RuntimeGenesisConfig>(id)
}

fn preset_names() -> Vec<sp_genesis_builder::PresetId> {
vec![]
}
}
}
Expand Down
14 changes: 9 additions & 5 deletions cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use cumulus_primitives_core::{AggregateMessageOrigin, ParaId};
use frame_support::{
construct_runtime, derive_impl,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
genesis_builder_helper::{build_state, get_preset},
parameter_types,
traits::{ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, TransformOrigin},
weights::{ConstantMultiplier, Weight},
Expand Down Expand Up @@ -868,12 +868,16 @@ impl_runtime_apis! {
}

impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
fn create_default_config() -> Vec<u8> {
create_default_config::<RuntimeGenesisConfig>()
fn build_state(config: Vec<u8>) -> sp_genesis_builder::Result {
build_state::<RuntimeGenesisConfig>(config)
}

fn build_config(config: Vec<u8>) -> sp_genesis_builder::Result {
build_config::<RuntimeGenesisConfig>(config)
fn get_preset(id: &Option<sp_genesis_builder::PresetId>) -> Option<Vec<u8>> {
get_preset::<RuntimeGenesisConfig>(id)
}

fn preset_names() -> Vec<sp_genesis_builder::PresetId> {
vec![]
}
}
}
Expand Down
14 changes: 9 additions & 5 deletions cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ use cumulus_primitives_core::AggregateMessageOrigin;
pub use frame_support::{
construct_runtime, derive_impl,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
genesis_builder_helper::{build_state, get_preset},
parameter_types,
traits::{
ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything, IsInVec, Randomness,
Expand Down Expand Up @@ -474,12 +474,16 @@ impl_runtime_apis! {
}

impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
fn create_default_config() -> Vec<u8> {
create_default_config::<RuntimeGenesisConfig>()
fn build_state(config: Vec<u8>) -> sp_genesis_builder::Result {
build_state::<RuntimeGenesisConfig>(config)
}

fn build_config(config: Vec<u8>) -> sp_genesis_builder::Result {
build_config::<RuntimeGenesisConfig>(config)
fn get_preset(id: &Option<sp_genesis_builder::PresetId>) -> Option<Vec<u8>> {
get_preset::<RuntimeGenesisConfig>(id)
}

fn preset_names() -> Vec<sp_genesis_builder::PresetId> {
vec![]
}
}
}
Expand Down
14 changes: 9 additions & 5 deletions cumulus/parachains/runtimes/people/people-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use cumulus_primitives_core::{AggregateMessageOrigin, ParaId};
use frame_support::{
construct_runtime, derive_impl,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
genesis_builder_helper::{build_state, get_preset},
parameter_types,
traits::{
ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything, TransformOrigin,
Expand Down Expand Up @@ -850,12 +850,16 @@ impl_runtime_apis! {
}

impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
fn create_default_config() -> Vec<u8> {
create_default_config::<RuntimeGenesisConfig>()
fn build_state(config: Vec<u8>) -> sp_genesis_builder::Result {
build_state::<RuntimeGenesisConfig>(config)
}

fn build_config(config: Vec<u8>) -> sp_genesis_builder::Result {
build_config::<RuntimeGenesisConfig>(config)
fn get_preset(id: &Option<sp_genesis_builder::PresetId>) -> Option<Vec<u8>> {
get_preset::<RuntimeGenesisConfig>(id)
}

fn preset_names() -> Vec<sp_genesis_builder::PresetId> {
vec![]
}
}
}
Expand Down
Loading
Loading