From c350a88b45eee0ef6a45739b66ec527016823cfb Mon Sep 17 00:00:00 2001 From: Fredrik Simonsson Date: Tue, 19 Dec 2023 16:31:05 +0900 Subject: [PATCH 1/2] Delete storage migration --- runtimes/eden/src/lib.rs | 2 -- runtimes/eden/src/migrations.rs | 14 +++++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/runtimes/eden/src/lib.rs b/runtimes/eden/src/lib.rs index f4d348a9a2a..45ab17fdc11 100644 --- a/runtimes/eden/src/lib.rs +++ b/runtimes/eden/src/lib.rs @@ -154,12 +154,10 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. pub type CheckedExtrinsic = generic::CheckedExtrinsic; -const TEST_ALL_STEPS: bool = cfg!(feature = "try-runtime"); pub type Migrations = ( pallet_collator_selection::migration::v1::MigrateToV1, // Migrate data as designed pallet_multisig::migrations::v1::MigrateToV1, - pallet_contracts::Migration, // Run custom migrations migrations::MultiMigration, ); diff --git a/runtimes/eden/src/migrations.rs b/runtimes/eden/src/migrations.rs index b2475bec5d6..54b5b732e31 100644 --- a/runtimes/eden/src/migrations.rs +++ b/runtimes/eden/src/migrations.rs @@ -1,4 +1,6 @@ +use frame_support::storage::unhashed::clear_prefix; use frame_support::traits::{OnRuntimeUpgrade, StorageVersion}; +use frame_support::Twox128; use frame_support::weights::Weight; use sp_core::Get; @@ -20,6 +22,16 @@ where + pallet_contracts::Config, { fn on_runtime_upgrade() -> Weight { + use crate::sp_api_hidden_includes_construct_runtime::hidden_include::{ + traits::PalletInfoAccess, StorageHasher, + }; + + // Delete all content for pallet_contracts + let module = >::name().as_bytes(); + let multi_removal_result = clear_prefix(&Twox128::hash(module), None, None); + let w = T::DbWeight::get().writes((multi_removal_result.loops + multi_removal_result.unique).into()); + StorageVersion::new(12).put::>(); + // Pallets with no data to migrate, just update storage version block goes here: // Pallet_scheduler: 1 key @@ -97,7 +109,7 @@ where // Onchain storage version = 1 in source code - unchanged any new data will be in the v1 format StorageVersion::new(1).put::>(); - T::DbWeight::get().writes(6) + T::DbWeight::get().writes(6) + w } #[cfg(feature = "try-runtime")] From 633fdd12729e8eadd77ad1560d724503766d643b Mon Sep 17 00:00:00 2001 From: Fredrik Simonsson Date: Tue, 19 Dec 2023 16:53:58 +0900 Subject: [PATCH 2/2] Remove sponsorship migration --- pallets/sponsorship/src/lib.rs | 26 +- pallets/sponsorship/src/migration.rs | 416 --------------------------- runtimes/eden/src/lib.rs | 4 +- runtimes/eden/src/migrations.rs | 111 ++++--- runtimes/eden/src/version.rs | 2 +- 5 files changed, 61 insertions(+), 498 deletions(-) delete mode 100644 pallets/sponsorship/src/migration.rs diff --git a/pallets/sponsorship/src/lib.rs b/pallets/sponsorship/src/lib.rs index ee7c6780162..a85a730aa25 100644 --- a/pallets/sponsorship/src/lib.rs +++ b/pallets/sponsorship/src/lib.rs @@ -19,6 +19,7 @@ #![cfg_attr(not(feature = "std"), no_std)] use frame_support::pallet_prelude::{ensure, Decode, Encode, MaxEncodedLen, PhantomData, RuntimeDebug, TypeInfo}; +use frame_support::traits::StorageVersion; use frame_support::{ dispatch::{DispatchInfo, DispatchResult, Dispatchable, GetDispatchInfo, Pays, PostDispatchInfo}, traits::{ @@ -43,7 +44,7 @@ use sp_std::{ }; use support::LimitedBalance; -pub use migration::STORAGE_VERSION; +const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); pub use pallet::*; #[cfg(test)] @@ -55,7 +56,6 @@ mod tests; #[cfg(feature = "runtime-benchmarks")] mod benchmarking; -pub(crate) mod migration; pub mod weights; pub use weights::*; @@ -122,7 +122,7 @@ pub mod pallet { use scale_info::prelude::boxed::Box; #[pallet::pallet] - #[pallet::storage_version(migration::STORAGE_VERSION)] + #[pallet::storage_version(STORAGE_VERSION)] #[pallet::without_storage_info] pub struct Pallet(_); @@ -567,26 +567,6 @@ pub mod pallet { Ok(()) } } - #[pallet::hooks] - impl Hooks> for Pallet { - fn on_initialize(n: BlockNumberFor) -> Weight { - migration::on_initialize::(n) - } - - fn on_runtime_upgrade() -> Weight { - migration::on_runtime_upgrade::() - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, TryRuntimeError> { - migration::pre_upgrade::() - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade(_state: Vec) -> Result<(), TryRuntimeError> { - migration::post_upgrade::(_state) - } - } } /// The pre-sponsor call preps are the details returned from `pre_sponsor_for` that are needed diff --git a/pallets/sponsorship/src/migration.rs b/pallets/sponsorship/src/migration.rs deleted file mode 100644 index 0cadd6f438a..00000000000 --- a/pallets/sponsorship/src/migration.rs +++ /dev/null @@ -1,416 +0,0 @@ -/* - * This file is part of the Nodle Chain distributed at https://github.com/NodleCode/chain - * Copyright (C) 2020-2022 Nodle International - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -use crate::{ - weights::WeightInfo, BalanceOf, Config, Pallet, Pot, PotDetailsOf, PotMigrationCursor, User, UserDetailsOf, - UserMigrationCursor, UserRegistrationCount, -}; -use codec::{Decode, Encode}; -use frame_support::{ - pallet_prelude::*, - storage::generator::{StorageDoubleMap, StorageMap}, - traits::{Get, StorageVersion}, - weights::Weight, -}; -use frame_system::pallet_prelude::BlockNumberFor; -use sp_runtime::{traits::Zero, Perbill}; -use sp_std::vec::Vec; -use support::LimitedBalance; - -/// The current storage version. -pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); - -pub(crate) mod v0 { - use super::{Pot as V1Pot, PotDetailsOf as V1PotDetailsOf, User as V1User, UserDetailsOf as V1UserDetailsOf, *}; - use frame_support::storage_alias; - use sp_runtime::traits::Saturating; - - #[derive(Encode, Decode, Debug)] - pub struct PotDetails { - pub sponsor: AccountId, - pub sponsorship_type: SponsorshipType, - pub fee_quota: LimitedBalance, - pub reserve_quota: LimitedBalance, - } - - #[derive(Encode, Decode, Debug)] - pub struct UserDetails { - pub proxy: AccountId, - pub fee_quota: LimitedBalance, - pub reserve_quota: LimitedBalance, - } - - pub type PotDetailsOf = - PotDetails<::AccountId, ::SponsorshipType, BalanceOf>; - pub type UserDetailsOf = UserDetails<::AccountId, BalanceOf>; - - #[storage_alias] - /// Details of a pot. - pub type Pot = - StorageMap, Blake2_128Concat, ::PotId, PotDetailsOf, OptionQuery>; - - #[storage_alias] - /// User details of a pot. - pub type User = StorageDoubleMap< - Pallet, - Blake2_128Concat, - ::PotId, - Blake2_128Concat, - ::AccountId, - UserDetailsOf, - OptionQuery, - >; - - pub const BLOCK_PERCENT_USAGE: u32 = 50; - - pub fn migrate_pots(max_pots: usize, starting_key: Vec) -> (Option>, Weight) { - let mut iter = Pot::::iter_from(starting_key); - - let pots = iter - .by_ref() - .take(max_pots) - .map(|(pot, details)| { - ( - pot, - V1PotDetailsOf:: { - sponsor: details.sponsor, - sponsorship_type: details.sponsorship_type, - fee_quota: details.fee_quota, - reserve_quota: details.reserve_quota, - deposit: Zero::zero(), - }, - ) - }) - .collect::>(); - - let num_of_pots = pots.len(); - - pots.into_iter() - .for_each(|(pot, details)| V1Pot::::insert(pot, details)); - - log::info!(target: "sponsorship", "migrated {} pots", num_of_pots); - - let weight = T::WeightInfo::migrate_pots(num_of_pots as u32); - if num_of_pots == max_pots { - (Some(iter.last_raw_key().to_vec()), weight) - } else { - (None, weight) - } - } - - pub fn migrate_users(max_users: usize, starting_key: Vec) -> (Option>, Weight) { - let mut iter = User::::iter_from(starting_key); - - let users = iter - .by_ref() - .take(max_users) - .map(|(pot, user, details)| { - ( - pot, - user, - V1UserDetailsOf:: { - proxy: details.proxy, - fee_quota: details.fee_quota, - reserve_quota: details.reserve_quota, - deposit: Zero::zero(), - }, - ) - }) - .collect::>(); - - let users_len = users.len(); - - users.into_iter().for_each(|(pot, user, details)| { - UserRegistrationCount::::mutate(&user, |count| { - count.saturating_inc(); - }); - V1User::::insert(pot, user, details); - }); - - log::info!(target: "sponsorship", "migrated {} user-in-pots", users_len); - - let weight = T::WeightInfo::migrate_users(users_len as u32); - if users_len == max_users { - (Some(iter.last_raw_key().to_vec()), weight) - } else { - (None, weight) - } - } - - pub fn migrate_limited(max_weight: Weight) -> Weight { - let mut weight: Weight = Zero::zero(); - - loop { - weight += min_weight::(); - - let max_pots = max_weight - .saturating_sub(weight) - .ref_time() - .checked_div(T::WeightInfo::migrate_pots(1).ref_time()) - .unwrap_or(1) as usize; - if max_pots == 0 { - break; - } - - let pot_migration_in_progress = if let Some(starting_key) = PotMigrationCursor::::get() { - let (end_cursor, migration_weight) = migrate_pots::(max_pots, starting_key); - weight += migration_weight + T::DbWeight::get().writes(1); - match end_cursor { - Some(last_key) => { - PotMigrationCursor::::put(last_key); - true - } - None => { - PotMigrationCursor::::kill(); - false - } - } - } else { - false - }; - - let max_users = max_weight - .saturating_sub(weight) - .ref_time() - .checked_div(T::WeightInfo::migrate_users(1).ref_time()) - .unwrap_or(1) as usize; - if max_users == 0 { - break; - } - - let user_migration_in_progress = if let Some(starting_key) = UserMigrationCursor::::get() { - let (end_cursor, migration_weight) = migrate_users::(max_users, starting_key); - weight += migration_weight + T::DbWeight::get().writes(1); - match end_cursor { - Some(last_key) => { - UserMigrationCursor::::put(last_key); - true - } - None => { - UserMigrationCursor::::kill(); - false - } - } - } else { - false - }; - - if !pot_migration_in_progress && !user_migration_in_progress { - weight += T::DbWeight::get().writes(1); - STORAGE_VERSION.put::>(); - break; - } - } - - weight - } - - /// Return the minimum overhead of attempting to migrate the storage. - pub fn min_weight() -> Weight { - // 2 reads: PotMigrationCursor, UserMigrationCursor - // Fixed: 40_000_000 as a pessimistic estimation for non benchmarked logic with trivial cost - // during each loop of migrate_limited - T::DbWeight::get() - .reads(2) - .saturating_add(Weight::from_parts(40_000_000_u64, 0)) - } - - /// Return the maximum overhead of attempting to migrate the storage. - pub fn max_weight() -> Weight { - T::BlockWeights::get().max_block * Perbill::from_percent(BLOCK_PERCENT_USAGE) - } -} - -/// Call this during on_initialize for the pallet. -pub fn on_initialize(_n: BlockNumberFor) -> Weight { - v0::migrate_limited::(v0::max_weight::()) -} - -/// Call this during the next runtime upgrade for this module. -pub fn on_runtime_upgrade() -> Weight { - let mut weight: Weight = T::DbWeight::get().reads(1); - - if StorageVersion::get::>() == 0 { - PotMigrationCursor::::put(Pot::::prefix_hash()); - UserMigrationCursor::::put(User::::prefix_hash()); - weight += T::DbWeight::get().reads_writes(2, 2); - - // The following invocation of migration is only needed for testing the logic during the - // try runtime. The actual migration should be called during on_initialize for the pallet. - #[cfg(feature = "try-runtime")] - while StorageVersion::get::>() == 0 { - weight += v0::migrate_limited::(v0::max_weight::()); - } - } - - weight -} - -#[cfg(feature = "try-runtime")] -use ::{ - frame_support::{Blake2_128Concat, StorageHasher}, - sp_runtime::TryRuntimeError, - sp_std::borrow::Borrow, -}; - -#[cfg(feature = "try-runtime")] -type StorageDoubleMapKey = Vec; - -#[cfg(feature = "try-runtime")] -pub(crate) fn pre_upgrade() -> Result, TryRuntimeError> { - ensure!( - StorageVersion::get::>() == 0, - TryRuntimeError::Other("Storage version is not 0") - ); - - let block_usage = v0::max_weight::(); - ensure!( - block_usage.all_gt(v0::min_weight::()), - TryRuntimeError::Other("Block usage is set too low") - ); - log::info!(target: "sponsorship", "pre_upgrade: block_usage = ({ref_time}, {proof_size})", ref_time=block_usage.ref_time(), proof_size=block_usage.proof_size()); - - let max_pots_per_block = block_usage - .saturating_sub(v0::min_weight::()) - .ref_time() - .checked_div(T::WeightInfo::migrate_pots(1).ref_time()) - .unwrap_or(1) as usize; - let max_users_per_block = block_usage - .saturating_sub(v0::min_weight::()) - .ref_time() - .checked_div(T::WeightInfo::migrate_users(1).ref_time()) - .unwrap_or(1) as usize; - ensure!( - max_pots_per_block > 0 && max_users_per_block > 0, - TryRuntimeError::Other("Migration allowed weight is too low") - ); - log::info!(target: "sponsorship", "pre_upgrade: max_pots_per_block = {max_pots_per_block}, max_users_per_block = {max_users_per_block}"); - - let pot_details = frame_support::migration::storage_key_iter::< - T::PotId, - v0::PotDetailsOf, - frame_support::Blake2_128Concat, - >(Pot::::module_prefix(), Pot::::storage_prefix()) - .collect::>(); - let user_details = frame_support::migration::storage_iter::>( - User::::module_prefix(), - User::::storage_prefix(), - ) - .collect::>(); - log::info!(target: "sponsorship", "pre_upgrade: pots = {pot_details_len}, users = {user_details_len}", pot_details_len = pot_details.len(), user_details_len = user_details.len()); - - let total_consumed_weight = v0::min_weight::() - + T::WeightInfo::migrate_pots(pot_details.len() as u32) - + T::WeightInfo::migrate_users(user_details.len() as u32) - + T::DbWeight::get().writes(1); - let blocks = total_consumed_weight - .ref_time() - .checked_div(block_usage.ref_time()) - .ok_or("Unable to calculate blocks")? - + 1; - log::info!(target: "sponsorship", "pre_upgrade: total_consumed_weight = ({ref_time}, {proof_size}), blocks = {blocks:?}", ref_time=total_consumed_weight.ref_time(), proof_size=total_consumed_weight.proof_size()); - - Ok((pot_details, user_details).encode()) -} - -#[cfg(feature = "try-runtime")] -pub(crate) fn post_upgrade(state: Vec) -> Result<(), TryRuntimeError> { - ensure!( - StorageVersion::get::>() == 1, - TryRuntimeError::Other("Storage version not fixed") - ); - - let (pre_pot_details, pre_user_details): ( - Vec<(T::PotId, v0::PotDetailsOf)>, - Vec<(StorageDoubleMapKey, v0::UserDetailsOf)>, - ) = Decode::decode(&mut state.as_slice()).map_err(|_| "Unable to decode previous collection details")?; - let pot_details = Pot::::iter().collect::>(); - - ensure!( - pre_pot_details.len() == pot_details.len(), - TryRuntimeError::Other("Pot count mismatch") - ); - - for (pre, post) in pre_pot_details.iter().zip(pot_details.iter()) { - ensure!(pre.0 == post.0, TryRuntimeError::Other("Pot id mismatch")); - ensure!( - pre.1.sponsor == post.1.sponsor, - TryRuntimeError::Other("Pot sponsor mismatch") - ); - ensure!( - pre.1.sponsorship_type == post.1.sponsorship_type, - TryRuntimeError::Other("Pot sponsorship type mismatch") - ); - ensure!( - pre.1.fee_quota == post.1.fee_quota, - TryRuntimeError::Other("Pot fee quota mismatch") - ); - ensure!( - pre.1.reserve_quota == post.1.reserve_quota, - TryRuntimeError::Other("Pot reserve quota mismatch") - ); - ensure!( - post.1.deposit == Default::default(), - TryRuntimeError::Other("Pot deposit is not default") - ); - } - - let user_details = User::::iter().collect::>(); - ensure!( - pre_user_details.len() == user_details.len(), - TryRuntimeError::Other("User count mismatch") - ); - - for (pre, post) in pre_user_details.iter().zip(user_details.iter()) { - let key1_hashed = post.0.borrow().using_encoded(Blake2_128Concat::hash); - let key2_hashed = post.1.borrow().using_encoded(Blake2_128Concat::hash); - let mut final_key = Vec::new(); - final_key.extend_from_slice(key1_hashed.as_ref()); - final_key.extend_from_slice(key2_hashed.as_ref()); - - ensure!(pre.0 == final_key, TryRuntimeError::Other("User key mismatch")); - ensure!( - pre.1.proxy == post.2.proxy, - TryRuntimeError::Other("User proxy mismatch") - ); - ensure!( - pre.1.fee_quota == post.2.fee_quota, - TryRuntimeError::Other("User fee quota mismatch") - ); - ensure!( - pre.1.reserve_quota == post.2.reserve_quota, - TryRuntimeError::Other("User reserve quota mismatch") - ); - ensure!( - post.2.deposit == Default::default(), - TryRuntimeError::Other("User deposit is not default") - ); - } - - UserRegistrationCount::::iter().try_for_each(|(_user, count)| { - ensure!(count > 0, TryRuntimeError::Other("User registration count is 0")); - ensure!( - count <= pot_details.len() as u32, - TryRuntimeError::Other("User registration count is greater than number of pots") - ); - Ok::<(), TryRuntimeError>(()) - })?; - - log::info!(target: "sponsorship", "post_upgrade: pots = {}, pot_user_count = {}, users = {}", pot_details.len(), user_details.len(), UserRegistrationCount::::iter().count()); - Ok(()) -} diff --git a/runtimes/eden/src/lib.rs b/runtimes/eden/src/lib.rs index 45ab17fdc11..88363eb3d20 100644 --- a/runtimes/eden/src/lib.rs +++ b/runtimes/eden/src/lib.rs @@ -155,9 +155,9 @@ pub type SignedPayload = generic::SignedPayload; /// Extrinsic type that has already been checked. pub type CheckedExtrinsic = generic::CheckedExtrinsic; pub type Migrations = ( - pallet_collator_selection::migration::v1::MigrateToV1, + // pallet_collator_selection::migration::v1::MigrateToV1, // Migrate data as designed - pallet_multisig::migrations::v1::MigrateToV1, + // pallet_multisig::migrations::v1::MigrateToV1, // Run custom migrations migrations::MultiMigration, ); diff --git a/runtimes/eden/src/migrations.rs b/runtimes/eden/src/migrations.rs index 54b5b732e31..a9c6935772c 100644 --- a/runtimes/eden/src/migrations.rs +++ b/runtimes/eden/src/migrations.rs @@ -29,7 +29,7 @@ where // Delete all content for pallet_contracts let module = >::name().as_bytes(); let multi_removal_result = clear_prefix(&Twox128::hash(module), None, None); - let w = T::DbWeight::get().writes((multi_removal_result.loops + multi_removal_result.unique).into()); + let w = multi_removal_result.loops + multi_removal_result.unique; StorageVersion::new(12).put::>(); // Pallets with no data to migrate, just update storage version block goes here: @@ -109,72 +109,71 @@ where // Onchain storage version = 1 in source code - unchanged any new data will be in the v1 format StorageVersion::new(1).put::>(); - T::DbWeight::get().writes(6) + w + T::DbWeight::get().writes(6 + w as u64) } - #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, TryRuntimeError> { - use frame_support::ensure; - - log::info!("Pre upgrade"); - - ensure!( - StorageVersion::get::>() == 0, - TryRuntimeError::Other("preimage storage version is not 0") - ); - ensure!( - StorageVersion::get::>() == 0, - TryRuntimeError::Other("pallet_xcm storage version is not 0") - ); - ensure!( - StorageVersion::get::>() == 0, - TryRuntimeError::Other("pallet_scheduler storage version is not 0") - ); - ensure!( - StorageVersion::get::>() == 0, - TryRuntimeError::Other("pallet_collective storage version is not 0") - ); - ensure!( - StorageVersion::get::>() == 0, - TryRuntimeError::Other("pallet_membership storage version is not 0") - ); - ensure!( - StorageVersion::get::>() == 0, - TryRuntimeError::Other("pallet_balances storage version is not 0") - ); + // use frame_support::ensure; + + // log::info!("Pre upgrade"); + + // ensure!( + // StorageVersion::get::>() == 0, + // TryRuntimeError::Other("preimage storage version is not 0") + // ); + // ensure!( + // StorageVersion::get::>() == 0, + // TryRuntimeError::Other("pallet_xcm storage version is not 0") + // ); + // ensure!( + // StorageVersion::get::>() == 0, + // TryRuntimeError::Other("pallet_scheduler storage version is not 0") + // ); + // ensure!( + // StorageVersion::get::>() == 0, + // TryRuntimeError::Other("pallet_collective storage version is not 0") + // ); + // ensure!( + // StorageVersion::get::>() == 0, + // TryRuntimeError::Other("pallet_membership storage version is not 0") + // ); + // ensure!( + // StorageVersion::get::>() == 0, + // TryRuntimeError::Other("pallet_balances storage version is not 0") + // ); Ok(vec![]) } #[cfg(feature = "try-runtime")] fn post_upgrade(_state: Vec) -> Result<(), TryRuntimeError> { - use frame_support::ensure; + // use frame_support::ensure; log::info!("Post upgrade {_state:?}"); - ensure!( - StorageVersion::get::>() == 1, - TryRuntimeError::Other("preimage post upgrade storage version is not 1") - ); - ensure!( - StorageVersion::get::>() == 1, - TryRuntimeError::Other("pallet_xcm post upgrade storage version is not 1") - ); - ensure!( - StorageVersion::get::>() == 4, - TryRuntimeError::Other("pallet_scheduler post upgrade storage version is not 4") - ); - ensure!( - StorageVersion::get::>() == 4, - TryRuntimeError::Other("pallet_collective post upgrade storage version is not 4") - ); - ensure!( - StorageVersion::get::>() == 4, - TryRuntimeError::Other("pallet_membership post upgrade storage version is not 4") - ); - ensure!( - StorageVersion::get::>() == 1, - TryRuntimeError::Other("pallet_balances post upgrade storage version is not 1") - ); + // ensure!( + // StorageVersion::get::>() == 1, + // TryRuntimeError::Other("preimage post upgrade storage version is not 1") + // ); + // ensure!( + // StorageVersion::get::>() == 1, + // TryRuntimeError::Other("pallet_xcm post upgrade storage version is not 1") + // ); + // ensure!( + // StorageVersion::get::>() == 4, + // TryRuntimeError::Other("pallet_scheduler post upgrade storage version is not 4") + // ); + // ensure!( + // StorageVersion::get::>() == 4, + // TryRuntimeError::Other("pallet_collective post upgrade storage version is not 4") + // ); + // ensure!( + // StorageVersion::get::>() == 4, + // TryRuntimeError::Other("pallet_membership post upgrade storage version is not 4") + // ); + // ensure!( + // StorageVersion::get::>() == 1, + // TryRuntimeError::Other("pallet_balances post upgrade storage version is not 1") + // ); Ok(()) } diff --git a/runtimes/eden/src/version.rs b/runtimes/eden/src/version.rs index a5df71794d7..b300fe330dc 100644 --- a/runtimes/eden/src/version.rs +++ b/runtimes/eden/src/version.rs @@ -40,7 +40,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // Version of the runtime specification. A full-node will not attempt to use its native // runtime in substitute for the on-chain Wasm runtime unless all of `spec_name`, // `spec_version` and `authoring_version` are the same between Wasm and native. - spec_version: 27, + spec_version: 28, // Version of the implementation of the specification. Nodes are free to ignore this; it // serves only as an indication that the code is different; as long as the other two versions