bitjson/bch-vm-limits

Should we limit the depth of the evaluation stack?

bitjson opened this issue · 2 comments

As mentioned in the CHIP, an O(1) Execution Stack isn't very hard to implement. But maybe a worthwhile research question before we essentially require implementations to think about this: is practically-unlimited "evaluation stack depth" desirable?

Would the protocol actually be made simpler by adding fixed depth limit on OP_IF and OP_NOTIF?

Or maybe evaluation stack manipulation is still so much faster than hash digest iterations that we don't need to care about this problem either way?

I'd love to hear about the worst-case performance of naively-implemented evaluation stacks in various languages and VM implementations.

Leaving note here: FWIW BCHN uses O(1) conditional stack.

Resolved and rationale documented in Rationale: Retention of Control Stack Limit 🚀