Finschia/cosmwasm

Why is limit of callstack 5?

da1suk8 opened this issue · 0 comments

Currently, the limit of the call stack is defined as 5.
It is mainly used in the following codes.

pub const DYNAMIC_CALL_DEPTH_LIMIT_CNT: usize = 5;

if ctx.dynamic_callstack.len() >= DYNAMIC_CALL_DEPTH_LIMIT_CNT {
return Err(VmError::dynamic_call_depth_over_limitation_err());
}

if callstack.len() >= DYNAMIC_CALL_DEPTH_LIMIT_CNT {
return Err(VmError::dynamic_call_depth_over_limitation_err());
};

Check callstack limits and fix if necessary.