frame_benchmarking_cli/storage/
mod.rs1pub mod cmd;
19pub mod read;
20pub mod template;
21pub mod write;
22
23pub use cmd::StorageCmd;
24
25pub(crate) const MAX_BATCH_SIZE_FOR_BLOCK_VALIDATION: usize = 10_000;
28
29pub(crate) fn get_wasm_module() -> Box<dyn sc_executor_common::wasm_runtime::WasmModule> {
30 let blob = sc_executor_common::runtime_blob::RuntimeBlob::uncompress_if_needed(
31 frame_storage_access_test_runtime::WASM_BINARY
32 .expect("You need to build the WASM binaries to run the benchmark!"),
33 )
34 .expect("Failed to create runtime blob");
35 let config = sc_executor_wasmtime::Config {
36 allow_missing_func_imports: true,
37 cache_path: None,
38 semantics: sc_executor_wasmtime::Semantics {
39 heap_alloc_strategy: sc_executor_common::wasm_runtime::HeapAllocStrategy::Dynamic {
40 maximum_pages: Some(4096),
41 },
42 instantiation_strategy: sc_executor::WasmtimeInstantiationStrategy::PoolingCopyOnWrite,
43 deterministic_stack_limit: None,
44 canonicalize_nans: false,
45 parallel_compilation: false,
46 wasm_multi_value: false,
47 wasm_bulk_memory: false,
48 wasm_reference_types: false,
49 wasm_simd: false,
50 },
51 };
52
53 Box::new(
54 sc_executor_wasmtime::create_runtime::<sp_io::SubstrateHostFunctions>(blob, config)
55 .expect("Unable to create wasm module."),
56 )
57}