🚀 Feature
In the case that execution halts early for some reason, the VM should return an error (or some outcome type) describing the instruction index at which the halt occurred.
Motivation
This is required to provide nice feedback to users from leo tooling. Knowing the failing instruction index, we can use source mapping to provide nicer unit-testing errors.
Currently, the VM panic!s the host on halt, meaning we lose all type information and context about the error and risk conflating VM halts with actual implementation/logic bugs. See #2941.
Originally raised here:
Implementation