Skip to main content

batch_over_the_limit

Function batch_over_the_limit 

Source
pub fn batch_over_the_limit(limits: &PeerLimits) -> Result<PushBatch, Violation>
Expand description

A batch one byte over limits.max_batch_bytes, built from events no larger than limits.max_event_bytes, so a peer that checks both refuses it for the batch and not for any one event.

For a fixture whose peer refuses an oversized push, which is the one refusal every peer that honours its own [PeerLimits] can be driven into. The payloads are zero bytes and are never parsed (SY-35).

§Errors

A Violation of SY-36 if limits.max_batch_bytes is above MAX_PROVOKED_BATCH_BYTES. The batch is built in memory, so a peer that declares more than that would have the suite allocate whatever it claimed; such a peer’s fixture must provoke its own oversized refusal, by a route that does not materialise the whole batch.

A Violation of SY-36 if the batch would need more events than one origin can number. Unreachable under the ceiling.