Skip to main content

MAX_PROOF_DEPTH

Constant MAX_PROOF_DEPTH 

Source
pub const MAX_PROOF_DEPTH: usize = 32;
Expand description

Maximum delegation-chain (nested-proof) depth this validator will walk. A chain deeper than this is rejected fail-closed (ChainError::DepthExceeded) before recursion can exhaust the stack. UCAN delegation chains are short by construction (a handful of hops); this bound is generous for legitimate use while capping a hostile proofs-within-proofs nesting (a DoS vector at both parse time and walk time). The same bound is enforced at CBOR decode in super::token::Ucan::from_cbor so an over-deep token is refused before it is ever walked.