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

#18 in #parachain

Download history 14382/week @ 2024-12-31 24095/week @ 2025-01-07 36356/week @ 2025-01-14 30870/week @ 2025-01-21 27254/week @ 2025-01-28 30830/week @ 2025-02-04 37674/week @ 2025-02-11 33119/week @ 2025-02-18 8119/week @ 2025-02-25 5457/week @ 2025-03-04 7890/week @ 2025-03-11 5464/week @ 2025-03-18 7161/week @ 2025-03-25 6309/week @ 2025-04-01 7390/week @ 2025-04-08 5532/week @ 2025-04-15

27,353 downloads per month
Used in 228 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–31MB
~507K SLoC