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

no-std polkadot-parachain-primitives

Types and utilities for creating and working with parachains

16 major breaking releases

16.0.0 Jan 22, 2025
15.0.0 Jan 7, 2025
14.0.0 Jul 18, 2024
13.0.0 Jun 21, 2024
0.0.0 Sep 8, 2023

#576 in Magic Beans

Download history 1940/week @ 2024-10-12 2569/week @ 2024-10-19 2313/week @ 2024-10-26 3817/week @ 2024-11-02 21135/week @ 2024-11-09 27853/week @ 2024-11-16 29931/week @ 2024-11-23 23206/week @ 2024-11-30 31444/week @ 2024-12-07 24225/week @ 2024-12-14 7394/week @ 2024-12-21 12256/week @ 2024-12-28 22675/week @ 2025-01-04 34245/week @ 2025-01-11 31024/week @ 2025-01-18 24796/week @ 2025-01-25

115,749 downloads per month
Used in 181 crates (48 directly)

GPL-3.0-only

22KB
292 lines

Release

Polkadot SDK Stable 2412


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

~17–30MB
~477K SLoC