Switch to pooling copy-on-write instantiation strategy for WASM (companion for Substrate#11232) (#5337)

* Switch to pooling copy-on-write instantiation strategy for WASM

* Fix compilation of `polkadot-test-service`

* Update comments

* Move `max_memory_size` to `Semantics`

* Rename `WasmInstantiationStrategy` to `WasmtimeInstantiationStrategy`

* Update a safety comment

* update lockfile for {"substrate"}

Co-authored-by: parity-processbot <>
This commit is contained in:
Koute
2022-05-19 20:06:34 +09:00
committed by GitHub
parent f1006f5a43
commit d9eff4ecd4
8 changed files with 241 additions and 298 deletions
+7 -2
View File
@@ -42,7 +42,10 @@ use sc_network::{
multiaddr,
};
use sc_service::{
config::{DatabaseSource, KeystoreConfig, MultiaddrWithPeerId, WasmExecutionMethod},
config::{
DatabaseSource, KeystoreConfig, MultiaddrWithPeerId, WasmExecutionMethod,
WasmtimeInstantiationStrategy,
},
BasePath, Configuration, KeepBlocks, Role, RpcHandlers, TaskManager,
};
use sp_arithmetic::traits::SaturatedConversion;
@@ -176,7 +179,9 @@ pub fn node_config(
state_pruning: Default::default(),
keep_blocks: KeepBlocks::All,
chain_spec: Box::new(spec),
wasm_method: WasmExecutionMethod::Compiled,
wasm_method: WasmExecutionMethod::Compiled {
instantiation_strategy: WasmtimeInstantiationStrategy::PoolingCopyOnWrite,
},
wasm_runtime_overrides: Default::default(),
// NOTE: we enforce the use of the native runtime to make the errors more debuggable
execution_strategies: ExecutionStrategies {