From 1107fa7dafc8fe1360d122b82a279bb5d7425a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dino=20Pa=C4=8Dandi?= <3002868+Dinonard@users.noreply.github.com> Date: Mon, 25 Nov 2024 11:30:48 +0100 Subject: [PATCH 1/2] runtime-1100 release prep (#1387) * Runtime-1100 release prep * executed transaction cleanup --- Cargo.lock | 8 ++++---- runtime/astar/Cargo.toml | 2 +- runtime/astar/src/lib.rs | 2 +- runtime/local/Cargo.toml | 2 +- runtime/shibuya/Cargo.toml | 2 +- runtime/shibuya/src/lib.rs | 7 +------ runtime/shiden/Cargo.toml | 2 +- runtime/shiden/src/lib.rs | 7 +------ 8 files changed, 11 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9dec9d5ff7..6fc98b7556 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -609,7 +609,7 @@ dependencies = [ [[package]] name = "astar-runtime" -version = "5.45.0" +version = "5.46.0" dependencies = [ "array-bytes", "astar-primitives", @@ -6487,7 +6487,7 @@ dependencies = [ [[package]] name = "local-runtime" -version = "5.45.0" +version = "5.46.0" dependencies = [ "array-bytes", "astar-primitives", @@ -14315,7 +14315,7 @@ dependencies = [ [[package]] name = "shibuya-runtime" -version = "5.45.0" +version = "5.46.0" dependencies = [ "array-bytes", "astar-primitives", @@ -14437,7 +14437,7 @@ dependencies = [ [[package]] name = "shiden-runtime" -version = "5.45.0" +version = "5.46.0" dependencies = [ "array-bytes", "astar-primitives", diff --git a/runtime/astar/Cargo.toml b/runtime/astar/Cargo.toml index 9ad0359ea1..22575f9a1f 100644 --- a/runtime/astar/Cargo.toml +++ b/runtime/astar/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "astar-runtime" -version = "5.45.0" +version = "5.46.0" build = "build.rs" authors.workspace = true edition.workspace = true diff --git a/runtime/astar/src/lib.rs b/runtime/astar/src/lib.rs index 2470d17d16..6763d0ed85 100644 --- a/runtime/astar/src/lib.rs +++ b/runtime/astar/src/lib.rs @@ -186,7 +186,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("astar"), impl_name: create_runtime_str!("astar"), authoring_version: 1, - spec_version: 1000, + spec_version: 1100, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 3, diff --git a/runtime/local/Cargo.toml b/runtime/local/Cargo.toml index 1fc813ba8b..0ff2f9336b 100644 --- a/runtime/local/Cargo.toml +++ b/runtime/local/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "local-runtime" -version = "5.45.0" +version = "5.46.0" build = "build.rs" authors.workspace = true edition.workspace = true diff --git a/runtime/shibuya/Cargo.toml b/runtime/shibuya/Cargo.toml index fa1abf2c0e..6facd366a7 100644 --- a/runtime/shibuya/Cargo.toml +++ b/runtime/shibuya/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shibuya-runtime" -version = "5.45.0" +version = "5.46.0" build = "build.rs" authors.workspace = true edition.workspace = true diff --git a/runtime/shibuya/src/lib.rs b/runtime/shibuya/src/lib.rs index 39829378ad..56189d1213 100644 --- a/runtime/shibuya/src/lib.rs +++ b/runtime/shibuya/src/lib.rs @@ -207,7 +207,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("shibuya"), impl_name: create_runtime_str!("shibuya"), authoring_version: 1, - spec_version: 1000, + spec_version: 1100, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 3, @@ -1538,11 +1538,6 @@ impl pallet_migrations::Config for Runtime { #[cfg(feature = "runtime-benchmarks")] impl vesting_mbm::Config for Runtime {} -impl cumulus_pallet_xcmp_queue::migration::v5::V5Config for Runtime { - // This must be the same as the `ChannelInfo` from the `Config`: - type ChannelList = ParachainSystem; -} - construct_runtime!( pub struct Runtime { diff --git a/runtime/shiden/Cargo.toml b/runtime/shiden/Cargo.toml index 4fd7a46d13..54a7f6d645 100644 --- a/runtime/shiden/Cargo.toml +++ b/runtime/shiden/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shiden-runtime" -version = "5.45.0" +version = "5.46.0" build = "build.rs" authors.workspace = true edition.workspace = true diff --git a/runtime/shiden/src/lib.rs b/runtime/shiden/src/lib.rs index 754e752a8e..c6165decf7 100644 --- a/runtime/shiden/src/lib.rs +++ b/runtime/shiden/src/lib.rs @@ -177,7 +177,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("shiden"), impl_name: create_runtime_str!("shiden"), authoring_version: 1, - spec_version: 1000, + spec_version: 1100, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 3, @@ -1206,11 +1206,6 @@ impl pallet_migrations::Config for Runtime { type WeightInfo = pallet_migrations::weights::SubstrateWeight; } -impl cumulus_pallet_xcmp_queue::migration::v5::V5Config for Runtime { - // This must be the same as the `ChannelInfo` from the `Config`: - type ChannelList = ParachainSystem; -} - construct_runtime!( pub struct Runtime { From fc3dbf888c62503a9e83d327a660c3ed4d8ddef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dino=20Pa=C4=8Dandi?= <3002868+Dinonard@users.noreply.github.com> Date: Mon, 25 Nov 2024 11:35:33 +0100 Subject: [PATCH 2/2] Governance proxy (#1386) * Governance proxy * Update runtime/local/src/genesis_config.rs Co-authored-by: Igor Papandinas <26460174+ipapandinas@users.noreply.github.com> --------- Co-authored-by: Igor Papandinas <26460174+ipapandinas@users.noreply.github.com> --- runtime/astar/src/genesis_config.rs | 25 +++++++++---------- runtime/astar/src/lib.rs | 11 +++++++++ runtime/local/src/genesis_config.rs | 35 ++++++++++++--------------- runtime/local/src/lib.rs | 11 +++++++++ runtime/shibuya/src/genesis_config.rs | 25 +++++++++---------- runtime/shibuya/src/lib.rs | 13 +++++++--- 6 files changed, 72 insertions(+), 48 deletions(-) diff --git a/runtime/astar/src/genesis_config.rs b/runtime/astar/src/genesis_config.rs index de2080edb1..35d323b14f 100644 --- a/runtime/astar/src/genesis_config.rs +++ b/runtime/astar/src/genesis_config.rs @@ -40,25 +40,24 @@ pub fn default_config(para_id: u32) -> serde_json::Value { let dave = GenesisAccount::::from_seed("Dave"); let eve = GenesisAccount::::from_seed("Eve"); - let balances: Vec<(AccountId, Balance)> = vec![ - (alice.account_id(), 1_000_000_000 * ASTR), - (bob.account_id(), 1_000_000_000 * ASTR), - ( - TreasuryPalletId::get().into_account_truncating(), - 1_000_000_000 * ASTR, - ), - ( - CommunityTreasuryPalletId::get().into_account_truncating(), - 1_000_000_000 * ASTR, - ), - ]; - let authorities = vec![&alice, &bob]; let accounts = vec![&alice, &bob, &charlie, &dave, &eve] .iter() .map(|x| x.account_id()) .collect::>(); + let balances = accounts + .iter() + .chain( + vec![ + TreasuryPalletId::get().into_account_truncating(), + CommunityTreasuryPalletId::get().into_account_truncating(), + ] + .iter(), + ) + .map(|x| (x.clone(), 1_000_000_000 * ASTR)) + .collect::>(); + let config = RuntimeGenesisConfig { system: Default::default(), sudo: SudoConfig { diff --git a/runtime/astar/src/lib.rs b/runtime/astar/src/lib.rs index 6763d0ed85..17a6e0f090 100644 --- a/runtime/astar/src/lib.rs +++ b/runtime/astar/src/lib.rs @@ -1040,6 +1040,8 @@ pub enum ProxyType { DappStaking, /// Only claim_staker call from pallet DappStaking allowed for proxy account StakerRewardClaim, + /// All governance related calls allowed for proxy account + Governance, } impl Default for ProxyType { @@ -1111,6 +1113,15 @@ impl InstanceFilter for ProxyType { ) ) } + ProxyType::Governance => { + matches!( + c, + RuntimeCall::Democracy(..) + | RuntimeCall::Council(..) + | RuntimeCall::TechnicalCommittee(..) + | RuntimeCall::CommunityCouncil(..) + ) + } } } diff --git a/runtime/local/src/genesis_config.rs b/runtime/local/src/genesis_config.rs index c6dc2c2e61..f7d122c271 100644 --- a/runtime/local/src/genesis_config.rs +++ b/runtime/local/src/genesis_config.rs @@ -44,30 +44,27 @@ pub fn default_config() -> serde_json::Value { let dave = GenesisAccount::::from_seed("Dave"); let eve = GenesisAccount::::from_seed("Eve"); - let balances: Vec<(AccountId, Balance)> = vec![ - (alice.account_id(), 1_000_000_000 * AST), - (bob.account_id(), 1_000_000_000 * AST), - ( - TreasuryPalletId::get().into_account_truncating(), - 1_000_000_000 * AST, - ), - ( - CommunityTreasuryPalletId::get().into_account_truncating(), - 1_000_000_000 * AST, - ), - ( - // Private key: 0x01ab6e801c06e59ca97a14fc0a1978b27fa366fc87450e0b65459dd3515b7391 - // H160 public address: 0xaaafB3972B05630fCceE866eC69CdADd9baC2771 - AccountId::from_ss58check("5FQedkNQcF2fJPwkB6Z1ZcMgGti4vcJQNs6x85YPv3VhjBBT").unwrap(), - 1_000_000_000 * AST, - ), - ]; - let accounts = vec![&alice, &bob, &charlie, &dave, &eve] .iter() .map(|x| x.account_id()) .collect::>(); + let balances = accounts + .iter() + .chain( + vec![ + TreasuryPalletId::get().into_account_truncating(), + CommunityTreasuryPalletId::get().into_account_truncating(), + // Private key: 0x01ab6e801c06e59ca97a14fc0a1978b27fa366fc87450e0b65459dd3515b7391 + // H160 public address: 0xaaafB3972B05630fCceE866eC69CdADd9baC2771 + AccountId::from_ss58check("5FQedkNQcF2fJPwkB6Z1ZcMgGti4vcJQNs6x85YPv3VhjBBT") + .expect("Invalid SS58 address"), + ] + .iter(), + ) + .map(|x| (x.clone(), 1_000_000_000 * AST)) + .collect::>(); + let config = RuntimeGenesisConfig { system: Default::default(), sudo: SudoConfig { diff --git a/runtime/local/src/lib.rs b/runtime/local/src/lib.rs index 650698f91a..b290d574a3 100644 --- a/runtime/local/src/lib.rs +++ b/runtime/local/src/lib.rs @@ -788,6 +788,8 @@ pub enum ProxyType { DappStaking, /// Only claim_staker call from pallet DappStaking allowed for proxy account StakerRewardClaim, + /// All governance related calls allowed for proxy account + Governance, } impl Default for ProxyType { @@ -850,6 +852,15 @@ impl InstanceFilter for ProxyType { ) ) } + ProxyType::Governance => { + matches!( + c, + RuntimeCall::Democracy(..) + | RuntimeCall::Council(..) + | RuntimeCall::TechnicalCommittee(..) + | RuntimeCall::CommunityCouncil(..) + ) + } } } diff --git a/runtime/shibuya/src/genesis_config.rs b/runtime/shibuya/src/genesis_config.rs index 1b6ce2db93..3d6dfde1cd 100644 --- a/runtime/shibuya/src/genesis_config.rs +++ b/runtime/shibuya/src/genesis_config.rs @@ -40,25 +40,24 @@ pub fn default_config(para_id: u32) -> serde_json::Value { let dave = GenesisAccount::::from_seed("Dave"); let eve = GenesisAccount::::from_seed("Eve"); - let balances: Vec<(AccountId, Balance)> = vec![ - (alice.account_id(), 1_000_000_000 * SBY), - (bob.account_id(), 1_000_000_000 * SBY), - ( - TreasuryPalletId::get().into_account_truncating(), - 1_000_000_000 * SBY, - ), - ( - CommunityTreasuryPalletId::get().into_account_truncating(), - 1_000_000_000 * SBY, - ), - ]; - let authorities = vec![&alice, &bob]; let accounts = vec![&alice, &bob, &charlie, &dave, &eve] .iter() .map(|x| x.account_id()) .collect::>(); + let balances = accounts + .iter() + .chain( + vec![ + TreasuryPalletId::get().into_account_truncating(), + CommunityTreasuryPalletId::get().into_account_truncating(), + ] + .iter(), + ) + .map(|x| (x.clone(), 1_000_000_000 * SBY)) + .collect::>(); + let config = RuntimeGenesisConfig { system: Default::default(), sudo: SudoConfig { diff --git a/runtime/shibuya/src/lib.rs b/runtime/shibuya/src/lib.rs index 56189d1213..9a4b1fffcb 100644 --- a/runtime/shibuya/src/lib.rs +++ b/runtime/shibuya/src/lib.rs @@ -1010,7 +1010,7 @@ pub enum ProxyType { Balances, /// All Runtime calls from Pallet Assets allowed for proxy account Assets, - /// Not used at the moment, but kept for backwards compatibility. + /// All governance related calls allowed for proxy account Governance, /// Only provide_judgement call from pallet identity allowed for proxy account IdentityJudgement, @@ -1099,8 +1099,15 @@ impl InstanceFilter for ProxyType { ) ) } - // Not used at the moment, but kept for backwards compatibility. - ProxyType::Governance => false, + ProxyType::Governance => { + matches!( + c, + RuntimeCall::Democracy(..) + | RuntimeCall::Council(..) + | RuntimeCall::TechnicalCommittee(..) + | RuntimeCall::CommunityCouncil(..) + ) + } } }