summaryrefslogtreecommitdiffstats
path: root/src/swarm/blob.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-26 22:16:34 +0100
committertv <tv@krebsco.de>2026-10-26 22:16:34 +0100
commit282eda719a303b4f5ae8ae05f0c11cac7b4a52ea (patch)
treed0dc38b16feb36e080b5dd224c5f11d684d76fec /src/swarm/blob.rs
parent5a32e746cf7aec3e4ca76616b6b66f023de53988 (diff)
reject and warn about too large delta blobs
Diffstat (limited to 'src/swarm/blob.rs')
-rw-r--r--src/swarm/blob.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/swarm/blob.rs b/src/swarm/blob.rs
index 679e1c6..c13bcd9 100644
--- a/src/swarm/blob.rs
+++ b/src/swarm/blob.rs
@@ -88,6 +88,10 @@ pub(crate) struct Blobs {
/// within Mycelium's deadline.
const DELTA_THRESHOLD_CHUNKS: usize = 16;
+/// The largest sync message accepted: the threshold of a sender with the largest chunks
+/// it may have configured. Anything larger comes from a node that doesn't keep to it.
+pub(crate) const MAX_SYNC_MESSAGE: usize = DELTA_THRESHOLD_CHUNKS * MAX_CHUNK as usize;
+
struct Prepared {
bytes: Arc<Vec<u8>>,
hashes: Vec<[u8; 32]>,