aboutsummaryrefslogtreecommitdiffstats
path: root/src/transport
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-09 17:32:08 +0000
committertv <tv@krebsco.de>2026-11-09 18:55:41 +0100
commitb83bd5bdd9548b0e7ca7b1c9068dd47cdb5246d9 (patch)
treef0070c32d141440986cc0a633d4674968dbcd125 /src/transport
parent4a147c90bfa23d3867f7cc2e15a84ab477f72f1b (diff)
signatures: a transfer carries one signature per writer in it
Under a policy requiring signatures, a node takes a change only once a signature vouches for it: one of the change itself, or of a later change of the same writer. A writer is a node's run, each start, rejoin or drop making a fresh actor, so an epoch gathers writers for as long as it lasts, and a transfer of its whole history (a joiner pulling the document, a delta) must carry a signature for each of them, or the joiner waits for the rest for good. A message's signatures are now chosen by what it carries: * changes, up to 256 signed among them: each one's signature; * more (a whole document pulled): each writer's latest signed change among them, found by the document's change metadata (`Signatures::for_changes`), vouching for the rest; * a delta: each writer with changes in it (`get_changes_meta(from)`), its latest verified signature (`for_delta`). A message carries up to 65536 (6 MiB), and as many wait at the receiver for their changes (a delta's come after it). So a transfer leaves writers unvouched only in an epoch with more than 65536 runs writing since it began; a remake starts the count again. Wire version 48.
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/mod.rs5
-rw-r--r--src/transport/wire.rs2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/transport/mod.rs b/src/transport/mod.rs
index cbb6734..fcdf56e 100644
--- a/src/transport/mod.rs
+++ b/src/transport/mod.rs
@@ -734,8 +734,9 @@ pub(crate) struct SyncEnvelope {
/// to come (`swarm::hop`).
pub(crate) sent: crate::clock::UnixMillis,
/// Signatures of changes (`document::signatures`): of the changes the message
- /// carries, or each actor's latest for a delta or past `signatures::MAX_PER_MESSAGE`
- /// (`Signatures::for_changes`, `latest_each`), as `signatures::pack` packs them.
+ /// carries, each writer's latest among them past a few hundred; of a delta, each
+ /// writer's latest with changes in it (`Signatures::for_changes`, `for_delta`),
+ /// `signatures::MAX_PER_MESSAGE` at most, as `signatures::pack` packs them.
pub(crate) signatures: serde_bytes::ByteBuf,
}
diff --git a/src/transport/wire.rs b/src/transport/wire.rs
index 6784f8e..7fe8983 100644
--- a/src/transport/wire.rs
+++ b/src/transport/wire.rs
@@ -14,7 +14,7 @@ use super::{EncodedMessage, MessageKind, ParsedMessage};
/// The wire format's version, the first byte of every payload. Bump it with every change
/// to a message type or a codec (`golden_bytes` fails then).
-pub(crate) const VERSION: u8 = 47;
+pub(crate) const VERSION: u8 = 48;
/// What the second byte of a payload says.
fn tag(kind: MessageKind) -> u8 {