Expand description
L2Block — full L2 block: header, transaction body (SpendBundles), slash proposal payloads, proposer signature.
Requirements:
- BLK-003 — struct +
new/hash/height/epoch - HSH-003 —
crate::compute_spends_root(spends Merkle root) - HSH-004 —
crate::compute_additions_root(additions Merkle set) - HSH-005 —
crate::compute_removals_root(removals Merkle set) - HSH-006 —
crate::compute_filter_hash(BIP-158;L2Block::compute_filter_hashkeys SipHash withL2BlockHeader::parent_hashper SPEC §6.4) - BLK-004 — Merkle roots, BIP158
filter_hashpreimage, additions/removals collectors, duplicate / double-spend probes, serialized size - SVL-005 — header/body count agreement
(
L2Block::validate_structure; SPEC §5.2 steps 2, 4, 5, 13) before expensive Merkle checks (SVL-006) - SER-002 —
L2Block::to_bytes/L2Block::from_bytes(bincode +BlockError::InvalidDataon decode) - SPEC §2.3, SPEC §3.3–§3.6 — body commitments + filter
§Usage
Build a block by assembling an L2BlockHeader (commitments, roots, counts) and the body fields.
Canonical identity is L2Block::hash → L2BlockHeader::hash only; spend bundles and slash
bytes are committed via Merkle roots in the header, not mixed into this hash (SPEC §2.3 / BLK-003 notes).
§Rationale
SpendBundlecomes fromchia-protocolso CLVM spends match L1/Chia tooling (BLK-003).Signatureis thechia-blstype re-exported ascrate::primitives::Signature(BLK-006) so callers import onedig_blocksurface.slash_proposal_payloadsareVec<Vec<u8>>for opaque slash evidence (encoding evolves independently).
Structs§
- L2Block
- Complete L2 block: header plus body (spend bundles, slash payloads) and proposer attestation.