pub struct CheckpointLineageVerifier { /* private fields */ }Expand description
Streaming verifier for a checkpoint lineage read from newest to oldest.
The verifier starts from an exact trusted tip and accepts only the full checkpoint named by that head, followed by its exact parent, until the superstep-zero root is reached. It buffers one compact head rather than the checkpoint state history, so stores can validate arbitrarily long lineages through bounded reverse pages. Rejection leaves the verifier unchanged.
Implementations§
Source§impl CheckpointLineageVerifier
impl CheckpointLineageVerifier
Sourcepub const fn from_tip(tip: CheckpointHead) -> Self
pub const fn from_tip(tip: CheckpointHead) -> Self
Constructs a reverse-lineage verifier from an exact checkpoint tip.
Sourcepub const fn expected(&self) -> Option<&CheckpointHead>
pub const fn expected(&self) -> Option<&CheckpointHead>
Returns the exact checkpoint head required next, or None at the root.
Sourcepub const fn is_complete(&self) -> bool
pub const fn is_complete(&self) -> bool
Returns whether the complete lineage through superstep zero was accepted.
Sourcepub fn verify_next(
&mut self,
checkpoint: &Checkpoint,
) -> Result<(), CheckpointLineageError>
pub fn verify_next( &mut self, checkpoint: &Checkpoint, ) -> Result<(), CheckpointLineageError>
Verifies and accepts the next checkpoint in newest-to-oldest order.
§Errors
Returns CheckpointLineageError::HeadMismatch when checkpoint is
not the exact full value named by the expected head, or
CheckpointLineageError::AlreadyComplete after the root was accepted.