pub const MAX_STACK_LAYERS: i32 = 32;
A maximum of 32 layers per stack is enough for the expected usage of these APIs.