diff --git a/Cargo.lock b/Cargo.lock index f67d5cf8..289f8e72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -691,7 +691,7 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "avn-lower-rpc" -version = "5.4.1" +version = "5.4.2" dependencies = [ "avn-service", "futures", @@ -713,7 +713,7 @@ dependencies = [ [[package]] name = "avn-node-parachain" -version = "5.4.1" +version = "5.4.2" dependencies = [ "avn-lower-rpc", "avn-parachain-runtime", @@ -793,7 +793,7 @@ dependencies = [ [[package]] name = "avn-parachain-runtime" -version = "5.4.1" +version = "5.4.2" dependencies = [ "avn-runtime-common", "cumulus-pallet-aura-ext", @@ -872,7 +872,7 @@ dependencies = [ [[package]] name = "avn-parachain-test-runtime" -version = "5.4.1" +version = "5.4.2" dependencies = [ "avn-runtime-common", "cumulus-pallet-aura-ext", @@ -951,7 +951,7 @@ dependencies = [ [[package]] name = "avn-runtime-common" -version = "5.4.1" +version = "5.4.2" dependencies = [ "frame-support", "hex-literal 0.4.1", @@ -965,7 +965,7 @@ dependencies = [ [[package]] name = "avn-service" -version = "5.4.1" +version = "5.4.2" dependencies = [ "anyhow", "ethereum-types 0.11.0", @@ -6823,7 +6823,7 @@ dependencies = [ [[package]] name = "pallet-avn" -version = "5.4.1" +version = "5.4.2" dependencies = [ "frame-benchmarking", "frame-support", @@ -6849,7 +6849,7 @@ dependencies = [ [[package]] name = "pallet-avn-offence-handler" -version = "5.4.1" +version = "5.4.2" dependencies = [ "frame-benchmarking", "frame-support", @@ -6870,7 +6870,7 @@ dependencies = [ [[package]] name = "pallet-avn-proxy" -version = "5.4.1" +version = "5.4.2" dependencies = [ "frame-benchmarking", "frame-support", @@ -6893,7 +6893,7 @@ dependencies = [ [[package]] name = "pallet-avn-transaction-payment" -version = "5.4.1" +version = "5.4.2" dependencies = [ "frame-benchmarking", "frame-support", @@ -7160,7 +7160,7 @@ dependencies = [ [[package]] name = "pallet-eth-bridge" -version = "5.4.1" +version = "5.4.2" dependencies = [ "ethabi 13.0.0", "frame-benchmarking", @@ -7186,7 +7186,7 @@ dependencies = [ [[package]] name = "pallet-ethereum-events" -version = "5.4.1" +version = "5.4.2" dependencies = [ "env_logger 0.10.0", "frame-benchmarking", @@ -7381,7 +7381,7 @@ dependencies = [ [[package]] name = "pallet-nft-manager" -version = "5.4.1" +version = "5.4.2" dependencies = [ "frame-benchmarking", "frame-support", @@ -7508,7 +7508,7 @@ dependencies = [ [[package]] name = "pallet-parachain-staking" -version = "5.4.1" +version = "5.4.2" dependencies = [ "assert_matches", "frame-benchmarking", @@ -7785,7 +7785,7 @@ dependencies = [ [[package]] name = "pallet-summary" -version = "5.4.1" +version = "5.4.2" dependencies = [ "assert_matches", "frame-benchmarking", @@ -7852,7 +7852,7 @@ dependencies = [ [[package]] name = "pallet-token-manager" -version = "5.4.1" +version = "5.4.2" dependencies = [ "enumflags2", "frame-benchmarking", @@ -7960,7 +7960,7 @@ dependencies = [ [[package]] name = "pallet-validators-manager" -version = "5.4.1" +version = "5.4.2" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -12556,7 +12556,7 @@ dependencies = [ [[package]] name = "sp-avn-common" -version = "5.4.1" +version = "5.4.2" dependencies = [ "byte-slice-cast", "derive_more", diff --git a/Cargo.toml b/Cargo.toml index 63187a02..2d8db0ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ lto = "fat" codegen-units = 1 [workspace.package] -version = "5.4.1" +version = "5.4.2" authors = ["Aventus systems team"] homepage = "https://www.aventus.io/" repository = "https://github.com/Aventus-Network-Services/avn-node-parachain/" diff --git a/node/src/command.rs b/node/src/command.rs index 14baade4..b5bfe58d 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -233,22 +233,30 @@ pub fn run() -> Result<()> { }, #[cfg(feature = "try-runtime")] Some(Subcommand::TryRuntime(cmd)) => { - let runner = cli.create_runner(cmd)?; - + //Err("try-runtime is deprecated. Use the CLI".into()) + use crate::common::AvnParachainExecutor; + use avn_parachain_runtime::SLOT_DURATION; use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch}; - type HostFunctionsOf = ExtendedHostFunctions< - sp_io::SubstrateHostFunctions, - ::ExtendHostFunctions, - >; - - // grab the task manager. - let registry = &runner.config().prometheus_config.as_ref().map(|cfg| &cfg.registry); - let task_manager = - sc_service::TaskManager::new(runner.config().tokio_handle.clone(), *registry) - .map_err(|e| format!("Error: {:?}", e))?; - - runner.async_run(|_| { - Ok((cmd.run::>(), task_manager)) + use try_runtime_cli::block_building_info::substrate_info; + + let runner = cli.create_runner(cmd)?; + runner.async_run(|config| { + // we don't need any of the components of new_partial, just a runtime, or a task + // manager to do `async_run`. + let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry); + let task_manager = + sc_service::TaskManager::new(config.tokio_handle.clone(), registry) + .map_err(|e| sc_cli::Error::Service(sc_service::Error::Prometheus(e)))?; + + let info_provider = substrate_info(SLOT_DURATION); + + Ok(( + cmd.run::::ExtendHostFunctions, + >, _>(Some(info_provider)), + task_manager, + )) }) }, #[cfg(not(feature = "try-runtime"))] diff --git a/pallets/eth-bridge/src/lib.rs b/pallets/eth-bridge/src/lib.rs index 8eb4731c..1b4affb2 100644 --- a/pallets/eth-bridge/src/lib.rs +++ b/pallets/eth-bridge/src/lib.rs @@ -58,7 +58,10 @@ use alloc::{ }; use codec::{Decode, Encode, MaxEncodedLen}; use core::convert::TryInto; -use frame_support::{dispatch::DispatchResultWithPostInfo, log, traits::IsSubType, BoundedVec}; +use frame_support::{ + dispatch::DispatchResultWithPostInfo, log, pallet_prelude::StorageVersion, traits::IsSubType, + BoundedVec, +}; use frame_system::{ ensure_none, ensure_root, offchain::{SendTransactionTypes, SubmitTransaction}, @@ -127,6 +130,8 @@ const ADD_CONFIRMATION_CONTEXT: &'static [u8] = b"EthBridgeConfirmation"; const ADD_CORROBORATION_CONTEXT: &'static [u8] = b"EthBridgeCorroboration"; const ADD_ETH_TX_HASH_CONTEXT: &'static [u8] = b"EthBridgeEthTxHash"; +const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); + #[frame_support::pallet] pub mod pallet { use crate::offence::CorroborationOffenceType; @@ -200,6 +205,7 @@ pub mod pallet { } #[pallet::pallet] + #[pallet::storage_version(STORAGE_VERSION)] pub struct Pallet(_); #[pallet::storage] diff --git a/pallets/token-manager/src/migration.rs b/pallets/token-manager/src/migration.rs index c6e118d7..a4e7ce3d 100644 --- a/pallets/token-manager/src/migration.rs +++ b/pallets/token-manager/src/migration.rs @@ -10,6 +10,9 @@ use frame_system::pallet_prelude::BlockNumberFor; #[cfg(feature = "try-runtime")] use crate::Vec; +#[cfg(feature = "try-runtime")] +use sp_runtime::TryRuntimeError; + pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); pub fn set_lower_schedule_period() -> Weight { @@ -54,14 +57,14 @@ impl OnRuntimeUpgrade for SetLowerSchedulePeriod { } #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { + fn pre_upgrade() -> Result, TryRuntimeError> { use codec::Encode; Ok(>::get().encode()) } #[cfg(feature = "try-runtime")] - fn post_upgrade(input: Vec) -> Result<(), &'static str> { + fn post_upgrade(input: Vec) -> Result<(), TryRuntimeError> { use codec::Decode; use sp_runtime::traits::Zero; diff --git a/runtime/test/src/lib.rs b/runtime/test/src/lib.rs index 100b4ffa..ce56b57d 100644 --- a/runtime/test/src/lib.rs +++ b/runtime/test/src/lib.rs @@ -947,8 +947,8 @@ impl_runtime_apis! { #[cfg(feature = "try-runtime")] impl frame_try_runtime::TryRuntime for Runtime { - fn on_runtime_upgrade(checks: bool) -> (Weight, Weight) { - log::info!("try-runtime::on_runtime_upgrade avn-parachain."); + fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) { + log::info!("try-runtime::on_runtime_upgrade avn-test-parachain."); let weight = Executive::try_runtime_upgrade(checks).unwrap(); (weight, RuntimeBlockWeights::get().max_block) }