From b38466955253c5fdf0b66c79b584b2ca889d0cf4 Mon Sep 17 00:00:00 2001 From: Agus Date: Tue, 25 Apr 2023 15:58:45 -0300 Subject: [PATCH 1/4] add multisigs to moonbeam and moonriver --- Cargo.lock | 2 ++ runtime/moonbeam/Cargo.toml | 2 ++ runtime/moonbeam/src/lib.rs | 21 +++++++++++++++++++++ runtime/moonriver/Cargo.toml | 2 ++ runtime/moonriver/src/lib.rs | 21 +++++++++++++++++++++ 5 files changed, 48 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 998582fdb7..4b80bd4ea7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5815,6 +5815,7 @@ dependencies = [ "pallet-maintenance-mode", "pallet-migrations", "pallet-moonbeam-orbiters", + "pallet-multisig", "pallet-parachain-staking", "pallet-preimage", "pallet-proxy", @@ -6157,6 +6158,7 @@ dependencies = [ "pallet-maintenance-mode", "pallet-migrations", "pallet-moonbeam-orbiters", + "pallet-multisig", "pallet-parachain-staking", "pallet-preimage", "pallet-proxy", diff --git a/runtime/moonbeam/Cargo.toml b/runtime/moonbeam/Cargo.toml index 7ccd25bda9..178290a0d8 100644 --- a/runtime/moonbeam/Cargo.toml +++ b/runtime/moonbeam/Cargo.toml @@ -75,6 +75,7 @@ pallet-balances = { workspace = true } pallet-collective = { workspace = true } pallet-democracy = { workspace = true } pallet-identity = { workspace = true } +pallet-multisig = { workspace = true } pallet-preimage = { workspace = true } pallet-proxy = { workspace = true } pallet-root-testing = { workspace = true } @@ -216,6 +217,7 @@ std = [ "pallet-maintenance-mode/std", "pallet-migrations/std", "pallet-moonbeam-orbiters/std", + "pallet-multisig/std", "pallet-parachain-staking/std", "pallet-preimage/std", "pallet-proxy-genesis-companion/std", diff --git a/runtime/moonbeam/src/lib.rs b/runtime/moonbeam/src/lib.rs index a19d5431cf..03db72c6bd 100644 --- a/runtime/moonbeam/src/lib.rs +++ b/runtime/moonbeam/src/lib.rs @@ -1318,6 +1318,24 @@ impl pallet_randomness::Config for Runtime { impl pallet_root_testing::Config for Runtime {} +parameter_types! { + // One storage item; key size is 32; value is size 4+4+16+20 bytes = 44 bytes. + pub const DepositBase: Balance = currency::deposit(1, 76); + // Additional storage item size of 32 bytes. + pub const DepositFactor: Balance = currency::deposit(0, 20); + pub const MaxSignatories: u32 = 100; +} + +impl pallet_multisig::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type Currency = Balances; + type DepositBase = DepositBase; + type DepositFactor = DepositFactor; + type MaxSignatories = MaxSignatories; + type WeightInfo = pallet_multisig::weights::SubstrateWeight; +} + construct_runtime! { pub enum Runtime where Block = Block, @@ -1391,6 +1409,9 @@ construct_runtime! { // Randomness Randomness: pallet_randomness::{Pallet, Call, Storage, Event, Inherent} = 120, + + // Multisig + Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 130, } } diff --git a/runtime/moonriver/Cargo.toml b/runtime/moonriver/Cargo.toml index c658d70b80..68a7e22354 100644 --- a/runtime/moonriver/Cargo.toml +++ b/runtime/moonriver/Cargo.toml @@ -80,6 +80,7 @@ pallet-collective = { workspace = true } pallet-conviction-voting = { workspace = true } pallet-democracy = { workspace = true } pallet-identity = { workspace = true } +pallet-multisig = { workspace = true } pallet-preimage = { workspace = true } pallet-proxy = { workspace = true } pallet-referenda = { workspace = true } @@ -226,6 +227,7 @@ std = [ "pallet-maintenance-mode/std", "pallet-migrations/std", "pallet-moonbeam-orbiters/std", + "pallet-multisig/std", "pallet-parachain-staking/std", "pallet-preimage/std", "pallet-proxy-genesis-companion/std", diff --git a/runtime/moonriver/src/lib.rs b/runtime/moonriver/src/lib.rs index 701e1b7055..e0cd08f64f 100644 --- a/runtime/moonriver/src/lib.rs +++ b/runtime/moonriver/src/lib.rs @@ -1241,6 +1241,24 @@ impl pallet_randomness::Config for Runtime { impl pallet_root_testing::Config for Runtime {} +parameter_types! { + // One storage item; key size is 32; value is size 4+4+16+20 bytes = 44 bytes. + pub const DepositBase: Balance = currency::deposit(1, 76); + // Additional storage item size of 32 bytes. + pub const DepositFactor: Balance = currency::deposit(0, 20); + pub const MaxSignatories: u32 = 100; +} + +impl pallet_multisig::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type Currency = Balances; + type DepositBase = DepositBase; + type DepositFactor = DepositFactor; + type MaxSignatories = MaxSignatories; + type WeightInfo = pallet_multisig::weights::SubstrateWeight; +} + construct_runtime! { pub enum Runtime where Block = Block, @@ -1319,6 +1337,9 @@ construct_runtime! { // Randomness Randomness: pallet_randomness::{Pallet, Call, Storage, Event, Inherent} = 120, + + // Multisig + Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 130, } } From d1921e65a10a06a1a01558c61cfdf0d9dc00ad3f Mon Sep 17 00:00:00 2001 From: Agus Date: Tue, 9 May 2023 12:42:39 -0300 Subject: [PATCH 2/4] fix parameters --- runtime/moonbeam/src/lib.rs | 6 ++---- runtime/moonriver/src/lib.rs | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/runtime/moonbeam/src/lib.rs b/runtime/moonbeam/src/lib.rs index 03db72c6bd..d023af75ff 100644 --- a/runtime/moonbeam/src/lib.rs +++ b/runtime/moonbeam/src/lib.rs @@ -1322,7 +1322,7 @@ parameter_types! { // One storage item; key size is 32; value is size 4+4+16+20 bytes = 44 bytes. pub const DepositBase: Balance = currency::deposit(1, 76); // Additional storage item size of 32 bytes. - pub const DepositFactor: Balance = currency::deposit(0, 20); + pub const DepositFactor: Balance = currency::deposit(0, 32); pub const MaxSignatories: u32 = 100; } @@ -1368,6 +1368,7 @@ construct_runtime! { Identity: pallet_identity::{Pallet, Call, Storage, Event} = 33, Migrations: pallet_migrations::{Pallet, Call, Storage, Config, Event} = 34, ProxyGenesisCompanion: pallet_proxy_genesis_companion::{Pallet, Config} = 35, + Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 36, // Has been permanently removed for safety reasons. // Sudo: pallet_sudo::{Pallet, Call, Config, Storage, Event} = 40, @@ -1409,9 +1410,6 @@ construct_runtime! { // Randomness Randomness: pallet_randomness::{Pallet, Call, Storage, Event, Inherent} = 120, - - // Multisig - Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 130, } } diff --git a/runtime/moonriver/src/lib.rs b/runtime/moonriver/src/lib.rs index e0cd08f64f..54f45192f5 100644 --- a/runtime/moonriver/src/lib.rs +++ b/runtime/moonriver/src/lib.rs @@ -1245,7 +1245,7 @@ parameter_types! { // One storage item; key size is 32; value is size 4+4+16+20 bytes = 44 bytes. pub const DepositBase: Balance = currency::deposit(1, 76); // Additional storage item size of 32 bytes. - pub const DepositFactor: Balance = currency::deposit(0, 20); + pub const DepositFactor: Balance = currency::deposit(0, 32); pub const MaxSignatories: u32 = 100; } @@ -1291,6 +1291,7 @@ construct_runtime! { Identity: pallet_identity::{Pallet, Call, Storage, Event} = 33, Migrations: pallet_migrations::{Pallet, Call, Storage, Config, Event} = 34, ProxyGenesisCompanion: pallet_proxy_genesis_companion::{Pallet, Config} = 35, + Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 36, // Sudo was previously index 40 @@ -1337,9 +1338,6 @@ construct_runtime! { // Randomness Randomness: pallet_randomness::{Pallet, Call, Storage, Event, Inherent} = 120, - - // Multisig - Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 130, } } From f4b9d67ff49befb9688971baa4fa786a0918dba9 Mon Sep 17 00:00:00 2001 From: Agus Date: Tue, 9 May 2023 13:21:16 -0300 Subject: [PATCH 3/4] fix depositFactor --- runtime/moonbase/src/lib.rs | 2 +- runtime/moonbeam/src/lib.rs | 4 ++-- runtime/moonriver/src/lib.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/runtime/moonbase/src/lib.rs b/runtime/moonbase/src/lib.rs index defa91c984..47e30fd3bd 100644 --- a/runtime/moonbase/src/lib.rs +++ b/runtime/moonbase/src/lib.rs @@ -1255,7 +1255,7 @@ impl pallet_root_testing::Config for Runtime {} parameter_types! { // One storage item; key size is 32; value is size 4+4+16+20 bytes = 44 bytes. pub const DepositBase: Balance = currency::deposit(1, 76); - // Additional storage item size of 32 bytes. + // Additional storage item size of 20 bytes. pub const DepositFactor: Balance = currency::deposit(0, 20); pub const MaxSignatories: u32 = 100; } diff --git a/runtime/moonbeam/src/lib.rs b/runtime/moonbeam/src/lib.rs index 4d0113410b..fd920cfc8c 100644 --- a/runtime/moonbeam/src/lib.rs +++ b/runtime/moonbeam/src/lib.rs @@ -1319,8 +1319,8 @@ impl pallet_root_testing::Config for Runtime {} parameter_types! { // One storage item; key size is 32; value is size 4+4+16+20 bytes = 44 bytes. pub const DepositBase: Balance = currency::deposit(1, 76); - // Additional storage item size of 32 bytes. - pub const DepositFactor: Balance = currency::deposit(0, 32); + // Additional storage item size of 20 bytes. + pub const DepositFactor: Balance = currency::deposit(0, 20); pub const MaxSignatories: u32 = 100; } diff --git a/runtime/moonriver/src/lib.rs b/runtime/moonriver/src/lib.rs index 5c761d0572..cf6d9fdbaf 100644 --- a/runtime/moonriver/src/lib.rs +++ b/runtime/moonriver/src/lib.rs @@ -1242,8 +1242,8 @@ impl pallet_root_testing::Config for Runtime {} parameter_types! { // One storage item; key size is 32; value is size 4+4+16+20 bytes = 44 bytes. pub const DepositBase: Balance = currency::deposit(1, 76); - // Additional storage item size of 32 bytes. - pub const DepositFactor: Balance = currency::deposit(0, 32); + // Additional storage item size of 20 bytes. + pub const DepositFactor: Balance = currency::deposit(0, 20); pub const MaxSignatories: u32 = 100; } From b531e07090b87528cdb7be8ca798b135f53b2117 Mon Sep 17 00:00:00 2001 From: Agus Date: Tue, 9 May 2023 13:35:58 -0300 Subject: [PATCH 4/4] fix depositBase --- runtime/moonbase/src/lib.rs | 4 ++-- runtime/moonbeam/src/lib.rs | 4 ++-- runtime/moonriver/src/lib.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/runtime/moonbase/src/lib.rs b/runtime/moonbase/src/lib.rs index 47e30fd3bd..7358e9fe2d 100644 --- a/runtime/moonbase/src/lib.rs +++ b/runtime/moonbase/src/lib.rs @@ -1253,8 +1253,8 @@ impl pallet_randomness::Config for Runtime { impl pallet_root_testing::Config for Runtime {} parameter_types! { - // One storage item; key size is 32; value is size 4+4+16+20 bytes = 44 bytes. - pub const DepositBase: Balance = currency::deposit(1, 76); + // One storage item; key size is 32 + 20; value is size 4+4+16+20 bytes = 44 bytes. + pub const DepositBase: Balance = currency::deposit(1, 96); // Additional storage item size of 20 bytes. pub const DepositFactor: Balance = currency::deposit(0, 20); pub const MaxSignatories: u32 = 100; diff --git a/runtime/moonbeam/src/lib.rs b/runtime/moonbeam/src/lib.rs index fd920cfc8c..cc4bf60a1d 100644 --- a/runtime/moonbeam/src/lib.rs +++ b/runtime/moonbeam/src/lib.rs @@ -1317,8 +1317,8 @@ impl pallet_randomness::Config for Runtime { impl pallet_root_testing::Config for Runtime {} parameter_types! { - // One storage item; key size is 32; value is size 4+4+16+20 bytes = 44 bytes. - pub const DepositBase: Balance = currency::deposit(1, 76); + // One storage item; key size is 32 + 20; value is size 4+4+16+20 bytes = 44 bytes. + pub const DepositBase: Balance = currency::deposit(1, 96); // Additional storage item size of 20 bytes. pub const DepositFactor: Balance = currency::deposit(0, 20); pub const MaxSignatories: u32 = 100; diff --git a/runtime/moonriver/src/lib.rs b/runtime/moonriver/src/lib.rs index cf6d9fdbaf..f82a191802 100644 --- a/runtime/moonriver/src/lib.rs +++ b/runtime/moonriver/src/lib.rs @@ -1240,8 +1240,8 @@ impl pallet_randomness::Config for Runtime { impl pallet_root_testing::Config for Runtime {} parameter_types! { - // One storage item; key size is 32; value is size 4+4+16+20 bytes = 44 bytes. - pub const DepositBase: Balance = currency::deposit(1, 76); + // One storage item; key size is 32 + 20; value is size 4+4+16+20 bytes = 44 bytes. + pub const DepositBase: Balance = currency::deposit(1, 96); // Additional storage item size of 20 bytes. pub const DepositFactor: Balance = currency::deposit(0, 20); pub const MaxSignatories: u32 = 100;