pub struct HighWaterMarks { /* private fields */ }Expand description
Persisted high-water marks, one per release line, stored under the varve root (NOT inside the core — the core holds evidence, this is client state).
Implementations§
Source§impl HighWaterMarks
impl HighWaterMarks
Sourcepub fn load(root: &Path) -> Result<Self, RollbackError>
pub fn load(root: &Path) -> Result<Self, RollbackError>
Load the marks stored under root (missing file = first contact).
Sourcepub fn check(&self, manifest: &LayerManifest) -> RollbackVerdict
pub fn check(&self, manifest: &LayerManifest) -> RollbackVerdict
Check a manifest against the marks. Accept does NOT advance the
mark — call Self::advance after the layer is fully verified and
laid down, so a failed install cannot burn the mark.
Sourcepub fn check_with_floor(
&self,
manifest: &LayerManifest,
floor: Option<u64>,
) -> RollbackVerdict
pub fn check_with_floor( &self, manifest: &LayerManifest, floor: Option<u64>, ) -> RollbackVerdict
The check, with the realm’s signed per-line floor when one is known (REQ-FIRSTCONTACT-001).
floor must come from a line-status document that has ALREADY been
verified against the realm’s trust root. An unverified floor would be
an attacker-chosen number, and a floor of zero from a forged document
is worse than no floor at all — it looks like protection.
The local mark still wins where it is higher: a consumer who has accepted counter 9 must not be walked back to a realm-stated floor of 3. The floor raises the bottom for someone who has no history; it never lowers it for someone who does.
Sourcepub fn advance(&mut self, manifest: &LayerManifest) -> Result<(), RollbackError>
pub fn advance(&mut self, manifest: &LayerManifest) -> Result<(), RollbackError>
Record acceptance of a manifest: raise the line’s mark to the manifest’s counter (never lowers) and persist.