From 282eda719a303b4f5ae8ae05f0c11cac7b4a52ea Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 26 Oct 2026 22:16:34 +0100 Subject: reject and warn about too large delta blobs --- src/swarm/blob.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/swarm/blob.rs') 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>, hashes: Vec<[u8; 32]>, -- cgit v1.3.1