mesh: a cut journal is caught by the receipts the steward handed out, and the receipt chain survives a restart #306
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/mesh-journal-witness"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What was left open after #301
The journal re-established a grant's spend on restart, but nothing could tell whether records had been cut from its end. Removing a serve's records gave the grant its spend back and unspent its presentation, so a captured presentation could be replayed.
Separately, a restarted steward began a new receipt chain at sequence 0, so a restart looked the same as a log that had lost its history.
The fix
{seq, prev, entry}, whereprevis the BLAKE3 hash of the previous record's encoding. A record removed from the middle, edited or moved fails the replay. Only a cut from the end leaves a whole chain.Sealedrecord holding its sequence and envelope id.ReceiptLog::seal_next/advancesplit sealing from advancing, so a receipt that cannot be recorded is not handed out and the chain does not pass it.Sealedrecord (ReceiptLog::resume), instead of starting over at 0.Mesh::witness(receipt, envelope): anyone holding a receipt this steward sealed can show it. If the journal does not hold it, records were cut after that receipt left, and the spend the steward replayed is less than it signed for. The steward returnsJournalCutand refuses every grant from then on. Ungranted serves are unaffected. A witness that is not the steward's own unaltered receipt isWitnessInvalid.Checked
On the build host:
mesh/1vector is byte-identical.Cargo.lockin the repo is current (--locked), and clippy is clean on mesh-core and mesh-receipt.🤖 Generated with Claude Code
9eb217be9f29ee437557