aboutsummaryrefslogtreecommitdiffstats
path: root/src/transport/mod.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-07 22:35:21 +0100
committertv <tv@krebsco.de>2026-11-07 22:35:21 +0100
commitc3fde0fdd410902125f006f0a7d77ca030cb9061 (patch)
treed5506388f0f94b77c5172c96074ff68b54186726 /src/transport/mod.rs
parent2ff408c024a0ef5db2a770e8a091783f1b6d9cfc (diff)
signatures: on their own (SIGNATURES)
Signatures no sync message took go on their own within a second, to each peer not sent them yet (wire version bumped). Auth plan M5.
Diffstat (limited to 'src/transport/mod.rs')
-rw-r--r--src/transport/mod.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/transport/mod.rs b/src/transport/mod.rs
index 35e1e5f..a1fb9d5 100644
--- a/src/transport/mod.rs
+++ b/src/transport/mod.rs
@@ -252,6 +252,19 @@ pub(crate) enum ParsedMessage {
NeighbourReply(NeighbourAnswer),
/// Tells the recipient we are neighbours no more (`swarm::hyparview`).
Disconnect(NeighbourAnswer),
+ /// Signatures of changes, sent on their own (`swarm::signatures`).
+ Signatures(SignaturesMessage),
+}
+
+/// SIGNATURES: signatures of changes no sync message took (`swarm::signatures`).
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub(crate) struct SignaturesMessage {
+ #[serde(with = "crate::transport::wire::codec::epoch")]
+ pub(crate) epoch: Epoch,
+ /// See `SyncEnvelope::epoch_seq`.
+ pub(crate) epoch_seq: u32,
+ /// As `SyncEnvelope::signatures`.
+ pub(crate) signatures: serde_bytes::ByteBuf,
}
/// A node's proof that it holds the key of its node ID (`identity`), sending from its
@@ -399,6 +412,7 @@ pub(crate) enum MessageKind {
Neighbour,
NeighbourReply,
Disconnect,
+ Signatures,
}
impl ParsedMessage {
@@ -421,6 +435,7 @@ impl ParsedMessage {
ParsedMessage::Neighbour(_) => MessageKind::Neighbour,
ParsedMessage::NeighbourReply(_) => MessageKind::NeighbourReply,
ParsedMessage::Disconnect(_) => MessageKind::Disconnect,
+ ParsedMessage::Signatures(_) => MessageKind::Signatures,
}
}
@@ -446,6 +461,7 @@ impl ParsedMessage {
ParsedMessage::NeighbourReply(answer) | ParsedMessage::Disconnect(answer) => {
Some((answer.epoch, answer.epoch_seq))
}
+ ParsedMessage::Signatures(message) => Some((message.epoch, message.epoch_seq)),
ParsedMessage::Who(_)
| ParsedMessage::Me(_)
| ParsedMessage::Ping(_)