diff options
Diffstat (limited to 'src/transport/mod.rs')
| -rw-r--r-- | src/transport/mod.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/transport/mod.rs b/src/transport/mod.rs index e0359b0..640754a 100644 --- a/src/transport/mod.rs +++ b/src/transport/mod.rs @@ -576,6 +576,10 @@ pub(crate) struct HelloRequest { /// with all peers, from 1. A retry carries the same number, so the recipient resets /// its sync session only for a new handshake, not for every resend or late copy. pub(crate) handshake: u32, + /// The hash of its epoch's root, where its document holds it (`swarm::roots`): what + /// a joining node takes as the root, where those it hears agree. + #[serde(with = "serde_bytes")] + pub(crate) root: Option<Vec<u8>>, } /// A peer a HELLO_REPLY lists: who it is, and where the sender reaches it. @@ -661,6 +665,9 @@ pub(crate) struct HelloReply { /// The sender's own run (as its HELLOs carry it): a new one means it restarted. #[serde(with = "crate::transport::wire::codec::run_id")] pub(crate) sender_run_id: RunId, + /// As `HelloRequest::root`. + #[serde(with = "serde_bytes")] + pub(crate) root: Option<Vec<u8>>, } /// Bytes shown as lowercase hex, e.g. run IDs in logs. @@ -694,6 +701,7 @@ impl std::fmt::Debug for HelloRequest { .field("ready", &self.ready) .field("run_id", &Hex(&self.run_id)) .field("handshake", &self.handshake) + .field("root", &self.root.as_deref().map(Hex)) .finish() } } @@ -710,6 +718,7 @@ impl std::fmt::Debug for HelloReply { .field("run_id", &Hex(&self.run_id)) .field("away_ms", &self.away_ms) .field("sender_run_id", &Hex(&self.sender_run_id)) + .field("root", &self.root.as_deref().map(Hex)) .finish() } } |
