mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 07:37:57 +00:00
Companion for Substrate#11107 (#5197)
* Rename to BagError
* Additional parameter for 'revert' command
* Set aux revert param to None
* Align to changes in how the WASM executor is configured in `substrate`
* update lockfile for {"substrate"}
* update lockfile for {"substrate"}
* Update substrate
* Update substrate
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Davide Galassi <davxy@datawok.net>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: parity-processbot <>
This commit is contained in:
Generated
+163
-163
File diff suppressed because it is too large
Load Diff
@@ -394,7 +394,7 @@ pub fn run() -> Result<()> {
|
||||
|
||||
Ok(runner.async_run(|mut config| {
|
||||
let (client, backend, _, task_manager) = service::new_chain_ops(&mut config, None)?;
|
||||
Ok((cmd.run(client, backend).map_err(Error::SubstrateCli), task_manager))
|
||||
Ok((cmd.run(client, backend, None).map_err(Error::SubstrateCli), task_manager))
|
||||
})?)
|
||||
},
|
||||
Some(Subcommand::PvfPrepareWorker(cmd)) => {
|
||||
|
||||
@@ -24,31 +24,30 @@ use sc_executor_wasmtime::{Config, DeterministicStackLimit, Semantics};
|
||||
use sp_core::storage::{ChildInfo, TrackedStorageKey};
|
||||
use std::any::{Any, TypeId};
|
||||
|
||||
// Memory configuration
|
||||
//
|
||||
// When Substrate Runtime is instantiated, a number of WASM pages are allocated for the Substrate
|
||||
// Runtime instance's linear memory. The exact number of pages is a sum of whatever the WASM blob
|
||||
// itself requests (by default at least enough to hold the data section as well as have some space
|
||||
// left for the stack; this is, of course, overridable at link time when compiling the runtime)
|
||||
// plus the number of pages specified in the `extra_heap_pages` passed to the executor.
|
||||
//
|
||||
// By default, rustc (or `lld` specifically) should allocate 1 MiB for the shadow stack, or 16 pages.
|
||||
// The data section for runtimes are typically rather small and can fit in a single digit number of
|
||||
// WASM pages, so let's say an extra 16 pages. Thus let's assume that 32 pages or 2 MiB are used for
|
||||
// these needs by default.
|
||||
const DEFAULT_HEAP_PAGES_ESTIMATE: u64 = 32;
|
||||
const EXTRA_HEAP_PAGES: u64 = 2048;
|
||||
|
||||
const CONFIG: Config = Config {
|
||||
// Memory configuration
|
||||
//
|
||||
// When Substrate Runtime is instantiated, a number of wasm pages are mounted for the Substrate
|
||||
// Runtime instance. The number of pages is specified by `heap_pages`.
|
||||
//
|
||||
// Besides `heap_pages` linear memory requests an initial number of pages. Those pages are
|
||||
// typically used for placing the so-called shadow stack and the data section.
|
||||
//
|
||||
// By default, rustc (or `lld` specifically) allocates 1 MiB for the shadow stack. That is, 16
|
||||
// wasm pages.
|
||||
//
|
||||
// Data section for runtimes are typically rather small and can fit in a single digit number of
|
||||
// wasm pages.
|
||||
//
|
||||
// Thus let's assume that 32 pages or 2 MiB are used for these needs.
|
||||
//
|
||||
// Note that the memory limit is specified in bytes, so we multiply this value
|
||||
// by wasm page size -- 64 KiB.
|
||||
max_memory_size: Some((2048 + 32) * 65536),
|
||||
heap_pages: 2048,
|
||||
// NOTE: This is specified in bytes, so we multiply by WASM page size.
|
||||
max_memory_size: Some(((DEFAULT_HEAP_PAGES_ESTIMATE + EXTRA_HEAP_PAGES) * 65536) as usize),
|
||||
|
||||
allow_missing_func_imports: true,
|
||||
cache_path: None,
|
||||
semantics: Semantics {
|
||||
extra_heap_pages: EXTRA_HEAP_PAGES,
|
||||
|
||||
fast_instance_reuse: false,
|
||||
// Enable deterministic stack limit to pin down the exact number of items the wasmtime stack
|
||||
// can contain before it traps with stack overflow.
|
||||
|
||||
Reference in New Issue
Block a user