From bd583d6334b7ecc991254b7adc1c0594da716127 Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky <svyatonik@gmail.com> Date: Thu, 13 Apr 2023 15:55:02 +0300 Subject: [PATCH] update refs (#2041) --- bridges/bin/millau/node/src/service.rs | 17 +++++++++---- .../bin/rialto-parachain/node/src/service.rs | 24 +++++++++++++------ bridges/bin/rialto/node/src/command.rs | 4 ++-- bridges/modules/beefy/src/lib.rs | 2 +- bridges/primitives/messages/src/lib.rs | 4 ++-- 5 files changed, 34 insertions(+), 17 deletions(-) diff --git a/bridges/bin/millau/node/src/service.rs b/bridges/bin/millau/node/src/service.rs index 7230accef8e..07cd29a0d6d 100644 --- a/bridges/bin/millau/node/src/service.rs +++ b/bridges/bin/millau/node/src/service.rs @@ -22,6 +22,7 @@ use sc_client_api::BlockBackend; use sc_consensus_aura::{CompatibilityMode, ImportQueueParams, SlotProportion, StartAuraParams}; use sc_consensus_grandpa::SharedVoterState; pub use sc_executor::NativeElseWasmExecutor; +use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY}; use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; use sc_telemetry::{Telemetry, TelemetryWorker}; use sp_consensus_aura::sr25519::AuthorityPair as AuraPair; @@ -88,11 +89,17 @@ pub fn new_partial( }) .transpose()?; - let executor = NativeElseWasmExecutor::<ExecutorDispatch>::new( - config.wasm_method, - config.default_heap_pages, - config.max_runtime_instances, - config.runtime_cache_size, + let heap_pages = config + .default_heap_pages + .map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ }); + let executor = NativeElseWasmExecutor::<ExecutorDispatch>::new_with_wasm_executor( + WasmExecutor::builder() + .with_execution_method(config.wasm_method) + .with_onchain_heap_alloc_strategy(heap_pages) + .with_offchain_heap_alloc_strategy(heap_pages) + .with_max_runtime_instances(config.max_runtime_instances) + .with_runtime_cache_size(config.runtime_cache_size) + .build(), ); let (client, backend, keystore_container, task_manager) = diff --git a/bridges/bin/rialto-parachain/node/src/service.rs b/bridges/bin/rialto-parachain/node/src/service.rs index 6662b2e9625..24eb94e655d 100644 --- a/bridges/bin/rialto-parachain/node/src/service.rs +++ b/bridges/bin/rialto-parachain/node/src/service.rs @@ -41,7 +41,10 @@ use cumulus_primitives_core::ParaId; use cumulus_relay_chain_interface::RelayChainInterface; use sc_consensus::ImportQueue; // Substrate Imports -use sc_executor::{NativeElseWasmExecutor, NativeExecutionDispatch}; +use sc_executor::{ + HeapAllocStrategy, NativeElseWasmExecutor, NativeExecutionDispatch, WasmExecutor, + DEFAULT_HEAP_ALLOC_STRATEGY, +}; use sc_network::NetworkBlock; use sc_network_sync::SyncingService; use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager}; @@ -131,12 +134,19 @@ where }) .transpose()?; - let executor = sc_executor::NativeElseWasmExecutor::<ParachainRuntimeExecutor>::new( - config.wasm_method, - config.default_heap_pages, - config.max_runtime_instances, - config.runtime_cache_size, - ); + let heap_pages = config + .default_heap_pages + .map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ }); + let executor = + sc_executor::NativeElseWasmExecutor::<ParachainRuntimeExecutor>::new_with_wasm_executor( + WasmExecutor::builder() + .with_execution_method(config.wasm_method) + .with_onchain_heap_alloc_strategy(heap_pages) + .with_offchain_heap_alloc_strategy(heap_pages) + .with_max_runtime_instances(config.max_runtime_instances) + .with_runtime_cache_size(config.runtime_cache_size) + .build(), + ); let (client, backend, keystore_container, task_manager) = sc_service::new_full_parts::<Block, RuntimeApi, _>( diff --git a/bridges/bin/rialto/node/src/command.rs b/bridges/bin/rialto/node/src/command.rs index 8286444d3ea..0bff2e523b4 100644 --- a/bridges/bin/rialto/node/src/command.rs +++ b/bridges/bin/rialto/node/src/command.rs @@ -164,7 +164,7 @@ pub fn run() -> sc_cli::Result<()> { builder.with_colors(false); let _ = builder.init(); - polkadot_node_core_pvf::prepare_worker_entrypoint(&cmd.socket_path); + polkadot_node_core_pvf::prepare_worker_entrypoint(&cmd.socket_path, None); Ok(()) }, Some(crate::cli::Subcommand::PvfExecuteWorker(cmd)) => { @@ -172,7 +172,7 @@ pub fn run() -> sc_cli::Result<()> { builder.with_colors(false); let _ = builder.init(); - polkadot_node_core_pvf::execute_worker_entrypoint(&cmd.socket_path); + polkadot_node_core_pvf::execute_worker_entrypoint(&cmd.socket_path, None); Ok(()) }, None => { diff --git a/bridges/modules/beefy/src/lib.rs b/bridges/modules/beefy/src/lib.rs index a3a68928bc5..79795dd0770 100644 --- a/bridges/modules/beefy/src/lib.rs +++ b/bridges/modules/beefy/src/lib.rs @@ -94,7 +94,7 @@ pub struct ImportedCommitmentsInfoData<BlockNumber> { next_block_number_index: u32, } -#[frame_support::pallet] +#[frame_support::pallet(dev_mode)] pub mod pallet { use super::*; use bp_runtime::{BasicOperatingMode, OwnedBridgeModule}; diff --git a/bridges/primitives/messages/src/lib.rs b/bridges/primitives/messages/src/lib.rs index 9481a4b9bb8..7b7e9476a01 100644 --- a/bridges/primitives/messages/src/lib.rs +++ b/bridges/primitives/messages/src/lib.rs @@ -245,7 +245,7 @@ impl<RelayerId> InboundLaneData<RelayerId> { } /// Outbound message details, returned by runtime APIs. -#[derive(Clone, Encode, Decode, RuntimeDebug, PartialEq, Eq)] +#[derive(Clone, Encode, Decode, RuntimeDebug, PartialEq, Eq, TypeInfo)] pub struct OutboundMessageDetails { /// Nonce assigned to the message. pub nonce: MessageNonce, @@ -259,7 +259,7 @@ pub struct OutboundMessageDetails { } /// Inbound message details, returned by runtime APIs. -#[derive(Clone, Encode, Decode, RuntimeDebug, PartialEq, Eq)] +#[derive(Clone, Encode, Decode, RuntimeDebug, PartialEq, Eq, TypeInfo)] pub struct InboundMessageDetails { /// Computed message dispatch weight. /// -- GitLab