Skip to main content

Module wire

Module wire 

Source
Expand description

Chia [Streamable] wire serialization for dig_block::L2Block (SER-003). Chia Streamable wire helpers for gossip / full-node interop (SER-003).

§Usage

§Rationale

  • Differs from storage: crate::store::BlockStore persists bodies via bincode + zstd (SER-001). dig_block::L2Block also implements serde::Serialize for bincode; wire bytes use chia_traits::Streamable (length-prefixed lists, big-endian integers) so tooling matches chia-protocol / Chia nodes ([SER-003] NORMATIVE).
  • No compression: SER-003 §6 — zstd belongs to transport; this layer is pure structure bytes (see tests for no ZSTD_MAGIC prefix).

§Upstream types

  • dig_block::L2Block implements [Streamable] in dig-block (manual impl, field order matches structs) so encoding stays on the type-owning crate; this module is a thin BlockStoreError adapter for dig-blockstore callers.

Functions§

block_from_wire_bytes
Deserialize wire bytes from a peer into L2Block (SER-003).
block_to_wire_bytes
Serialize a block for Chia-style wire/gossip (SER-003).