Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

migration: unlock/unreserve Gov v1 balances, remove Gov V1 pallets from polkadot runtime, and remove Gov V1 pallet key/values from storage #7314

Merged
merged 39 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
d1cf215
restore old gov configs
liamaharon May 31, 2023
639ab0a
migrate old gov v1 storage
liamaharon May 31, 2023
3066df0
exclude the Call enum for gov v1 pallets
liamaharon May 31, 2023
d099689
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon Jun 2, 2023
964ac34
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon Jun 5, 2023
fc9e0a2
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon Jun 13, 2023
670f199
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon Jun 13, 2023
abf4d90
update substrate
liamaharon Jun 13, 2023
357328c
update tips pallet
liamaharon Jun 13, 2023
e2a8ff2
update chain_spec
liamaharon Jun 13, 2023
a85c346
fix migrations tuple
liamaharon Jun 14, 2023
49174b9
oliver comments
liamaharon Jun 14, 2023
b090f34
format comment
liamaharon Jun 14, 2023
187bda0
".git/.scripts/commands/fmt/fmt.sh"
Jun 14, 2023
c94588a
comments
liamaharon Jun 14, 2023
b3cbdde
Merge branch 'liam-kusama-gov-v1-storage-migration' of github.com:par…
liamaharon Jun 14, 2023
b64b92b
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon Jul 2, 2023
271666a
polkadot migrations
liamaharon Jul 2, 2023
4ec49ff
fix cargo.lock
liamaharon Jul 2, 2023
ca208cf
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon Jul 24, 2023
5dd4daa
fix compilation
liamaharon Jul 24, 2023
bff4590
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon Jul 28, 2023
4005aee
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon Aug 4, 2023
45ba24f
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon Aug 16, 2023
5e440c1
use democracy standalone migration
liamaharon Aug 16, 2023
1f3f785
re-remove gov v1 pallets from kusama
liamaharon Aug 16, 2023
6cd663b
remove unnecessary feature
liamaharon Aug 16, 2023
8fef227
fix unlock configs
liamaharon Aug 17, 2023
82d4de9
use substrate master
liamaharon Aug 17, 2023
1991ecb
Merge remote-tracking branch 'origin' into liam-kusama-gov-v1-storage…
liamaharon Aug 17, 2023
e6048d9
reset cargo.lock
liamaharon Aug 17, 2023
7473d8e
cargo update -p sp-io
liamaharon Aug 17, 2023
3a47d7a
remove from chainspec
liamaharon Aug 17, 2023
3eb21c0
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon Aug 17, 2023
2779a6e
Merge branch 'master' of github.com:paritytech/polkadot into liam-kus…
liamaharon Aug 18, 2023
25e81d4
remove polkadot gov v1 pallets
liamaharon Aug 18, 2023
8ef96a0
clean up chain spec
liamaharon Aug 18, 2023
6bf0aec
cargo fmt
liamaharon Aug 18, 2023
6baa262
remove old gov import
liamaharon Aug 18, 2023
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
8 changes: 0 additions & 8 deletions node/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1284,14 +1284,6 @@ pub fn polkadot_testnet_genesis(
slash_reward_fraction: Perbill::from_percent(10),
..Default::default()
},
phragmen_election: Default::default(),
democracy: polkadot::DemocracyConfig::default(),
council: polkadot::CouncilConfig { members: vec![], phantom: Default::default() },
technical_committee: polkadot::TechnicalCommitteeConfig {
members: vec![],
phantom: Default::default(),
},
technical_membership: Default::default(),
babe: polkadot::BabeConfig {
authorities: Default::default(),
epoch_config: Some(polkadot::BABE_GENESIS_EPOCH_CONFIG),
Expand Down
60 changes: 60 additions & 0 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1533,6 +1533,51 @@ pub type Migrations = (migrations::Unreleased,);
#[allow(deprecated, missing_docs)]
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";
}

// 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<Runtime>;
type DbWeight = <Runtime as frame_system::Config>::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 = <Runtime as frame_system::Config>::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<Runtime>;
type DbWeight = <Runtime as frame_system::Config>::DbWeight;
type PalletName = TipsPalletName;
}

/// Unreleased migrations. Add new ones here:
pub type Unreleased = (
Expand All @@ -1546,6 +1591,21 @@ pub mod migrations {
parachains_configuration::migration::v7::MigrateToV7<Runtime>,
parachains_scheduler::migration::v1::MigrateToV1<Runtime>,
parachains_configuration::migration::v8::MigrateToV8<Runtime>,

liamaharon marked this conversation as resolved.
Show resolved Hide resolved
// 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<UnlockConfig>,
pallet_democracy::migrations::unlock_and_unreserve_all_funds::UnlockAndUnreserveAllFunds<UnlockConfig>,
pallet_tips::migrations::unreserve_deposits::UnreserveDeposits<UnlockConfig, ()>,

// Delete storage key/values from all Gov v1 pallets
frame_support::migrations::RemovePallet<DemocracyPalletName, <Runtime as frame_system::Config>::DbWeight>,
frame_support::migrations::RemovePallet<CouncilPalletName, <Runtime as frame_system::Config>::DbWeight>,
frame_support::migrations::RemovePallet<TechnicalCommitteePalletName, <Runtime as frame_system::Config>::DbWeight>,
frame_support::migrations::RemovePallet<PhragmenElectionPalletName, <Runtime as frame_system::Config>::DbWeight>,
frame_support::migrations::RemovePallet<TechnicalMembershipPalletName, <Runtime as frame_system::Config>::DbWeight>,
frame_support::migrations::RemovePallet<TipsPalletName, <Runtime as frame_system::Config>::DbWeight>,

);
}

Expand Down
3 changes: 0 additions & 3 deletions runtime/polkadot/src/governance/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ use frame_system::EnsureRootWithSuccess;
use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
use xcm::latest::BodyId;

// Old governance configurations.
pub mod old;

mod origins;
pub use origins::{
pallet_custom_origins, AuctionAdmin, FellowshipAdmin, GeneralAdmin, LeaseAdmin,
Expand Down
191 changes: 0 additions & 191 deletions runtime/polkadot/src/governance/old.rs

This file was deleted.

Loading