tiny.machine.Checkpoint
Defined in tiny.machine.
A borrowed handle to published checkpoint metadata and a normalized memory image.
API (8)
Actions
Public operations.
active: Reports whether the storage is still published under this handle's root.identity: Returns the verified checkpoint root together with the digest of the settled receipt.root: Returns the verified checkpoint root.stateDigest: Returns the verified state digest the checkpoint root commits.verify: Recomputes the memory, state, and root identities from the stored bytes.
Fields and members
Public fields and members.
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;Also reachable as
Audit
| Definitions | 6 |
|---|---|
| Public names | 12 |
| Members | 3 |
| Version | 26.7.0 |
| Revision | daab053ee433 |