difftreelog
feat use state_version = 1
in: master
10 files changed
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5892,6 +5892,7 @@
"pallet-preimage",
"pallet-refungible",
"pallet-session",
+ "pallet-state-trie-migration",
"pallet-structure",
"pallet-sudo",
"pallet-template-transaction-payment",
@@ -9395,6 +9396,7 @@
"pallet-preimage",
"pallet-refungible",
"pallet-session",
+ "pallet-state-trie-migration",
"pallet-structure",
"pallet-sudo",
"pallet-template-transaction-payment",
@@ -13812,6 +13814,7 @@
"pallet-preimage",
"pallet-refungible",
"pallet-session",
+ "pallet-state-trie-migration",
"pallet-structure",
"pallet-sudo",
"pallet-template-transaction-payment",
Cargo.tomldiffbeforeafterboth--- a/Cargo.toml
+++ b/Cargo.toml
@@ -107,6 +107,7 @@
pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" }
pallet-preimage = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" }
pallet-session = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" }
+pallet-state-trie-migration = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" }
pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" }
pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" }
pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" }
runtime/common/config/substrate.rsdiffbeforeafterboth--- a/runtime/common/config/substrate.rs
+++ b/runtime/common/config/substrate.rs
@@ -31,7 +31,7 @@
use sp_arithmetic::traits::One;
use frame_system::{
limits::{BlockLength, BlockWeights},
- EnsureRoot,
+ EnsureRoot, EnsureNever,
};
use pallet_transaction_payment::{Multiplier, ConstFeeMultiplier};
use crate::{
@@ -116,6 +116,22 @@
}
parameter_types! {
+ pub const MigrationMaxKeyLen: u32 = 512;
+}
+
+impl pallet_state_trie_migration::Config for Runtime {
+ type WeightInfo = pallet_state_trie_migration::weights::SubstrateWeight<Self>;
+ type RuntimeEvent = RuntimeEvent;
+ type Currency = Balances;
+ type SignedDepositPerItem = ();
+ type SignedDepositBase = ();
+ type ControlOrigin = EnsureRoot<AccountId>;
+ // Only root can perform this migration
+ type SignedFilter = EnsureNever<AccountId>;
+ type MaxKeyLen = MigrationMaxKeyLen;
+}
+
+parameter_types! {
pub const MinimumPeriod: u64 = SLOT_DURATION / 2;
}
runtime/common/construct_runtime.rsdiffbeforeafterboth--- a/runtime/common/construct_runtime.rs
+++ b/runtime/common/construct_runtime.rs
@@ -25,6 +25,7 @@
UncheckedExtrinsic = UncheckedExtrinsic
{
System: frame_system = 0,
+ StateTrieMigration: pallet_state_trie_migration = 1,
ParachainSystem: cumulus_pallet_parachain_system = 20,
ParachainInfo: parachain_info = 21,
runtime/opal/Cargo.tomldiffbeforeafterboth--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -73,6 +73,7 @@
"pallet-authorship/std",
"pallet-preimage/std",
"pallet-session/std",
+ "pallet-state-trie-migration/std",
"sp-consensus-aura/std",
'app-promotion-rpc/std',
'evm-coder/std',
@@ -225,6 +226,7 @@
pallet-balances = { features = ["insecure_zero_ed"], workspace = true }
pallet-preimage = { workspace = true }
pallet-session = { workspace = true }
+pallet-state-trie-migration = { workspace = true }
pallet-sudo = { workspace = true }
pallet-timestamp = { workspace = true }
pallet-transaction-payment = { workspace = true }
runtime/opal/src/lib.rsdiffbeforeafterboth--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -56,7 +56,7 @@
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 3,
- state_version: 0,
+ state_version: 1,
};
parameter_types! {
runtime/quartz/Cargo.tomldiffbeforeafterboth--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -75,6 +75,7 @@
"pallet-identity/std",
"pallet-preimage/std",
"pallet-session/std",
+ "pallet-state-trie-migration/std",
"sp-consensus-aura/std",
'app-promotion-rpc/std',
'evm-coder/std',
@@ -217,6 +218,7 @@
pallet-balances = { features = ["insecure_zero_ed"], workspace = true }
pallet-preimage = { workspace = true }
pallet-session = { workspace = true }
+pallet-state-trie-migration = { workspace = true }
pallet-sudo = { workspace = true }
pallet-timestamp = { workspace = true }
pallet-transaction-payment = { workspace = true }
runtime/quartz/src/lib.rsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617//! The Substrate Node Template runtime. This can be compiled with `#[no_std]`, ready for Wasm.1819#![cfg_attr(not(feature = "std"), no_std)]20// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.21#![recursion_limit = "1024"]22#![allow(clippy::from_over_into, clippy::identity_op)]23#![allow(clippy::fn_to_numeric_cast_with_truncation)]24// Make the WASM binary available.25#[cfg(feature = "std")]26include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));2728extern crate alloc;2930use frame_support::parameter_types;3132use sp_version::RuntimeVersion;33use sp_runtime::create_runtime_str;3435use up_common::types::*;3637use ::xcm::latest::NetworkId;3839#[path = "../../common/mod.rs"]40mod runtime_common;4142pub mod xcm_barrier;4344pub use runtime_common::*;4546#[cfg(feature = "become-sapphire")]47pub const RUNTIME_NAME: &str = "sapphire";48#[cfg(not(feature = "become-sapphire"))]49pub const RUNTIME_NAME: &str = "quartz";50pub const TOKEN_SYMBOL: &str = "QTZ";51pub const DECIMALS: u8 = 18;5253/// This runtime version.54pub const VERSION: RuntimeVersion = RuntimeVersion {55 spec_name: create_runtime_str!(RUNTIME_NAME),56 impl_name: create_runtime_str!(RUNTIME_NAME),57 authoring_version: 1,58 spec_version: 941055,59 impl_version: 0,60 apis: RUNTIME_API_VERSIONS,61 transaction_version: 3,62 state_version: 0,63};6465parameter_types! {66 pub const Version: RuntimeVersion = VERSION;67 pub const RelayNetwork: NetworkId = NetworkId::Kusama;68}69#[cfg(feature = "become-sapphire")]70parameter_types! {71 pub const SS58Prefix: u16 = 8883;72 pub const ChainId: u64 = 8883;73}7475#[cfg(not(feature = "become-sapphire"))]76parameter_types! {77 pub const SS58Prefix: u8 = 255;78 pub const ChainId: u64 = 8881;79}8081construct_runtime!();8283impl_common_runtime_apis!();8485cumulus_pallet_parachain_system::register_validate_block!(86 Runtime = Runtime,87 BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,88 CheckInherents = CheckInherents,89);runtime/unique/Cargo.tomldiffbeforeafterboth--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -72,6 +72,7 @@
"pallet-identity/std",
"pallet-preimage/std",
"pallet-session/std",
+ "pallet-state-trie-migration/std",
"sp-consensus-aura/std",
'app-promotion-rpc/std',
'evm-coder/std',
@@ -216,6 +217,7 @@
pallet-balances = { features = ["insecure_zero_ed"], workspace = true }
pallet-preimage = { workspace = true }
pallet-session = { workspace = true }
+pallet-state-trie-migration = { workspace = true }
pallet-sudo = { workspace = true }
pallet-timestamp = { workspace = true }
pallet-transaction-payment = { workspace = true }
runtime/unique/src/lib.rsdiffbeforeafterboth--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -56,7 +56,7 @@
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 3,
- state_version: 0,
+ state_version: 1,
};
parameter_types! {