From 2ff408c024a0ef5db2a770e8a091783f1b6d9cfc Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 7 Nov 2026 22:35:21 +0100 Subject: signatures: with sync messages Sync messages carry, for each actor's writes, the latest signature the sender checked; the receiver checks it once it holds the change. Auth plan M5. --- src/transport/mod.rs | 4 ++++ src/transport/wire.rs | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/transport') diff --git a/src/transport/mod.rs b/src/transport/mod.rs index f5b2db1..35e1e5f 100644 --- a/src/transport/mod.rs +++ b/src/transport/mod.rs @@ -704,6 +704,10 @@ pub(crate) struct SyncEnvelope { /// When the sender generated it, by its clock: the receiver takes how long it took /// to come (`swarm::hop`). pub(crate) sent: crate::clock::UnixMillis, + /// Signatures of changes (`document::signatures`): each actor's latest the sender + /// verified that it didn't send this peer yet, `signatures::MAX_PER_MESSAGE` at + /// most, as `signatures::pack` packs them. + pub(crate) signatures: serde_bytes::ByteBuf, } /// An epoch, as sync messages name it: its generation and the first bytes of its ID, diff --git a/src/transport/wire.rs b/src/transport/wire.rs index 8ead9b0..97f8819 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 = 39; +pub(crate) const VERSION: u8 = 40; /// What the second byte of a payload says. fn tag(kind: MessageKind) -> u8 { @@ -479,6 +479,7 @@ pub(crate) fn samples() -> Vec { writer: Some(7), delivered: true, sent: crate::clock::UnixMillis(8), + signatures: serde_bytes::ByteBuf::from(vec![9; 96]), }), ParsedMessage::Status(status.clone()), ParsedMessage::StatusReply(status), -- cgit v1.3.1