Struct PeerLimits
#[non_exhaustive]pub struct PeerLimits {
pub max_event_bytes: usize,
pub max_batch_bytes: usize,
pub max_batch_events: usize,
pub retention_floor: Option<EventId>,
}Expand description
What a peer can accept.
Read before pushing. The contract bounds an event type and a tag at 255 bytes each and leaves the payload unbounded, so an event that is durable at its origin can be structurally unrepresentable at a peer — a KV-backed store with a 128 KiB value cap against an origin that has already committed 340 KB.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_event_bytes: usizeLargest single event payload, in bytes.
A peer below the contract’s own floor is non-conformant, not merely small.
max_batch_bytes: usizeLargest total payload in one push, in bytes.
The one-shot HTTP peer’s ceiling is a response size, and it is the reason
this is separate from max_event_bytes: a peer can be fine with a large
event and unable to carry sixty of them.
max_batch_events: usizeLargest number of events in one push.
retention_floor: Option<EventId>The newest event this peer has pruned, if any: a token must have reached it to resume.
ADR-0028 (.kb/decisions/0028-what-a-store-may-forget.md:236-237) says “the lowest
resume point this peer can still satisfy”: the same under a token’s “after” reading,
and #163 reconciles the words. A pull below it fails Reseed
and is reported, not retried (SY-32). Nothing above it is promised kept. None: no pruning.
Implementations§
§impl PeerLimits
impl PeerLimits
pub const fn minimum() -> Self
pub const fn minimum() -> Self
The smallest limits a conformant peer may declare.
64 KiB per event is the contract’s own floor for what a store must accept; a peer that cannot manage that is not a peer.