Skip to main content

MAX_DEPTH

Constant MAX_DEPTH 

Source
pub const MAX_DEPTH: usize = 5_000;
Expand description

Nesting deeper than this is rejected with TOO_DEEP.

It is above the about 4,100 levels zero-cache can write, so the client takes any value the server sends. JS has no limit short of its own stack; see rust/PARITY.md. Parsing, cloning, comparing, and writing a value don’t recurse that deep, and dropping one fits in a 2 MB thread stack (the default for spawned Rust threads) even in a debug build.