diff --git a/Makefile b/Makefile index 9323c1c206..c3786b8e29 100644 --- a/Makefile +++ b/Makefile @@ -356,7 +356,7 @@ build-bridging-mainnet: cargo build --features frequency,frequency-bridging build-bridging-westend: - cargo build --features frequency-westend,frequency-bridging --release + cargo build --features frequency-westend,frequency-bridging build-bridging-local: cargo build --features frequency-local,frequency-bridging --release diff --git a/common/primitives/src/offchain.rs b/common/primitives/src/offchain.rs index 6832be216e..6fea7db22d 100644 --- a/common/primitives/src/offchain.rs +++ b/common/primitives/src/offchain.rs @@ -9,23 +9,24 @@ extern crate alloc; use alloc::vec::Vec; use core::fmt::Debug; -#[cfg(feature = "std")] -sp_externalities::decl_extension! { - /// Offchain worker custom extension - pub struct OcwCustomExt ( - // rpc address provided to offchain worker - Vec - ); -} +// #[cfg(feature = "std")] +// sp_externalities::decl_extension! { +// /// Offchain worker custom extension +// pub struct OcwCustomExt ( +// // rpc address provided to offchain worker +// Vec +// ); +// } /// runtime new customized -#[runtime_interface] -pub trait Custom: ExternalitiesExt { - /// another function - fn get_val(&mut self) -> Option> { - self.extension::().map(|ext| ext.0.clone()) - } -} +// #[runtime_interface] +// pub trait Custom: ExternalitiesExt { +// /// another function +// fn get_val(&mut self) -> Option> { +// self.extension::().map(|ext| ext.0.clone()) +// } +// } + /// Lock expiration timeout in milli-seconds for msa pallet per msa account pub const MSA_ACCOUNT_LOCK_TIMEOUT_EXPIRATION_MS: u64 = 50; /// Lock name prefix for msa account diff --git a/node/service/src/common.rs b/node/service/src/common.rs index 577d5e4971..2a8c8af687 100644 --- a/node/service/src/common.rs +++ b/node/service/src/common.rs @@ -1,6 +1,7 @@ #![allow(missing_docs)] use crate::service::ParachainClient; -use common_primitives::{node::Block, offchain::OcwCustomExt}; +use common_primitives::node::Block; +// use common_primitives::offchain::OcwCustomExt; use sc_client_api::Backend; use sc_offchain::NetworkProvider; use sc_service::{config::RpcEndpoint, TFullBackend, TaskManager}; @@ -58,7 +59,8 @@ pub fn start_offchain_workers( transaction_pool, network_provider, enable_http_requests: true, - custom_extensions: move |_hash| vec![Box::new(OcwCustomExt(rpc_address.clone())) as Box<_>], + custom_extensions: move |_hash| vec![], + // custom_extensions: move |_hash| vec![Box::new(OcwCustomExt(rpc_address.clone())) as Box<_>], }) .expect("Could not create Offchain Worker"); diff --git a/node/service/src/service.rs b/node/service/src/service.rs index cdd1225a69..7aef8016f4 100644 --- a/node/service/src/service.rs +++ b/node/service/src/service.rs @@ -57,14 +57,14 @@ type MaybeFullSelectChain = Option>; #[cfg(not(feature = "runtime-benchmarks"))] type HostFunctions = ( cumulus_client_service::ParachainHostFunctions, - common_primitives::offchain::custom::HostFunctions, + // common_primitives::offchain::custom::HostFunctions, ); #[cfg(feature = "runtime-benchmarks")] type HostFunctions = ( cumulus_client_service::ParachainHostFunctions, frame_benchmarking::benchmarking::HostFunctions, - common_primitives::offchain::custom::HostFunctions, + // common_primitives::offchain::custom::HostFunctions, ); use crate::common::start_offchain_workers; @@ -203,7 +203,7 @@ pub async fn start_parachain_node( override_pool_config: Option, ) -> sc_service::error::Result<(TaskManager, Arc)> { use crate::common::listen_addrs_to_normalized_strings; - use common_primitives::offchain::OcwCustomExt; + // use common_primitives::offchain::OcwCustomExt; use sc_client_db::Backend; let parachain_config = prepare_node_config(parachain_config); diff --git a/pallets/msa/src/offchain_storage.rs b/pallets/msa/src/offchain_storage.rs index af3bb907bc..92e15f000a 100644 --- a/pallets/msa/src/offchain_storage.rs +++ b/pallets/msa/src/offchain_storage.rs @@ -452,12 +452,13 @@ pub struct FinalizedBlockResponse { /// fetches finalized block hash from rpc fn fetch_finalized_block_hash() -> Result { // we are not able to use the custom extension in benchmarks due to feature conflict - let rpc_address = if cfg!(feature = "runtime-benchmarks") { + let rpc_address: Vec = if cfg!(feature = "runtime-benchmarks") { RPC_FINALIZED_BLOCK_REQUEST_URL.into() } else { + RPC_FINALIZED_BLOCK_REQUEST_URL.into() // rpc address provided to offchain worker via custom extension - common_primitives::offchain::custom::get_val() - .unwrap_or(RPC_FINALIZED_BLOCK_REQUEST_URL.into()) + // common_primitives::offchain::custom::get_val() + // .unwrap_or(RPC_FINALIZED_BLOCK_REQUEST_URL.into()) }; let url = core::str::from_utf8(&rpc_address) .map_err(|_| sp_runtime::offchain::http::Error::Unknown)?;