pub fn update_checkpoint_cache(
cache_path: &Path,
new_checkpoint: &SignedCheckpoint,
consistency_proof: &ConsistencyProof,
_trust_root: &TrustRoot,
_now: DateTime<Utc>,
) -> Result<ConsistencyReport, TransparencyWorkflowError>Expand description
Update the local checkpoint cache after verifying consistency.
Loads the cached checkpoint from disk, verifies that the new checkpoint is a consistent append-only extension of the cached one, and writes the new checkpoint to disk.
Note: Uses blocking std::fs I/O (not tokio::fs). This is acceptable
for the current use case — a single small JSON file read/write from CLI context.
If called from a multi-threaded async server, wrap in tokio::task::spawn_blocking.
Args:
cache_path— Path to the cached checkpoint JSON file.new_checkpoint— The newly received signed checkpoint.consistency_proof— Proof that old tree is a prefix of the new tree._trust_root— Trust root for checkpoint signature verification (reserved for future use)._now— Injected wall-clock time (reserved for future use).
Usage:
ⓘ
let report = update_checkpoint_cache(
&cache_path,
&new_checkpoint,
&consistency_proof,
&trust_root,
now,
)?;