Maybe sys.setrecursionlimit(20000) does not increase stack size, and AFIK there are no easy way to increase the size on Windows.
It is highly unlikely that such a deep nested clvm program is used on coin spend, but at least you should put this fact into your brain.
But there is another approach. Replace recursive function call into loop. This can utilize heap memory instead of stack memory.
If you're interested, I already wrote such a conversion in my javascript implementation of clvm_tools.
Here is my work
In nodejs, it failed to run all_nest-1-1502.clvm due to Maximum call stack size exceeded error.
So I really tried hard to convert the recursion into loop in order to reduce stack memory consumed.
Fortunately as I develop javascript version of clvm_tools really looking like Python's code, you can also apply my work back into the Python's clvm_tools
Test environment
How to reproduce
Maybe
sys.setrecursionlimit(20000)
does not increase stack size, and AFIK there are no easy way to increase the size on Windows.It is highly unlikely that such a deep nested clvm program is used on coin spend, but at least you should put this fact into your brain.
But there is another approach. Replace recursive function call into loop. This can utilize heap memory instead of stack memory. If you're interested, I already wrote such a conversion in my javascript implementation of
clvm_tools
. Here is my workIn nodejs, it failed to run
all_nest-1-1502.clvm
due toMaximum call stack size exceeded
error. So I really tried hard to convert the recursion into loop in order to reduce stack memory consumed. Fortunately as I develop javascript version ofclvm_tools
really looking like Python's code, you can also apply my work back into the Python'sclvm_tools