pub struct KernelCheckpoint { /* private fields */ }Expand description
One logical checkpoint (§12.1).
Fields are private and every digest is computed by Self::assemble, so there is no
constructor that takes a digest and “the host recomputed the hash and disagreed” is not a
reachable state — the same discipline KernelRecord uses.
Decoding goes through the same verification, which is why a tampered blob fails at the boundary
rather than half-way through a restore.
Implementations§
Source§impl KernelCheckpoint
impl KernelCheckpoint
Sourcepub fn assemble(draft: CheckpointDraft) -> Result<Self, CheckpointError>
pub fn assemble(draft: CheckpointDraft) -> Result<Self, CheckpointError>
Build a checkpoint, computing all three digests and checking the tail covers
(base_step_seq, through_step_seq] exactly.
pub fn checkpoint_version(&self) -> u32
pub fn abi_version(&self) -> u32
pub fn operation_id(&self) -> &OperationId
pub fn genesis_digest(&self) -> &Digest
pub fn base_step_seq(&self) -> WireU64
pub fn base_record_digest(&self) -> &Digest
pub fn through_step_seq(&self) -> WireU64
pub fn covered_transaction_head_digest(&self) -> &Digest
pub fn logical_state(&self) -> &LogicalKernelState
pub fn tail_inputs(&self) -> &[CanonicalInput]
pub fn state_digest(&self) -> &Digest
pub fn tail_digest(&self) -> &Digest
pub fn checkpoint_digest(&self) -> &Digest
Sourcepub fn checkpoint_bytes(&self) -> CanonicalBytes
pub fn checkpoint_bytes(&self) -> CanonicalBytes
Canonical bytes of the whole checkpoint — the blob a host persists.
Sourcepub fn from_checkpoint_bytes(bytes: &[u8]) -> Result<Self, CheckpointError>
pub fn from_checkpoint_bytes(bytes: &[u8]) -> Result<Self, CheckpointError>
Decode a checkpoint from its stored bytes, verifying every digest and the tail coverage.
Sourcepub fn boundary(&self) -> CheckpointBoundary
pub fn boundary(&self) -> CheckpointBoundary
The prefix an ack of this checkpoint may reclaim (§12.3 rule 6).
Sourcepub fn into_candidate(self) -> CheckpointCandidate
pub fn into_candidate(self) -> CheckpointCandidate
The §12.3 candidate this checkpoint hands the host.
Sourcepub fn verify(&self) -> Result<(), CheckpointError>
pub fn verify(&self) -> Result<(), CheckpointError>
Recompute every digest from the bytes this checkpoint carries and re-check its tail.
The first two lines of §12.2’s ladder. verify_belongs_to adds the operation/genesis half;
the version halves are enforced by the decoder, which cannot produce a checkpoint whose
checkpoint_version or abi_version this kernel does not read.
Sourcepub fn verify_belongs_to(
&self,
operation_id: &OperationId,
genesis_digest: &Digest,
) -> Result<(), CheckpointError>
pub fn verify_belongs_to( &self, operation_id: &OperationId, genesis_digest: &Digest, ) -> Result<(), CheckpointError>
Whether this checkpoint is this operation’s (§12.2 line 2).
Trait Implementations§
Source§impl Clone for KernelCheckpoint
impl Clone for KernelCheckpoint
Source§fn clone(&self) -> KernelCheckpoint
fn clone(&self) -> KernelCheckpoint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more