Skip to content
Open
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
3 changes: 0 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions relay/polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 0 additions & 3 deletions relay/polkadot/src/ah_migration/phase1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ pub fn call_allowed_status(call: &<Runtime as frame_system::Config>::RuntimeCall
Crowdloan(..) => (OFF, OFF),
Coretime(coretime::Call::<Runtime>::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),
Expand All @@ -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),
Expand Down
36 changes: 11 additions & 25 deletions relay/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<AccountId>;
type SignedFilter = frame_support::traits::NeverEnsureOrigin<AccountId>;

// Use same weights as substrate ones.
type WeightInfo = pallet_state_trie_migration::weights::SubstrateWeight<Runtime>;
type MaxKeyLen = MigrationMaxKeyLen;
}

/// The [frame_support::traits::tokens::ConversionFromAssetBalance] implementation provided by the
/// `AssetRate` pallet instance.
///
Expand Down Expand Up @@ -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,

Expand Down Expand Up @@ -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<Runtime>,);
pub type Unreleased = (
frame_support::migrations::RemovePallet<
StateTrieMigrationPalletName,
<Runtime as frame_system::Config>::DbWeight,
>,
KickOffAhm<Runtime>,
);

/// Migrations/checks that do not need to be versioned and can run on every update.
pub type Permanent = pallet_xcm::migration::MigrateToLatestXcmVersion<Runtime>;
Expand Down
4 changes: 0 additions & 4 deletions system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -202,7 +201,6 @@ pub fn call_allowed_before_migration(
Scheduler(..) |
Session(..) |
StakingRcClient(..) |
StateTrieMigration(..) |
System(..) |
Timestamp(..) |
ToPolkadotXcmRouter(..) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ impl From<pallet_rc_migrator::types::PortableHoldReason> 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),
Expand Down
56 changes: 10 additions & 46 deletions system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Instance1> = 82,
Expand Down Expand Up @@ -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,
<Runtime as frame_system::Config>::DbWeight,
>,
);

/// Migrations/checks that do not need to be versioned and can run on every update.
pub type Permanent = pallet_xcm::migration::MigrateToLatestXcmVersion<Runtime>;
Expand Down Expand Up @@ -2739,39 +2745,6 @@ cumulus_pallet_parachain_system::register_validate_block! {
BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,
}

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<IsVoiceOfBody<FellowshipLocation, FellowsBodyId>>,
EnsureSignedBy<MigControllerRoot, AccountId>,
>;
type SignedFilter = EnsureSignedBy<MigController, AccountId>;

// Replace this with weight based on your runtime.
type WeightInfo = pallet_state_trie_migration::weights::SubstrateWeight<Runtime>;

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::*;
Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -198,7 +197,6 @@ pub fn call_allowed_before_migration(
Session(..) |
SnowbridgeSystemFrontend(..) |
StakingRcClient(..) |
StateTrieMigration(..) |
System(..) |
Timestamp(..) |
ToKusamaXcmRouter(..) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ impl From<pallet_rc_migrator::types::PortableHoldReason> 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),
Expand Down
Loading
Loading