diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dcbc7fcab..855d34dfab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -350,6 +350,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [1.4.3] 14.04.2025 +### Removed + +- Remove StateTrieMigration pallet from Polkadot relay chain, Asset Hub Polkadot, and Asset Hub Kusama - V0→V1 state trie migration complete ([polkadot-fellows/runtimes#1040](https://github.com/polkadot-fellows/runtimes/pull/1040)) + ### Changed - Apply patch for stable2409-6 ([polkadot-fellows/runtimes/pull/623](https://github.com/polkadot-fellows/runtimes/pull/623)) diff --git a/Cargo.lock b/Cargo.lock index 79a29b4a7d..3cffb78047 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1118,7 +1118,6 @@ dependencies = [ "pallet-staking-async", "pallet-staking-async-rc-client", "pallet-staking-runtime-api", - "pallet-state-trie-migration", "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", @@ -1288,7 +1287,6 @@ dependencies = [ "pallet-staking-async", "pallet-staking-async-rc-client", "pallet-staking-runtime-api", - "pallet-state-trie-migration", "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", @@ -11672,7 +11670,6 @@ dependencies = [ "pallet-staking-reward-curve", "pallet-staking-reward-fn", "pallet-staking-runtime-api", - "pallet-state-trie-migration", "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", diff --git a/relay/polkadot/Cargo.toml b/relay/polkadot/Cargo.toml index 7a9cb4b19f..c1772c4b41 100644 --- a/relay/polkadot/Cargo.toml +++ b/relay/polkadot/Cargo.toml @@ -78,7 +78,6 @@ pallet-staking = { workspace = true } pallet-staking-reward-fn = { workspace = true } pallet-staking-reward-curve = { workspace = true } pallet-staking-runtime-api = { workspace = true } -pallet-state-trie-migration = { workspace = true } frame-system = { workspace = true } frame-system-rpc-runtime-api = { workspace = true } polkadot-runtime-constants = { workspace = true } @@ -191,7 +190,6 @@ std = [ "pallet-staking-reward-fn/std", "pallet-staking-runtime-api/std", "pallet-staking/std", - "pallet-state-trie-migration/std", "pallet-timestamp/std", "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", @@ -272,7 +270,6 @@ runtime-benchmarks = [ "pallet-staking-async-ah-client/runtime-benchmarks", "pallet-staking-async-rc-client/runtime-benchmarks", "pallet-staking/runtime-benchmarks", - "pallet-state-trie-migration/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-transaction-payment/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", @@ -333,7 +330,6 @@ try-runtime = [ "pallet-staking-async-ah-client/try-runtime", "pallet-staking-async-rc-client/try-runtime", "pallet-staking/try-runtime", - "pallet-state-trie-migration/try-runtime", "pallet-timestamp/try-runtime", "pallet-transaction-payment/try-runtime", "pallet-treasury/try-runtime", diff --git a/relay/polkadot/src/ah_migration/phase1.rs b/relay/polkadot/src/ah_migration/phase1.rs index 88be8113a9..5733367ef4 100644 --- a/relay/polkadot/src/ah_migration/phase1.rs +++ b/relay/polkadot/src/ah_migration/phase1.rs @@ -134,7 +134,6 @@ pub fn call_allowed_status(call: &::RuntimeCall Crowdloan(..) => (OFF, OFF), Coretime(coretime::Call::::request_revenue_at { .. }) => (OFF, ON), Coretime(..) => (ON, ON), // Only permissioned calls. - StateTrieMigration(..) => (OFF, OFF), // Deprecated XcmPallet(..) => (ON, ON), // during migration can only send XCMs to other MessageQueue(..) => (ON, ON), // contains non-permissioned service calls AssetRate(..) => (OFF, OFF), @@ -153,8 +152,6 @@ impl pallet_rc_migrator::types::IntoPortable for RuntimeHoldReason { match self { RuntimeHoldReason::Preimage(inner) => PortableHoldReason::Preimage(inner), - RuntimeHoldReason::StateTrieMigration(inner) => - PortableHoldReason::StateTrieMigration(inner), RuntimeHoldReason::DelegatedStaking(inner) => PortableHoldReason::DelegatedStaking(inner), RuntimeHoldReason::Staking(inner) => PortableHoldReason::Staking(inner), diff --git a/relay/polkadot/src/lib.rs b/relay/polkadot/src/lib.rs index 4948695cfb..027930109d 100644 --- a/relay/polkadot/src/lib.rs +++ b/relay/polkadot/src/lib.rs @@ -1666,27 +1666,6 @@ impl ah_client::SendToAssetHub for StakingXcmToAssetHub { } } -parameter_types! { - // The deposit configuration for the singed migration. Specially if you want to allow any signed account to do the migration (see `SignedFilter`, these deposits should be high) - pub const MigrationSignedDepositPerItem: Balance = CENTS; - pub const MigrationSignedDepositBase: Balance = 20 * CENTS * 100; - pub const MigrationMaxKeyLen: u32 = 512; -} - -impl pallet_state_trie_migration::Config for Runtime { - type RuntimeHoldReason = RuntimeHoldReason; - type RuntimeEvent = RuntimeEvent; - type Currency = Balances; - type SignedDepositPerItem = MigrationSignedDepositPerItem; - type SignedDepositBase = MigrationSignedDepositBase; - type ControlOrigin = EnsureRoot; - type SignedFilter = frame_support::traits::NeverEnsureOrigin; - - // Use same weights as substrate ones. - type WeightInfo = pallet_state_trie_migration::weights::SubstrateWeight; - type MaxKeyLen = MigrationMaxKeyLen; -} - /// The [frame_support::traits::tokens::ConversionFromAssetBalance] implementation provided by the /// `AssetRate` pallet instance. /// @@ -1870,9 +1849,6 @@ construct_runtime! { Crowdloan: crowdloan = 73, Coretime: coretime = 74, - // State trie migration pallet, only temporary. - StateTrieMigration: pallet_state_trie_migration = 98, - // Pallet for sending XCM. XcmPallet: pallet_xcm = 99, @@ -1936,8 +1912,18 @@ pub mod migrations { use frame_support::traits::OnRuntimeUpgrade; use pallet_rc_migrator::{MigrationStage, MigrationStartBlock, RcMigrationStage}; + parameter_types! { + pub const StateTrieMigrationPalletName: &'static str = "StateTrieMigration"; + } + /// Unreleased migrations. Add new ones here: - pub type Unreleased = (KickOffAhm,); + pub type Unreleased = ( + frame_support::migrations::RemovePallet< + StateTrieMigrationPalletName, + ::DbWeight, + >, + KickOffAhm, + ); /// Migrations/checks that do not need to be versioned and can run on every update. pub type Permanent = pallet_xcm::migration::MigrateToLatestXcmVersion; diff --git a/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml b/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml index a07714c5e9..e8603bb604 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml @@ -75,7 +75,6 @@ pallet-election-provider-multi-block = { workspace = true } pallet-session = { workspace = true } pallet-staking = { workspace = true } pallet-staking-runtime-api = { workspace = true } -pallet-state-trie-migration = { workspace = true } pallet-nomination-pools-runtime-api = { workspace = true } pallet-timestamp = { workspace = true } pallet-transaction-payment = { workspace = true } @@ -205,7 +204,6 @@ runtime-benchmarks = [ "pallet-staking-async-rc-client/runtime-benchmarks", "pallet-staking-async/runtime-benchmarks", "pallet-staking/runtime-benchmarks", - "pallet-state-trie-migration/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-transaction-payment/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", @@ -280,7 +278,6 @@ try-runtime = [ "pallet-staking-async-rc-client/try-runtime", "pallet-staking-async/try-runtime", "pallet-staking/try-runtime", - "pallet-state-trie-migration/try-runtime", "pallet-timestamp/try-runtime", "pallet-transaction-payment/try-runtime", "pallet-treasury/try-runtime", @@ -366,7 +363,6 @@ std = [ "pallet-staking-async/std", "pallet-staking-runtime-api/std", "pallet-staking/std", - "pallet-state-trie-migration/std", "pallet-timestamp/std", "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/ah_migration/call_filter.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/ah_migration/call_filter.rs index 35ba2fab5b..29942caa19 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/ah_migration/call_filter.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/ah_migration/call_filter.rs @@ -122,7 +122,6 @@ pub fn call_allowed_status( Session(..) => OFF, Staking(..) => OFF, StakingRcClient(..) => ON, // Keep on for incoming RC calls over XCM - StateTrieMigration(..) => OFF, // Deprecated System(..) => ON, // remark plus root calls Timestamp(..) => ON, // only `set` inherit ToPolkadotXcmRouter(..) => ON, // Allow to report bridge congestion @@ -202,7 +201,6 @@ pub fn call_allowed_before_migration( Scheduler(..) | Session(..) | StakingRcClient(..) | - StateTrieMigration(..) | System(..) | Timestamp(..) | ToPolkadotXcmRouter(..) | diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/ah_migration/mod.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/ah_migration/mod.rs index 339794570f..4fd335fae0 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/ah_migration/mod.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/ah_migration/mod.rs @@ -38,8 +38,8 @@ impl From for RuntimeHoldReason { pallet_staking::HoldReason::Staking => Staking(pallet_staking_async::HoldReason::Staking), }, - PortableHoldReason::StateTrieMigration(state_trie_migration) => - StateTrieMigration(state_trie_migration), + PortableHoldReason::StateTrieMigration(_) => + unreachable!("StateTrieMigration pallet removed - no holds should exist"), PortableHoldReason::DelegatedStaking(delegated_staking) => DelegatedStaking(delegated_staking), PortableHoldReason::Session(session) => Session(session), diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs index 938449f010..f3ee2dd8ad 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs @@ -1638,9 +1638,6 @@ construct_runtime!( Revive: pallet_revive = 60, - // State trie migration pallet, only temporary. - StateTrieMigration: pallet_state_trie_migration = 70, - // Staking in the 80s NominationPools: pallet_nomination_pools = 80, VoterList: pallet_bags_list:: = 82, @@ -1727,8 +1724,17 @@ pub type UncheckedExtrinsic = pub mod migrations { use super::*; + parameter_types! { + pub const StateTrieMigrationPalletName: &'static str = "StateTrieMigration"; + } + /// Unreleased migrations. Add new ones here: - pub type Unreleased = (); + pub type Unreleased = ( + frame_support::migrations::RemovePallet< + StateTrieMigrationPalletName, + ::DbWeight, + >, + ); /// Migrations/checks that do not need to be versioned and can run on every update. pub type Permanent = pallet_xcm::migration::MigrateToLatestXcmVersion; @@ -2739,39 +2745,6 @@ cumulus_pallet_parachain_system::register_validate_block! { BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, } -parameter_types! { - // The deposit configuration for the singed migration. Specially if you want to allow any signed account to do the migration (see `SignedFilter`, these deposits should be high) - pub const MigrationSignedDepositPerItem: Balance = CENTS; - pub const MigrationSignedDepositBase: Balance = 2_000 * CENTS; - pub const MigrationMaxKeyLen: u32 = 512; -} - -impl pallet_state_trie_migration::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Currency = Balances; - type RuntimeHoldReason = RuntimeHoldReason; - type SignedDepositPerItem = MigrationSignedDepositPerItem; - type SignedDepositBase = MigrationSignedDepositBase; - // An origin that can control the whole pallet: Should be a Fellowship member or the controller - // of the migration. - type ControlOrigin = EitherOfDiverse< - EnsureXcm>, - EnsureSignedBy, - >; - type SignedFilter = EnsureSignedBy; - - // Replace this with weight based on your runtime. - type WeightInfo = pallet_state_trie_migration::weights::SubstrateWeight; - - type MaxKeyLen = MigrationMaxKeyLen; -} -// Statemint State Migration Controller account controlled by parity.io. Can trigger migration. -// See bot code https://github.com/paritytech/polkadot-scripts/blob/master/src/services/state_trie_migration.ts -ord_parameter_types! { - pub const MigController: AccountId = AccountId::from(hex_literal::hex!("8458ed39dc4b6f6c7255f7bc42be50c2967db126357c999d44e12ca7ac80dc52")); - pub const MigControllerRoot: AccountId = AccountId::from(hex_literal::hex!("8458ed39dc4b6f6c7255f7bc42be50c2967db126357c999d44e12ca7ac80dc52")); -} - #[cfg(test)] mod tests { use super::*; @@ -2846,15 +2819,6 @@ mod tests { ); } - #[test] - fn ensure_key_ss58() { - use frame_support::traits::SortedMembers; - use sp_core::crypto::Ss58Codec; - let acc = - AccountId::from_ss58check("5F4EbSkZz18X36xhbsjvDNs6NuZ82HyYtq5UiJ1h9SBHJXZD").unwrap(); - assert_eq!(acc, MigController::sorted_members()[0]); - } - #[test] fn proxy_type_is_superset_works() { // Assets IS supertype of AssetOwner and AssetManager diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml b/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml index 54bff9245f..6437c93c5c 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml @@ -69,7 +69,6 @@ pallet-election-provider-multi-block = { workspace = true } pallet-session = { workspace = true } pallet-staking = { workspace = true } pallet-staking-runtime-api = { workspace = true } -pallet-state-trie-migration = { workspace = true } pallet-nomination-pools-runtime-api = { workspace = true } pallet-timestamp = { workspace = true } pallet-transaction-payment = { workspace = true } @@ -199,7 +198,6 @@ runtime-benchmarks = [ "pallet-staking-async-rc-client/runtime-benchmarks", "pallet-staking-async/runtime-benchmarks", "pallet-staking/runtime-benchmarks", - "pallet-state-trie-migration/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-transaction-payment/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", @@ -268,7 +266,6 @@ try-runtime = [ "pallet-staking-async-rc-client/try-runtime", "pallet-staking-async/try-runtime", "pallet-staking/try-runtime", - "pallet-state-trie-migration/try-runtime", "pallet-timestamp/try-runtime", "pallet-transaction-payment/try-runtime", "pallet-treasury/try-runtime", @@ -349,7 +346,6 @@ std = [ "pallet-staking-async/std", "pallet-staking-runtime-api/std", "pallet-staking/std", - "pallet-state-trie-migration/std", "pallet-timestamp/std", "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/ah_migration/call_filter.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/ah_migration/call_filter.rs index 6c91f77d3f..186978899a 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/ah_migration/call_filter.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/ah_migration/call_filter.rs @@ -125,11 +125,10 @@ pub fn call_allowed_status( }) => ON, // Only root SnowbridgeSystemFrontend(..) => OFF, Staking(..) => OFF, - StakingRcClient(..) => ON, // Keep on for incoming RC calls over XCM - StateTrieMigration(..) => OFF, // Deprecated - System(..) => ON, // remark plus root calls - Timestamp(..) => ON, // only `set` inherit - ToKusamaXcmRouter(..) => ON, // Allow to report bridge congestion + StakingRcClient(..) => ON, // Keep on for incoming RC calls over XCM + System(..) => ON, // remark plus root calls + Timestamp(..) => ON, // only `set` inherit + ToKusamaXcmRouter(..) => ON, // Allow to report bridge congestion Treasury(..) => OFF, Uniques(..) => OFF, Utility(..) => ON, // batching etc, just convenience @@ -198,7 +197,6 @@ pub fn call_allowed_before_migration( Session(..) | SnowbridgeSystemFrontend(..) | StakingRcClient(..) | - StateTrieMigration(..) | System(..) | Timestamp(..) | ToKusamaXcmRouter(..) | diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/ah_migration/mod.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/ah_migration/mod.rs index 2d7b3061a2..0ed0b6c7db 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/ah_migration/mod.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/ah_migration/mod.rs @@ -39,8 +39,8 @@ impl From for RuntimeHoldReason { pallet_staking::HoldReason::Staking => Staking(pallet_staking_async::HoldReason::Staking), }, - PortableHoldReason::StateTrieMigration(state_trie_migration) => - StateTrieMigration(state_trie_migration), + PortableHoldReason::StateTrieMigration(_) => + unreachable!("StateTrieMigration pallet removed - no holds should exist"), PortableHoldReason::DelegatedStaking(delegated_staking) => DelegatedStaking(delegated_staking), PortableHoldReason::Session(session) => Session(session), diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs index fefd44a6ab..3633713f70 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs @@ -1417,9 +1417,6 @@ construct_runtime!( ChildBounties: pallet_child_bounties = 66, AssetRate: pallet_asset_rate = 67, - // State trie migration pallet, only temporary. - StateTrieMigration: pallet_state_trie_migration = 70, - // Staking in the 80s NominationPools: pallet_nomination_pools = 80, VoterList: pallet_bags_list:: = 82, @@ -1466,8 +1463,17 @@ pub type UncheckedExtrinsic = pub mod migrations { use super::*; + parameter_types! { + pub const StateTrieMigrationPalletName: &'static str = "StateTrieMigration"; + } + /// Unreleased migrations. Add new ones here: - pub type Unreleased = (); + pub type Unreleased = ( + frame_support::migrations::RemovePallet< + StateTrieMigrationPalletName, + ::DbWeight, + >, + ); /// Migrations/checks that do not need to be versioned and can run on every update. pub type Permanent = pallet_xcm::migration::MigrateToLatestXcmVersion; @@ -2488,39 +2494,6 @@ cumulus_pallet_parachain_system::register_validate_block! { BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, } -parameter_types! { - // The deposit configuration for the singed migration. Specially if you want to allow any signed account to do the migration (see `SignedFilter`, these deposits should be high) - pub const MigrationSignedDepositPerItem: Balance = CENTS; - pub const MigrationSignedDepositBase: Balance = 2_000 * CENTS; - pub const MigrationMaxKeyLen: u32 = 512; -} - -impl pallet_state_trie_migration::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Currency = Balances; - type RuntimeHoldReason = RuntimeHoldReason; - type SignedDepositPerItem = MigrationSignedDepositPerItem; - type SignedDepositBase = MigrationSignedDepositBase; - // An origin that can control the whole pallet: Should be a Fellowship member or the controller - // of the migration. - type ControlOrigin = EitherOfDiverse< - EnsureXcm>, - EnsureSignedBy, - >; - type SignedFilter = EnsureSignedBy; - - // Replace this with weight based on your runtime. - type WeightInfo = pallet_state_trie_migration::weights::SubstrateWeight; - - type MaxKeyLen = MigrationMaxKeyLen; -} -// Statemint State Migration Controller account controlled by parity.io. Can trigger migration. -// See bot code https://github.com/paritytech/polkadot-scripts/blob/master/src/services/state_trie_migration.ts -ord_parameter_types! { - pub const MigController: AccountId = AccountId::from(hex_literal::hex!("8458ed39dc4b6f6c7255f7bc42be50c2967db126357c999d44e12ca7ac80dc52")); - pub const MigControllerRoot: AccountId = AccountId::from(hex_literal::hex!("8458ed39dc4b6f6c7255f7bc42be50c2967db126357c999d44e12ca7ac80dc52")); -} - #[cfg(test)] mod tests { use super::*; @@ -2595,15 +2568,6 @@ mod tests { ); } - #[test] - fn ensure_key_ss58() { - use frame_support::traits::SortedMembers; - use sp_core::crypto::Ss58Codec; - let acc = - AccountId::from_ss58check("5F4EbSkZz18X36xhbsjvDNs6NuZ82HyYtq5UiJ1h9SBHJXZD").unwrap(); - assert_eq!(acc, MigController::sorted_members()[0]); - } - #[test] fn proxy_type_is_superset_works() { // Assets IS supertype of AssetOwner and AssetManager