miden-vm
miden-vm copied to clipboard
Alternative approach for non-control-op assertion when updating decoder helpers
When setting helpers for user operations within the decoder trace via the set_user_op_helpers
function in the decoder module, we need access to the operation information in debug mode only, so that we can ensure the operation is not a control operation. Currently, the operation value is passed as a parameter from the calling function (the processor's operation executor for the given operation).
It might be better to get the operation from the decoder trace. However, there are a few considerations:
- Operations are heavy (~48 bytes), and this info isn't needed for regular execution (although knowing which operations are executed in each cycle is needed for the execute_iter function), so keeping them all as part of the decoder trace is not ideal
- Rebuilding the opcode from the trace is possible, but there is no clean function to get an operation by its opcode, so we would have to do something a bit inefficient here. (This may still be preferable, since it will be executed in debug mode only, and therefore wouldn't affect normal execution).
The initial discussion of this issue is here: https://github.com/maticnetwork/miden/pull/237#discussion_r892825455
@grjte I'd like to take a look at it.
@0xKanekiKen thanks! We should wait until #237 is merged before taking a look at this, which should be by the end of the week
@0xKanekiKen I discussed this with @bobbinth and I think we're going to hold off on this issue for now, since it's not urgent, we're not sure how we want to approach it, and there are several other things we need to update in the decoder (so we want to avoid conflicts).