Skip to main content

get_stack_height

Function get_stack_height 

Source
pub fn get_stack_height() -> u64
Expand description

Get the current instruction stack height.

Returns 1 for top-level instructions invoked by the runtime. Returns 2+ for instructions running inside a CPI call.

Use this to implement CPI guards that prevent unauthorized composition.