Crate concordium_wasm

Crate concordium_wasm 

Source
Expand description

This library provides an implementation of a Wasm execution engine modified to suit Concordium’s needs. In particular it implements

  • parsing and validation of Wasm modules, where validation is according to Wasm core 1 spec with additional restrictions necessary for blockchain use.
  • a compiler to a lower-level format that is easier to execute
  • an interpreter
  • utilities for storing and loading processed code (the Artifact)

The utils module provides the convenience wrappers that expose high-level functionality. The remaining modules contain low-level details.

Modules§

artifact
This module defines the notion of the Artifact, which is a processed and instantiated module that can have its exposed methods invoked via the Artifact::run method.
constants
Core constants used in parsing and validation.
machine
An implementation of the abstract machine that can run artifacts. This module defines types related to code execution. The functions to run code are defined as methods on the Artifact type, e.g., Artifact::run.
output
Functionality for outputting Wasm modules in binary format.
parse
This module defines a parser for the Web assembly binary format conforming to the specification in wasm-core-1-20191205 but with further restrictions to ensure suitability for the Concordium blockchain.
types
AST definition of Wasm modules, as well as supporting datatypes. Based on the W3C Wasm specification
utils
Common utilities for Wasm transformations. These are wrappers around the basic functionality exposed by other modules.
validate
Utilities for Wasm module validation.

Structs§

CostConfigurationV0
Cost configuration for the initial version of the execution engine used in node versions 1-6. This is more expensive compared to CostConfigurationV1.
CostConfigurationV1
Cost configuration for the initial version of the execution engine used in node versions 1-6. This is more expensive compared to CostConfigurationV1.

Traits§

CostConfiguration
Definition of energy costs of instructions.