Expand description
Chia [Streamable] wire serialization for dig_block::L2Block (SER-003).
Chia Streamable wire helpers for gossip / full-node interop (SER-003).
§Usage
- Encode:
block_to_wire_bytes→ append to P2P frames or log captures. - Decode:
block_from_wire_bytesafter stripping transport framing (length prefix, etc.).
§Rationale
- Differs from storage:
crate::store::BlockStorepersists bodies via bincode + zstd (SER-001).dig_block::L2Blockalso implementsserde::Serializefor bincode; wire bytes usechia_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_MAGICprefix).
§Upstream types
dig_block::L2Blockimplements [Streamable] in dig-block (manualimpl, field order matches structs) so encoding stays on the type-owning crate; this module is a thinBlockStoreErroradapter 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).