16 major breaking releases

16.1.0 Apr 3, 2025
16.0.0 Jan 22, 2025
15.0.0 Jan 7, 2025
14.0.0 Jul 18, 2024
0.0.0 Sep 8, 2023

#34 in #parachain

Download history 7798/week @ 2025-03-08 5675/week @ 2025-03-15 7072/week @ 2025-03-22 6161/week @ 2025-03-29 7358/week @ 2025-04-05 5836/week @ 2025-04-12 7968/week @ 2025-04-19 9858/week @ 2025-04-26 7017/week @ 2025-05-03 5897/week @ 2025-05-10 5633/week @ 2025-05-17 4986/week @ 2025-05-24 5401/week @ 2025-05-31 5152/week @ 2025-06-07 6564/week @ 2025-06-14 6644/week @ 2025-06-21

24,678 downloads per month
Used in 234 crates (50 directly)

GPL-3.0-only

1MB
15K SLoC

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

~18–32MB
~519K SLoC