From a1585a3db53ee59fe941622d698638322b585267 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 4 Nov 2026 22:15:18 +0100 Subject: hop delays --- src/transport/mod.rs | 3 +++ src/transport/wire.rs | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src/transport') diff --git a/src/transport/mod.rs b/src/transport/mod.rs index 426ef72..ae6b593 100644 --- a/src/transport/mod.rs +++ b/src/transport/mod.rs @@ -671,6 +671,9 @@ pub(crate) struct SyncEnvelope { /// heads, and the sender awaits no answer. A receiver it leaves level with the /// sender answers nothing; one that has changes the sender lacks answers with them. pub(crate) delivered: bool, + /// 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, } /// What a sync envelope carries. diff --git a/src/transport/wire.rs b/src/transport/wire.rs index 4199927..d1b3353 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 = 25; +pub(crate) const VERSION: u8 = 26; /// What the second byte of a payload says. fn tag(kind: MessageKind) -> u8 { @@ -411,6 +411,7 @@ pub(crate) fn samples() -> Vec { ready: true, writer: Some(7), delivered: true, + sent: crate::clock::UnixMillis(8), }), ParsedMessage::Status(status.clone()), ParsedMessage::StatusReply(status), -- cgit v1.3.1