Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
1 change: 0 additions & 1 deletion Cargo.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ pallet-staking = { workspace = true }
pallet-staking-async = { workspace = true }
pallet-staking-async-rc-client = { workspace = true }
pallet-staking-runtime-api = { workspace = true }
pallet-state-trie-migration = { workspace = true }
pallet-sudo = { workspace = true }
pallet-timestamp = { workspace = true }
pallet-transaction-payment = { workspace = true }
Expand Down Expand Up @@ -194,7 +193,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-sudo/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
"pallet-transaction-payment/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-sudo/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
Expand Down Expand Up @@ -352,7 +349,6 @@ std = [
"pallet-staking-async/std",
"pallet-staking-runtime-api/std",
"pallet-staking/std",
"pallet-state-trie-migration/std",
"pallet-sudo/std",
"pallet-timestamp/std",
"pallet-transaction-payment-rpc-runtime-api/std",
Expand Down
49 changes: 6 additions & 43 deletions cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,7 @@ impl pallet_revive::Config for Runtime {
parameter_types! {
pub MbmServiceWeight: Weight = Perbill::from_percent(80) * RuntimeBlockWeights::get().max_block;
pub FastUnstakeName: &'static str = "FastUnstake";
pub StateTrieMigrationName: &'static str = "StateTrieMigration";
}

impl pallet_migrations::Config for Runtime {
Expand Down Expand Up @@ -1373,8 +1374,6 @@ construct_runtime!(

AssetRewards: pallet_asset_rewards = 61,

StateTrieMigration: pallet_state_trie_migration = 70,

// Staking.
Staking: pallet_staking_async = 80,
NominationPools: pallet_nomination_pools = 81,
Expand Down Expand Up @@ -1492,6 +1491,11 @@ pub type Migrations = (
FastUnstakeName,
<Runtime as frame_system::Config>::DbWeight,
>,
// Remove StateTrieMigration pallet - migration complete
frame_support::migrations::RemovePallet<
StateTrieMigrationName,
<Runtime as frame_system::Config>::DbWeight,
>,
// permanent
pallet_xcm::migration::MigrateToLatestXcmVersion<Runtime>,
cumulus_pallet_aura_ext::migration::MigrateV0ToV1<Runtime>,
Expand Down Expand Up @@ -2661,47 +2665,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 Root, or a part of your council.
type ControlOrigin = frame_system::EnsureSignedBy<RootMigController, AccountId>;
// specific account for the migration, can trigger the signed migrations.
type SignedFilter = frame_system::EnsureSignedBy<MigController, AccountId>;

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

type MaxKeyLen = MigrationMaxKeyLen;
}

frame_support::ord_parameter_types! {
pub const MigController: AccountId = AccountId::from(hex_literal::hex!("8458ed39dc4b6f6c7255f7bc42be50c2967db126357c999d44e12ca7ac80dc52"));
pub const RootMigController: AccountId = AccountId::from(hex_literal::hex!("8458ed39dc4b6f6c7255f7bc42be50c2967db126357c999d44e12ca7ac80dc52"));
}

#[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]);
let acc =
AccountId::from_ss58check("5F4EbSkZz18X36xhbsjvDNs6NuZ82HyYtq5UiJ1h9SBHJXZD").unwrap();
assert_eq!(acc, RootMigController::sorted_members()[0]);
}

#[test]
fn ensure_epmb_weights_sane() {
use sp_io::TestExternalities;
Expand Down
23 changes: 23 additions & 0 deletions prdoc/pr_10694.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json

title: "[Westend] Remove StateTrieMigration pallet - V0→V1 migration complete"

doc:
- audience: Runtime Dev
description: |
Removes the `pallet-state-trie-migration` from Westend Asset Hub runtime.

The V0 to V1 state trie format migration has completed successfully on Westend Asset Hub,
with 2,082,626 top keys and 28,095 child keys migrated. The pallet is no longer needed
and its storage will be cleaned up via RemovePallet migration.

This change:
- Removes pallet-state-trie-migration dependency from Cargo.toml
- Removes the pallet's Config implementation and parameter_types
- Removes the pallet from construct_runtime! macro
- Adds RemovePallet migration to clean up orphaned storage

crates:
- name: asset-hub-westend-runtime
bump: major
Loading