From b33f4235fe16b8160afb60d0bd743f4c81d9d0ab Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 8 Nov 2026 23:03:42 +0000 Subject: sync: a message carries the signatures of its changes A sync message carried the signatures its peer wasn't sent yet, by a cursor per peer. Changes sent again, as after a message taken as delivered and lost on the way, went without them: the peer was past them. Under a policy requiring signatures they waited until the writer's next signed change, or the next session. A message now carries the signatures of the changes it carries (Signatures::for_changes), whatever the peer was sent before: changes sent again arrive vouched for as the first time. Past 256 (a message carrying the batches of many writers), each writer's latest instead, as a delta carries. The cursor goes, and with it resetting it after a failed send or a new session. --- docs/api.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/api.md b/docs/api.md index 0d96dde..302df5d 100644 --- a/docs/api.md +++ b/docs/api.md @@ -283,10 +283,11 @@ the signatures entirely. A swarm whose policy requires signatures `none` too: every change must arrive vouched for. Signatures travel with the changes, in the sync messages that carry them, along the -same paths: a node passes on, for each node's writes, the latest signature it checked, -and checks one it receives once it holds the change (a signature costs about 30 µs to -check, and one vouches for its node's changes before it). A message carrying no -changes carries no signatures. A node that stopped with changes it never sent, nor +same paths: a message carries the signatures of the changes it carries, whatever the +peer was sent before, so changes sent again (a message lost on the way) arrive +vouched for as the first time; and a node checks one it receives once it holds the +change (a signature costs about 30 µs to check, and one vouches for its node's changes +before it). A message carrying no changes carries no signatures. A node that stopped with changes it never sent, nor signed, signs them as it starts, before anything leaves. The signatures a node has are kept in its document file (`--document-file`) with the document. -- cgit v1.3.1