-
Notifications
You must be signed in to change notification settings - Fork 101
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
Removes already applied migrations #118
Changes from 4 commits
4056dc1
b900d75
dd23159
71a0af4
b4e8bd9
a4d1504
3334957
fb34ebc
39e40f5
3005a97
89d3471
3bf86dc
96dc830
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ use frame_support::{ | |
genesis_builder_helper::{build_config, create_default_config}, | ||
parameter_types, | ||
traits::{ | ||
fungible::HoldConsideration, ConstU32, Contains, EitherOf, EitherOfDiverse, Get, | ||
fungible::HoldConsideration, ConstU32, EitherOf, EitherOfDiverse, Get, | ||
InstanceFilter, KeyOwnerProofSystem, LinearStoragePrice, PrivilegeCmp, ProcessMessage, | ||
ProcessMessageError, WithdrawReasons, | ||
}, | ||
|
@@ -1688,51 +1688,6 @@ 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; | ||
} | ||
|
||
/// Upgrade Session keys to include BEEFY key. | ||
/// When this is removed, should also remove `OldSessionKeys`. | ||
|
@@ -1744,50 +1699,12 @@ pub mod migrations { | |
} | ||
} | ||
|
||
pub struct ParachainsToUnlock; | ||
impl Contains<ParaId> for ParachainsToUnlock { | ||
fn contains(id: &ParaId) -> bool { | ||
let id: u32 = (*id).into(); | ||
// polkadot parachains/parathreads that are locked and never produced block | ||
match id { | ||
2003 | 2015 | 2017 | 2018 | 2025 | 2028 | 2036 | 2038 | 2053 | 2055 | 2090 | | ||
2097 | 2106 | 3336 | 3338 | 3342 => true, | ||
_ => false, | ||
} | ||
} | ||
} | ||
|
||
/// Unreleased migrations. Add new ones here: | ||
pub type Unreleased = ( | ||
pallet_im_online::migration::v1::Migration<Runtime>, | ||
parachains_configuration::migration::v7::MigrateToV7<Runtime>, | ||
parachains_configuration::migration::v8::MigrateToV8<Runtime>, | ||
|
||
// Gov v1 storage migrations | ||
// 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 all Gov v1 pallet storage key/values. | ||
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>, | ||
|
||
parachains_configuration::migration::v9::MigrateToV9<Runtime>, | ||
// Migrate parachain info format | ||
paras_registrar::migration::VersionCheckedMigrateToV1<Runtime, ParachainsToUnlock>, | ||
|
||
// Upgrade SessionKeys to include BEEFY key | ||
UpgradeSessionKeys, | ||
|
||
pallet_nomination_pools::migration::versioned_migrations::V5toV6<Runtime>, | ||
pallet_nomination_pools::migration::versioned_migrations::V6ToV7<Runtime>, | ||
|
||
runtime_parachains::scheduler::migration::v1::MigrateToV1<Runtime> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure how to check if this was already run on-chain, but I see it was added here after the last release:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was added after the release, to switch back to the fixed upstream one. However, I had included the fixed upstream migration directly in this repo here: https://github.com/polkadot-fellows/runtimes/pull/26/files#diff-efa4caeb17487ecb13d8f5eb7863c3241d84afa2e73fbf25909a2ca89df0f362R1739 |
||
); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -909,11 +909,7 @@ pub type SignedExtra = ( | |
pub type UncheckedExtrinsic = | ||
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>; | ||
/// Migrations to apply on runtime upgrade. | ||
pub type Migrations = ( | ||
pallet_collator_selection::migration::v1::MigrateToV1<Runtime>, | ||
pallet_multisig::migrations::v1::MigrateToV1<Runtime>, | ||
InitStorageVersions, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe also remove (same for other system paras) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
); | ||
pub type Migrations = (); | ||
|
||
/// Migration to initialize storage versions for pallets added after genesis. | ||
/// | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there an issue to track the removal of this in the next release so we don't forget?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No we don't have an issue for this, but in the fellowship repo we can just remove always all the migrations.