#parachain #polkadot #validation #primitive #wasm #wasm-module #exports

no-std polkadot-parachain

Types and utilities for creating and working with parachains

5 releases (1 stable)

1.0.0 Aug 8, 2023
0.1.0-dev.6 Aug 5, 2023
0.1.0-dev.3 Aug 4, 2023
0.1.0-dev.1 Aug 3, 2023
0.0.0 Nov 21, 2022

#29 in #exports

Download history 38/week @ 2024-01-01 1/week @ 2024-02-12 44/week @ 2024-02-19 18/week @ 2024-02-26 10/week @ 2024-03-04 6/week @ 2024-03-11 3/week @ 2024-03-18 82/week @ 2024-04-01

93 downloads per month
Used in 5 crates (2 directly)

GPL-3.0-only

20KB
281 lines

Polkadot Parachain

placeholder //TODO Write content :) (https://github.com/paritytech/polkadot/issues/159)


lib.rs:

Defines primitive types for creating or validating a parachain.

When compiled with standard library support, this crate exports a wasm module that can be used to validate parachain WASM.

Parachain WASM

Polkadot parachain WASM is in the form of a module which imports a memory instance and exports a function validate_block.

validate accepts as input two i32 values, representing a pointer/length pair respectively, that encodes ValidationParams.

validate returns an u64 which is a pointer to an u8 array and its length. The data in the array is expected to be a SCALE encoded ValidationResult.

ASCII-diagram demonstrating the return data format:

[pointer][length]
  32bit   32bit
        ^~~ returned pointer & length

The wasm-api (enabled only when std feature is not enabled and wasm-api feature is enabled) provides utilities for setting up a parachain WASM module in Rust.

Dependencies

~14–31MB
~466K SLoC