Expand description
Receipt domain types: ReceiptStatus, Receipt, ReceiptList.
§Requirements trace
- RCP-001 —
ReceiptStatusdiscriminants0..=4and255. - RCP-002 —
Receiptfield layout (tx id, height, index, status, fees, state). - NORMATIVE — receipt domain obligations.
- RCP-003 —
ReceiptList: storage, MerkleReceiptList::root, accessors. - RCP-004 —
ReceiptList::len, success/failure counts,ReceiptList::total_fees. - SPEC §2.9 — receipt payload context.
- HSH-008 — receipts Merkle algorithm (same as this module’s root helper; see note below).
§Rationale
#[repr(u8)]: Stable single-byte tags for bincode payloads and receipt Merkle leaves (RCP-001 implementation notes).Failed = 255: Leaves5..=254for future specific failure codes without renumbering existing wire values.ReceiptStatus::from_u8: Unknown bytes map toReceiptStatus::Failedso forward-compatible decoders never panic (RCP-001 implementation notes).ReceiptList::pushwithout immediate root update: Batch amortization per RCP-003; callers mustReceiptList::finalize(or useReceiptList::from_receipts).compute_receipts_root: HSH-008 algorithm lives in this module (bincode leaf +MerkleTree); re-exported ascrate::compute_receipts_rootfrom the crate root (types::receipt) to avoidmerkle_util↔Receiptdependency cycles while keeping one normative implementation forReceiptList.- Aggregates (RCP-004):
failure_countis any status other thanReceiptStatus::Success;ReceiptList::total_feessumsReceipt::fee_chargedfor all rows (fees still charged on failed execution per spec notes). Used by checkpoint / epoch summaries (CKP-006 when implemented).
Structs§
- Receipt
- Result of executing one transaction inside a block (RCP-002, SPEC §2.9).
- Receipt
List - Ordered block receipts with a commitments root (RCP-003, SPEC §2.9).
Enums§
- Receipt
Status - Outcome of applying one transaction in a block (SPEC §2.9, RCP-001).
Functions§
- compute_
receipts_ root - Merkle root over ordered receipts: SHA-256(bincode(
Receipt)) per leaf, thenMerkleTree(HSH-008).