diff --git a/Cargo.lock b/Cargo.lock index 895b9ebc8d..61e460cb56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -992,7 +992,9 @@ dependencies = [ "pallet-collective", "pallet-conviction-voting", "pallet-currencies", + "pallet-democracy 28.0.0", "pallet-duster", + "pallet-elections-phragmen", "pallet-ema-oracle", "pallet-identity", "pallet-lbp", @@ -1010,6 +1012,7 @@ dependencies = [ "pallet-session", "pallet-state-trie-migration", "pallet-timestamp", + "pallet-tips", "pallet-transaction-multi-payment", "pallet-transaction-pause", "pallet-transaction-payment", diff --git a/Cargo.toml b/Cargo.toml index 1e9f24987d..8ce5ea8215 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,7 +64,9 @@ pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = pallet-bounties = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-conviction-voting = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } +pallet-democracy = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-election-provider-multi-phase = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } +pallet-elections-phragmen = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-identity = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-im-online = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-indices = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } @@ -85,6 +87,7 @@ pallet-staking-reward-fn = { git = "https://github.com/paritytech/polkadot-sdk", pallet-state-trie-migration = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } +pallet-tips = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch ="release-polkadot-v1.7.2", default-features = false } @@ -330,6 +333,7 @@ pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-conviction-voting = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } +pallet-elections-phragmen = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-identity = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-preimage = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } @@ -339,6 +343,7 @@ pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk", branch pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } +pallet-tips = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } diff --git a/runtime/basilisk/Cargo.toml b/runtime/basilisk/Cargo.toml index f6bba91f07..22aad7ab03 100644 --- a/runtime/basilisk/Cargo.toml +++ b/runtime/basilisk/Cargo.toml @@ -28,7 +28,10 @@ pallet-xyk-liquidity-mining = { workspace = true , default-features = false } pallet-xyk-liquidity-mining-benchmarking = { workspace = true, optional = true, default-features = false } pallet-treasury = { workspace = true } +pallet-democracy = { workspace = true } pallet-scheduler = { workspace = true } +pallet-elections-phragmen = { workspace = true } +pallet-tips = { workspace = true } pallet-identity = { workspace = true } pallet-state-trie-migration = { workspace = true } @@ -150,9 +153,11 @@ runtime-benchmarks = [ "xcm-builder/runtime-benchmarks", "pallet-asset-registry/runtime-benchmarks", "pallet-duster/runtime-benchmarks", + "pallet-democracy/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", "pallet-utility/runtime-benchmarks", + "pallet-tips/runtime-benchmarks", "pallet-proxy/runtime-benchmarks", "pallet-multisig/runtime-benchmarks", "pallet-preimage/runtime-benchmarks", @@ -163,6 +168,7 @@ runtime-benchmarks = [ "pallet-ema-oracle/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", "cumulus-pallet-parachain-system/runtime-benchmarks", + "pallet-elections-phragmen/runtime-benchmarks", "pallet-state-trie-migration/runtime-benchmarks", "pallet-conviction-voting/runtime-benchmarks", "pallet-referenda/runtime-benchmarks", @@ -204,6 +210,7 @@ std = [ "pallet-asset-registry/std", "pallet-aura/std", "pallet-balances/std", + "pallet-elections-phragmen/std", "pallet-nft/std", "pallet-marketplace/std", "pallet-session/std", @@ -235,9 +242,11 @@ std = [ "sp-version/std", "pallet-treasury/std", "pallet-collective/std", + "pallet-democracy/std", "pallet-proxy/std", "pallet-multisig/std", "pallet-scheduler/std", + "pallet-tips/std", "pallet-collator-selection/std", "pallet-authorship/std", "pallet-uniques/std", @@ -270,6 +279,7 @@ try-runtime= [ "staging-parachain-info/try-runtime", "pallet-aura/try-runtime", "pallet-balances/try-runtime", + "pallet-elections-phragmen/try-runtime", "pallet-session/try-runtime", "pallet-timestamp/try-runtime", "pallet-transaction-payment/try-runtime", @@ -277,9 +287,11 @@ try-runtime= [ "pallet-utility/try-runtime", "pallet-treasury/try-runtime", "pallet-collective/try-runtime", + "pallet-democracy/try-runtime", "pallet-proxy/try-runtime", "pallet-multisig/try-runtime", "pallet-scheduler/try-runtime", + "pallet-tips/try-runtime", "pallet-collator-selection/try-runtime", "pallet-authorship/try-runtime", "pallet-uniques/try-runtime", diff --git a/runtime/basilisk/src/lib.rs b/runtime/basilisk/src/lib.rs index 0c5bb0c03c..15cbc50a01 100644 --- a/runtime/basilisk/src/lib.rs +++ b/runtime/basilisk/src/lib.rs @@ -270,14 +270,74 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - ( - frame_support::migrations::RemovePallet::DbWeight>, - frame_support::migrations::RemovePallet::DbWeight>, - cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4, - pallet_identity::migration::versioned::V0ToV1, // We have currently 89 identities in basllisk, so limit of 200 should be enough - ), + migrations::Migrations, >; +pub mod migrations { + use super::*; + use frame_support::traits::LockIdentifier; + use frame_system::pallet_prelude::BlockNumberFor; + + parameter_types! { + pub const DemocracyPalletName: &'static str = "Democracy"; + pub const CouncilPalletName: &'static str = "Council"; + // pub const TechnicalCommitteePalletName: &'static str = "TechnicalCommittee"; + pub const PhragmenElectionPalletName: &'static str = "PhragmenElection"; + // pub const TechnicalMembershipPalletName: &'static str = "TechnicalMembership"; + pub const TipsPalletName: &'static str = "Tips"; + pub const PhragmenElectionPalletId: LockIdentifier = *b"phrelect"; + pub const DataDepositPerByte: Balance = primitives::constants::currency::CENTS; + pub const TipReportDepositBase: Balance = 10 * primitives::constants::currency::DOLLARS; + } + + // Special Config for Gov V1 pallets, allowing us to run migrations for them without + // implementing their configs on [`Runtime`]. + pub struct UnlockConfig; + impl pallet_democracy::migrations::unlock_and_unreserve_all_funds::UnlockConfig for UnlockConfig { + type Currency = Balances; + type MaxVotes = ConstU32<100>; + type MaxDeposits = ConstU32<100>; + type AccountId = AccountId; + type BlockNumber = BlockNumberFor; + type DbWeight = ::DbWeight; + type PalletName = DemocracyPalletName; + } + impl pallet_elections_phragmen::migrations::unlock_and_unreserve_all_funds::UnlockConfig + for UnlockConfig + { + type Currency = Balances; + type MaxVotesPerVoter = ConstU32<16>; + type PalletId = PhragmenElectionPalletId; + type AccountId = AccountId; + type DbWeight = ::DbWeight; + type PalletName = PhragmenElectionPalletName; + } + impl pallet_tips::migrations::unreserve_deposits::UnlockConfig<()> for UnlockConfig { + type Currency = Balances; + type Hash = Hash; + type DataDepositPerByte = DataDepositPerByte; + type TipReportDepositBase = TipReportDepositBase; + type AccountId = AccountId; + type BlockNumber = BlockNumberFor; + type DbWeight = ::DbWeight; + type PalletName = TipsPalletName; + } + + pub type Migrations = ( + // Unlock/unreserve balances from Gov v1 pallets that hold them + // https://github.com/paritytech/polkadot/issues/6749 + pallet_elections_phragmen::migrations::unlock_and_unreserve_all_funds::UnlockAndUnreserveAllFunds, + pallet_democracy::migrations::unlock_and_unreserve_all_funds::UnlockAndUnreserveAllFunds, + pallet_tips::migrations::unreserve_deposits::UnreserveDeposits, + + // Delete storage key/values from all Gov v1 pallets + frame_support::migrations::RemovePallet::DbWeight>, + frame_support::migrations::RemovePallet::DbWeight>, + frame_support::migrations::RemovePallet::DbWeight>, + frame_support::migrations::RemovePallet::DbWeight>, + ); +} + parameter_types! { pub const DmpQueuePalletName: &'static str = "DmpQueue"; pub const XcmRateLimiterPalletName: &'static str = "XcmRateLimiter";