Expand description
Checkpoint domain types: Checkpoint (CKP-001), CheckpointSubmission (CKP-002).
§Requirements trace
- CKP-001 —
Checkpoint: nine public fields +Checkpoint::newdefault instance. - CKP-002 —
CheckpointSubmission: checkpoint +crate::SignerBitmap+ aggregate BLS + score + submitter + L1 tracking options. - NORMATIVE § CKP-001 / CKP-002 — checkpoint + submission field layouts and constructors.
- SPEC §2.6 — checkpoint as epoch summary anchored toward L1.
- CKP-004 —
Checkpoint::compute_score:stake_percentage * block_count(epoch competition score). - CKP-005 —
CheckpointSubmission:CheckpointSubmission::hash,CheckpointSubmission::epoch, threshold helpers, L1CheckpointSubmission::record_submission. - CKP-006 —
crate::CheckpointBuilderaccumulates block / withdrawal hashes and producesblock_root/withdrawals_rootusing the same internal Merkle helper as BLK-004 (merkle_tree_rootinmerkle_util.rs). - HSH-002 / SPEC §3.2 —
Checkpoint::hash: SHA-256 over 160-byte fixed-order preimage (chia_sha2::Sha256). - SER-001 — bincode via
Serialize/Deserializeon wire-bearing structs. - SER-002 —
Checkpoint::to_bytes/Checkpoint::from_bytesandCheckpointSubmission::to_bytes/CheckpointSubmission::from_byteswithCheckpointError::InvalidDataon decode failures.
§Rationale
- Public fields: Same ergonomics as
crate::types::receipt::Receipt— consensus / builder layers assign values; this crate stays a typed bag of record (CKP-001 acceptance: read/write access). - Default roots:
Bytes32::defaultis the all-zero hash, matching “empty Merkle” conventions used elsewhere (crate::constants::EMPTY_ROOTis the documented empty-tree sentinel; callers may normalize roots when building real checkpoints — CKP-006). CheckpointSubmission+ L1 options:submission_height/submission_coinstartNoneat construction;CheckpointSubmission::record_submissionpersists L1 proof (CKP-005, CKP-002 notes).
Structs§
- Checkpoint
- Epoch summary checkpoint: aggregate stats and Merkle roots for one L1-anchored epoch (SPEC §2.6, CKP-001).
- Checkpoint
Submission - Signed checkpoint submission: epoch summary plus validator attestation material (SPEC §2.7, CKP-002).