Currently, when an assertion is not met we print a call stack that is resolved at compile time. Since constrained functions are completely inlined, this callstack is complete for constrained functions, but unconstrained functions are not inlined during compilation to allow for recursion.
This makes the callstacks for unconstrained functions incomplete, since we need runtime information of the callstack when an opcode fails.
We'll have to modify the ACVM to report on brillig execution errors not a singular OpcodeLocation, but a vector of OpcodeLocations representing the [...callStack, failingConstraint].
We'll have to adapt the code in acir-simulator to create a complete CallStack with this list of opcode locations.
Currently, when an assertion is not met we print a call stack that is resolved at compile time. Since constrained functions are completely inlined, this callstack is complete for constrained functions, but unconstrained functions are not inlined during compilation to allow for recursion.
This makes the callstacks for unconstrained functions incomplete, since we need runtime information of the callstack when an opcode fails.
We'll have to modify the ACVM to report on brillig execution errors not a singular OpcodeLocation, but a vector of OpcodeLocations representing the
[...callStack, failingConstraint].We'll have to adapt the code in acir-simulator to create a complete CallStack with this list of opcode locations.