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/state/peer.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/state/peer.rs') diff --git a/src/state/peer.rs b/src/state/peer.rs index 7000386..e0b161d 100644 --- a/src/state/peer.rs +++ b/src/state/peer.rs @@ -98,6 +98,9 @@ pub(crate) struct PeerState { /// Everything about the current Automerge sync with this peer; a reset replaces it. pub(crate) sync: SyncSession, + /// The signatures of changes it was sent, up to this stamp + /// (`Signatures::newer_than`); a reset sends them again. + pub(crate) signatures_sent: u64, pub(crate) liveness: Liveness, pub(crate) added_at: Instant, @@ -300,6 +303,7 @@ impl PeerState { hello_backoff: Backoff::new(HELLO_RETRY, HELLO_RETRY_MAX), probe_backoff: timing.probe_backoff(), sync: SyncSession::new(timing.sync_reply_backoff()), + signatures_sent: 0, liveness: Liveness::Unknown, added_at: Instant::now(), last_seen: None, @@ -369,6 +373,7 @@ impl PeerState { let mut reply_backoff = self.sync.reply_backoff; reply_backoff.reset(); self.sync = SyncSession::new(reply_backoff); + self.signatures_sent = 0; // Said over the session that ended. self.reaches = None; self.round_trips = None; -- cgit v1.3.1