Skip to main content

Module executor

Module executor 

Source
Expand description

WebAssembly runtime code execution.

WebAssembly (often abbreviated Wasm) plays a big role in Substrate/Polkadot. The storage of each block in the chain has a special key named :code which contains the WebAssembly code of what we call the runtime.

The runtime is a program (in WebAssembly) that decides, amongst other things, whether transactions are valid and how to apply them on the storage, and whether blocks themselves are valid.

This module contains everything necessary to execute runtime code. The highest-level sub-module is runtime_call.

Re-exports§

pub use host::CoreVersion;
pub use host::CoreVersionError;
pub use host::CoreVersionRef;

Modules§

host
Wasm virtual machine specific to the Substrate/Polkadot Runtime Environment.
runtime_call
Wasm virtual machine, with automatic storage overlay.
storage_diff
“Diff” between a trie and the next.
trie_root_calculator
Given as input a partial base trie and a diff, calculates the new root of the trie.
vm
General-purpose WebAssembly virtual machine.

Enums§

InvalidHeapPagesError
Error potentially returned by storage_heap_pages_to_value.

Constants§

DEFAULT_HEAP_PAGES
Default number of heap pages if the storage doesn’t specify otherwise.

Functions§

storage_heap_pages_to_value
Converts a value of the key :heappages found in the storage to an actual number of heap pages.