Remove wasmi backend from sc-executor (#13800)

* refactor: use builder api for all executors

* improve a lot

* remove unused args

* cleanup deps

* fix inconsistency about heap alloc

* add `heap_pages` back to try-runtime

* fix

* chore: reduce duplicated code for sc-service-test

* cleanup code

* fmt

* improve test executor

* improve

* use #[deprecated]

* set runtime_cache_size: 4

* wip

* fix and improve

* remove sc-executor-wasmi deps

* clean up bench and tests

* delete "client/executor/wasmi"

* cleanup

* refactor builder

* fix

* fix bench

* fix tests

* fix warnings

* fix warnings

* fix

* fix

* remove wasmi and fix tests

* unused imports

* improve by suggestions

* Update client/cli/src/arg_enums.rs

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: parity-processbot <>
This commit is contained in:
yjh
2023-05-23 23:31:45 +08:00
committed by GitHub
parent ea21a495f8
commit b6a2948461
18 changed files with 36 additions and 795 deletions
+1 -10
View File
@@ -33,7 +33,6 @@ use std::sync::{
#[derive(Clone)]
enum Method {
Interpreted,
Compiled { instantiation_strategy: InstantiationStrategy, precompile: bool },
}
@@ -50,17 +49,10 @@ fn initialize(
method: Method,
) -> Box<dyn WasmModule> {
let blob = RuntimeBlob::uncompress_if_needed(runtime).unwrap();
let host_functions = sp_io::SubstrateHostFunctions::host_functions();
let allow_missing_func_imports = true;
match method {
Method::Interpreted => sc_executor_wasmi::create_runtime(
blob,
DEFAULT_HEAP_ALLOC_STRATEGY,
host_functions,
allow_missing_func_imports,
)
.map(|runtime| -> Box<dyn WasmModule> { Box::new(runtime) }),
Method::Compiled { instantiation_strategy, precompile } => {
let config = sc_executor_wasmtime::Config {
allow_missing_func_imports,
@@ -215,7 +207,6 @@ fn bench_call_instance(c: &mut Criterion) {
precompile: true,
},
),
("interpreted", Method::Interpreted),
];
let runtimes = [("kusama_runtime", kusama_runtime()), ("test_runtime", test_runtime())];