diff --git a/parachain/runtime/kintsugi/src/contracts.rs b/parachain/runtime/kintsugi/src/contracts.rs index 9347f866aa..b9d1a05fd7 100644 --- a/parachain/runtime/kintsugi/src/contracts.rs +++ b/parachain/runtime/kintsugi/src/contracts.rs @@ -1,5 +1,4 @@ -use crate::{BaseCallFilter, NativeCurrency, Runtime, RuntimeCall, RuntimeEvent, Timestamp, Weight}; -use bitcoin::types::{MerkleProof, Transaction}; +use crate::{NativeCurrency, Runtime, RuntimeCall, RuntimeEvent, Timestamp, Weight}; use btc_relay::FullTransactionProof; use codec::{Decode, Encode}; use frame_support::{ @@ -36,7 +35,7 @@ impl Convert for DummyWeightPrice { // contracts parameter_types! { pub const DeletionQueueDepth: u32 = 10; - pub const DeletionWeightLimit: Weight = Weight::from_ref_time(100000000 as u64); + pub const DeletionWeightLimit: Weight = Weight::from_parts(100000000, 0); pub const DepositPerByte: Balance = 1; pub const DepositPerItem: Balance = 1; pub const MaxCodeLen: u32 = 123 * 1024; diff --git a/parachain/src/service.rs b/parachain/src/service.rs index 76719ed7de..2d38956b75 100644 --- a/parachain/src/service.rs +++ b/parachain/src/service.rs @@ -15,7 +15,7 @@ use polkadot_service::CollatorPair; use primitives::*; use sc_client_api::{HeaderBackend, StateBackendFor}; use sc_consensus::{ImportQueue, LongestChain}; -use sc_executor::NativeElseWasmExecutor; +use sc_executor::{HeapAllocStrategy, NativeElseWasmExecutor, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY}; use sc_network::NetworkBlock; use sc_network_sync::SyncingService; use sc_service::{Configuration, PartialComponents, RpcHandlers, TFullBackend, TFullClient, TaskManager}; @@ -254,11 +254,20 @@ where }) .transpose()?; - let executor = NativeElseWasmExecutor::::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::::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::(