Skip to documentation
SLOP

tiny.machine.Checkpoint

Reference tiny.machine Checkpoint

Defined in tiny.machine.

A borrowed handle to published checkpoint metadata and a normalized memory image.

API (8)

Actions

Public operations.

Fields and members

Public fields and members.

No direct callersNo direct callstiny.machineCheckpoint
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/machine/src/checkpoint/owner/state.zig:107

zig
/// A borrowed handle to published checkpoint metadata and a normalized memory/// image. Both regions stay at one address with their bytes untouched while the/// handle lives.pub const Checkpoint = struct {    storage: *const Storage,    ram: []align(layout.page_bytes) const u8,    root_digest: os.abi.Digest,    /// Reports whether the storage is still published under this handle's root.    /// A malformed status byte, or a stored root other than this handle's,    /// returns false.    pub fn active(self: *const @This()) bool {        const owner = ownerStateConst(self.storage);        const status = checkedStatus(owner) catch return false;        return status == .published and owns(self, owner);    }    /// Recomputes the memory, state, and root identities from the stored bytes.    /// Closed, changed, or malformed storage returns the specific checkpoint    /// error.    pub fn verify(self: *const @This()) Error!void {        const owner = ownerStateConst(self.storage);        if (try checkedStatus(owner) != .published) {            return error.CheckpointClosed;        }        try verifyOwner(owner, self.ram);        if (!owns(self, owner)) return error.CheckpointClosed;    }    /// Returns the verified checkpoint root.    pub fn root(self: *const @This()) Error!types.Root {        try self.verify();        return ownerStateConst(self.storage).root;    }    /// Returns the verified checkpoint root together with the digest of the    /// settled receipt.    pub fn identity(self: *const @This()) Error!types.Identity {        try self.verify();        const owner = ownerStateConst(self.storage);        return .{            .root = owner.root,            .semantic = try instance_receipt.semanticReceiptDigest(owner.receipt),        };    }    /// Returns the verified state digest the checkpoint root commits. The    /// caller uses this digest to compare two captures without the    /// configuration they ran under.    pub fn stateDigest(self: *const @This()) Error!types.StateDigest {        try self.verify();        return ownerStateConst(self.storage).root.state;    }};

Source: lib/machine/src/root.zig:75

zig
pub const Checkpoint = checkpoint.Checkpoint;
Called byCallsNo direct callersprivate sourcelib.machine.src.checkpoint.owner.statecheckedStatusprivate sourcelib.machine.src.checkpoint.owner.stateownerStateConstprivate sourcelib.machine.src.checkpoint.owner.stateownsCheckpointactive
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersCheckpointverifyprivate sourcelib.machine.src.checkpoint.owner.stateownerStateConstCheckpointidentity
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callersCheckpointverifyprivate sourcelib.machine.src.checkpoint.owner.stateownerStateConstCheckpointroot
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersCheckpointverifyprivate sourcelib.machine.src.checkpoint.owner.stateownerStateConstCheckpointstateDigest
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsCheckpointidentityCheckpointrootCheckpointstateDigestcheckpointopenprivate sourcelib.machine.src.checkpoint.owner.statecheckedStatusprivate sourcelib.machine.src.checkpoint.owner.stateownerStateConstprivate sourcelib.machine.src.checkpoint.owner.stateownsprivate sourcelib.machine.src.checkpoint.owner.stateverifyOwnerCheckpointverify
Static calls · unresolved targets: 0 · external targets: 0.

Also reachable as

checkpoint.Checkpoint.

Audit

Definitions6
Public names12
Members3
Version26.7.0
Revisiondaab053ee433