mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 19:01:08 +00:00
sc_executor: Use new_with_wasm_executor instead of deprecated new method (#7055)
* node: Replace deprecated versions of sc_executor Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update cargo.lock via `cargo update -p sc-executor` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update Cargo.lock with latest substrate Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * node: Replace `new` with `new_with_wasm_executor` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update substrate to latest Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Generated
+269
-209
File diff suppressed because it is too large
Load Diff
@@ -104,8 +104,10 @@ pub use polkadot_client::{
|
||||
pub use polkadot_primitives::{Block, BlockId, BlockNumber, CollatorPair, Hash, Id as ParaId};
|
||||
pub use sc_client_api::{Backend, CallExecutor, ExecutionStrategy};
|
||||
pub use sc_consensus::{BlockImport, LongestChain};
|
||||
use sc_executor::NativeElseWasmExecutor;
|
||||
pub use sc_executor::NativeExecutionDispatch;
|
||||
use sc_executor::{
|
||||
HeapAllocStrategy, NativeElseWasmExecutor, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY,
|
||||
};
|
||||
pub use service::{
|
||||
config::{DatabaseSource, PrometheusConfig},
|
||||
ChainSpec, Configuration, Error as SubstrateServiceError, PruningMode, Role, RuntimeGenesis,
|
||||
@@ -404,12 +406,19 @@ where
|
||||
})
|
||||
.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 wasm = 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 executor = NativeElseWasmExecutor::<ExecutorDispatch>::new_with_wasm_executor(wasm);
|
||||
|
||||
let (client, backend, keystore_container, task_manager) =
|
||||
service::new_full_parts::<Block, RuntimeApi, _>(
|
||||
|
||||
Reference in New Issue
Block a user