weir_core/version.rs
1//! Wire-protocol version and the absolute payload-size ceiling — the protocol
2//! constants every layer shares.
3
4/// Current wire protocol version. Strict equality is enforced on decode — no forward compatibility.
5/// Incrementing this value is a breaking change: all clients must be updated before the daemon.
6pub const WIRE_VERSION: u8 = 1;
7
8/// Absolute ceiling on payload size across all callers: socket layer, WAB recovery, and drain.
9/// Defined here so the compiler enforces a single source of truth at the crate boundary.
10/// Any site that needs a payload size cap must import this constant, not define its own.
11/// 16 MiB is large enough for any reasonable record and small enough to bound memory pressure
12/// during recovery (worst case: one corrupt segment with max-size records).
13pub const MAX_PAYLOAD_HARD_CAP: usize = 16 * 1024 * 1024;