Based on EIP 150 change the call depth attach.
Note that with the given parameters, the de-facto maximum call stack depth is limited to ~340 (down from ~1024), mitigating the harm caused by any further potential quadratic-complexity DoS attacks that rely on calls.
On this accepted answer:
With the new rules, the call cannot consume more than 63/64 of the gas of the parent. So if your gas is X, then N CALLs in, it will be max X * (63/64)^n.
[Q] Is this statement correct with the new rules?
Based on my calculations following statement is wrong:
if your gas is X, then N CALLs in, it will be max X * (63/64)^n
because we also need to add cumulative gas-sum till the
nth call on the stack.
Hence Till we reach
(n-1)th call the parent's gas will be decrease as new gas value:
X_n' at each stack level.
1 => X_1 = X * (63/64)^n 2 => X_2 = X_1 * (63/64)^n //X_1 is used instead of X 3 => X_3 = X_2 * (63/64)^n //X_2 is used instead of X ... N => X_(N) = X_(N-1) * (63/64)^n 1022 => X_1022 = X_1021 * (63/64)^n //X_1021 is used instead of X 1023 => X_1023 = X_1022 * (63/64)^n //X_1022 is used instead of X
So Nth call should be something like:
X_n * (63/64)^n, where
X_n should be much smaller than original X. So gas consumption limit gets much smaller.
Overall, the main question I have is:
[Q] How EIP 150 gas cost algorithm works on each stack level? and how gas consumption limit is affected at each stack level?
Please note that I am not questioning the answer, I just want to understand what should be correct.
Thank you for your valuable time and help.