Skip to content

Commit b1d55c6

Browse files
committed
clean state_trie_migration from westend
1 parent 139aff1 commit b1d55c6

2 files changed

Lines changed: 0 additions & 64 deletions

File tree

runtime/westend/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ pallet-session = { git = "https://github.com/paritytech/substrate", branch = "ma
6565
pallet-society = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
6666
pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
6767
pallet-staking-reward-curve = { package = "pallet-staking-reward-curve", git = "https://github.com/paritytech/substrate", branch = "master" }
68-
pallet-state-trie-migration = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
6968
pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
7069
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
7170
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -99,7 +98,6 @@ xcm-builder = { package = "xcm-builder", path = "../../xcm/xcm-builder", default
9998
hex-literal = "0.3.4"
10099
tiny-keccak = { version = "2.0.2", features = ["keccak"] }
101100
keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate", branch = "master" }
102-
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" }
103101
serde_json = "1.0.81"
104102
remote-externalities = { git = "https://github.com/paritytech/substrate", branch = "master", package = "frame-remote-externalities" }
105103
tokio = { version = "1.24.2", features = ["macros"] }
@@ -156,7 +154,6 @@ std = [
156154
"pallet-session/std",
157155
"pallet-society/std",
158156
"pallet-staking/std",
159-
"pallet-state-trie-migration/std",
160157
"pallet-sudo/std",
161158
"pallet-timestamp/std",
162159
"pallet-treasury/std",
@@ -257,7 +254,6 @@ try-runtime = [
257254
"pallet-session/try-runtime",
258255
"pallet-society/try-runtime",
259256
"pallet-staking/try-runtime",
260-
"pallet-state-trie-migration/try-runtime",
261257
"pallet-sudo/try-runtime",
262258
"pallet-timestamp/try-runtime",
263259
"pallet-treasury/try-runtime",

runtime/westend/src/lib.rs

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,19 +1097,6 @@ parameter_types! {
10971097
pub const MigrationMaxKeyLen: u32 = 512;
10981098
}
10991099

1100-
impl pallet_state_trie_migration::Config for Runtime {
1101-
type RuntimeEvent = RuntimeEvent;
1102-
type Currency = Balances;
1103-
type SignedDepositPerItem = MigrationSignedDepositPerItem;
1104-
type SignedDepositBase = MigrationSignedDepositBase;
1105-
type ControlOrigin = EnsureRoot<AccountId>;
1106-
type SignedFilter = frame_support::traits::NeverEnsureOrigin<AccountId>;
1107-
1108-
// Use same weights as substrate ones.
1109-
type WeightInfo = pallet_state_trie_migration::weights::SubstrateWeight<Runtime>;
1110-
type MaxKeyLen = MigrationMaxKeyLen;
1111-
}
1112-
11131100
construct_runtime! {
11141101
pub enum Runtime where
11151102
Block = Block,
@@ -1178,9 +1165,6 @@ construct_runtime! {
11781165
// Fast unstake pallet: extension to staking.
11791166
FastUnstake: pallet_fast_unstake = 30,
11801167

1181-
// State trie migration pallet, only temporary.
1182-
StateTrieMigration: pallet_state_trie_migration = 35,
1183-
11841168
// Parachains pallets. Start indices at 40 to leave room.
11851169
ParachainsOrigin: parachains_origin::{Pallet, Origin} = 41,
11861170
Configuration: parachains_configuration::{Pallet, Call, Storage, Config<T>} = 42,
@@ -1243,7 +1227,6 @@ impl Get<&'static str> for StakingMigrationV11OldPallet {
12431227
///
12441228
/// Should be cleared after every release.
12451229
pub type Migrations = (
1246-
init_state_migration::InitMigrate,
12471230
// "Use 2D weights in XCM v3" <https://github.com/paritytech/polkadot/pull/6134>
12481231
pallet_xcm::migration::v1::MigrateToV1<Runtime>,
12491232
parachains_ump::migration::v1::MigrateToV1<Runtime>,
@@ -1907,46 +1890,3 @@ mod remote_tests {
19071890
ext.execute_with(|| Runtime::on_runtime_upgrade(UpgradeCheckSelect::PreAndPost));
19081891
}
19091892
}
1910-
1911-
mod init_state_migration {
1912-
use super::Runtime;
1913-
use frame_support::traits::OnRuntimeUpgrade;
1914-
use pallet_state_trie_migration::{AutoLimits, MigrationLimits, MigrationProcess};
1915-
#[cfg(not(feature = "std"))]
1916-
use sp_std::prelude::*;
1917-
1918-
/// Initialize an automatic migration process.
1919-
pub struct InitMigrate;
1920-
impl OnRuntimeUpgrade for InitMigrate {
1921-
#[cfg(feature = "try-runtime")]
1922-
fn pre_upgrade() -> Result<Vec<u8>, &'static str> {
1923-
frame_support::ensure!(
1924-
AutoLimits::<Runtime>::get().is_none(),
1925-
"Automigration already started."
1926-
);
1927-
Ok(Default::default())
1928-
}
1929-
1930-
fn on_runtime_upgrade() -> frame_support::weights::Weight {
1931-
if MigrationProcess::<Runtime>::get() == Default::default() &&
1932-
AutoLimits::<Runtime>::get().is_none()
1933-
{
1934-
AutoLimits::<Runtime>::put(Some(MigrationLimits { item: 160, size: 204800 }));
1935-
log::info!("Automatic trie migration started.");
1936-
<Runtime as frame_system::Config>::DbWeight::get().reads_writes(2, 1)
1937-
} else {
1938-
log::info!("Automatic trie migration not started.");
1939-
<Runtime as frame_system::Config>::DbWeight::get().reads(2)
1940-
}
1941-
}
1942-
1943-
#[cfg(feature = "try-runtime")]
1944-
fn post_upgrade(_state: Vec<u8>) -> Result<(), &'static str> {
1945-
frame_support::ensure!(
1946-
AutoLimits::<Runtime>::get().is_some(),
1947-
"Automigration started."
1948-
);
1949-
Ok(())
1950-
}
1951-
}
1952-
}

0 commit comments

Comments
 (0)