Skip to content
Logo

Merkle persistence

The provable outputs (vouchers and notices) live in an outputs merkle tree whose root summarizes everything the application has ever attested. Three methods persist, restore and reset that tree — needed when an application snapshots its own state and must bring the tree along.

Most applications never call these: inside the machine, the tree's lifecycle is handled by the machine snapshotting itself.

rollup.saveMerkle

Stores the current outputs merkle tree state to a file.

.("/state/outputs.merkle");

rollup.loadMerkle

Restores the outputs merkle tree state from a file written by saveMerkle.

.("/state/outputs.merkle");

rollup.resetMerkle

Resets the outputs merkle tree to its pristine (empty) state.

.();

Returns

All three return void.

Parameters

file (saveMerkle / loadMerkle)

  • Type: string
  • Required

Path of the merkle state file.

Errors

ConditionError
File not writable / not readable / corruptRollupError with negative errno