#parachain #primitive #polkadot #pointers #validation #length #format

no-std polkadot-parachain-primitives

Types and utilities for creating and working with parachains (polkadot v1.15.0)

14 major breaking releases

14.0.0 Jul 18, 2024
13.0.0 Jun 21, 2024
12.0.0 May 23, 2024
11.0.0 Apr 30, 2024
0.0.0 Sep 8, 2023

#27 in #parachain

Download history 1591/week @ 2024-07-29 1506/week @ 2024-08-05 1907/week @ 2024-08-12 2042/week @ 2024-08-19 1901/week @ 2024-08-26 1206/week @ 2024-09-02 1448/week @ 2024-09-09 1362/week @ 2024-09-16 1793/week @ 2024-09-23 1874/week @ 2024-09-30 1684/week @ 2024-10-07 2056/week @ 2024-10-14 2472/week @ 2024-10-21 2348/week @ 2024-10-28 3807/week @ 2024-11-04 22906/week @ 2024-11-11

31,745 downloads per month
Used in 180 crates (46 directly)

GPL-3.0-only

21KB
292 lines

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

~16–29MB
~465K SLoC