aboutsummaryrefslogtreecommitdiffstats
path: root/src/transport
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-03 05:20:59 +0100
committertv <tv@krebsco.de>2026-11-03 05:20:59 +0100
commit96d7744dd29a3c783b43a7a6697af7d5d5719a10 (patch)
treeddc154200b6086f5f9832237b6a620670ba8b4c3 /src/transport
parent9ee8bae8cd740fc038ac6ca14eae4fad458cda31 (diff)
add writer trees
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/mod.rs4
-rw-r--r--src/transport/wire.rs3
2 files changed, 6 insertions, 1 deletions
diff --git a/src/transport/mod.rs b/src/transport/mod.rs
index 9ae8ff2..899f4b8 100644
--- a/src/transport/mod.rs
+++ b/src/transport/mod.rs
@@ -670,6 +670,10 @@ pub(crate) struct SyncEnvelope {
/// not one it is still filling (joining, rejoining). Only such a peer can tell a
/// catching-up node that it has everything; an empty document says nothing else.
pub(crate) ready: bool,
+ /// Whose change it passes on along the writer's tree (`swarm::tree`), by pair key:
+ /// the writer's, on its own push and on every member's after; None otherwise
+ /// (answers, pulls).
+ pub(crate) writer: Option<u64>,
}
/// What a sync envelope carries.
diff --git a/src/transport/wire.rs b/src/transport/wire.rs
index a6ca286..8e3baa6 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 = 21;
+pub(crate) const VERSION: u8 = 22;
/// What the second byte of a payload says.
fn tag(kind: MessageKind) -> u8 {
@@ -410,6 +410,7 @@ pub(crate) fn samples() -> Vec<ParsedMessage> {
to: vec![ChangeHash([2; 32])],
}),
ready: true,
+ writer: Some(7),
}),
ParsedMessage::Status(status.clone()),
ParsedMessage::StatusReply(status),