File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 86
86
where
87
87
K : Kernel < CallManager = Self > ,
88
88
{
89
+ // We check _then_ set because we don't count the top call. This effectivly allows a
90
+ // call-stack depth of `max_call_depth + 1` (or `max_call_depth` sub-calls). While this is
91
+ // likely a bug, this is how NV15 behaves so we mimic that behavior here.
92
+ //
93
+ // By example:
94
+ //
95
+ // 1. If the max depth is 0, call_stack_depth will be 1 and the top-level message won't be
96
+ // able to make sub-calls (1 > 0).
97
+ // 2. If the max depth is 1, the call_stack_depth will be 1 in the top-level message, 2 in
98
+ // sub-calls, and said sub-calls will not be able to make further subcalls (2 > 1).
99
+ //
100
+ // NOTE: Unlike the FVM, Lotus adds _then_ checks. It does this because the
101
+ // `call_stack_depth` in lotus is 0 for the top-level call, unlike in the FVM where it's 1.
89
102
if self . call_stack_depth > self . machine . config ( ) . max_call_depth {
90
103
return Err (
91
104
syscall_error ! ( LimitExceeded , "message execution exceeds call depth" ) . into ( ) ,
You can’t perform that action at this time.
0 commit comments