Skip to main content

MAX_SNAPSHOT_JSON_BYTES

Constant MAX_SNAPSHOT_JSON_BYTES 

Source
pub const MAX_SNAPSHOT_JSON_BYTES: usize = _; // 67_108_864usize
Expand description

Maximum byte length accepted by the validated restore entry points (from_json in Python/WASM bindings and [Snapshot::from_json_validated]).

The limit is intentionally generous (64 MiB) so that legitimately large model state (e.g. high-dimensional FTRL or LinUCB) is not rejected, while still bounding memory growth from untrusted JSON input. The limit is enforced on the raw JSON byte length before deserialization so a malicious payload cannot allocate a large intermediate serde_json::Value tree.