0xPolygonMiden / miden-vm

STARK-based virtual machine
MIT License
615 stars 152 forks source link

Implement error codes for the `mtree_verify` instructions. #1274

Closed Fumuran closed 3 months ago

Fumuran commented 5 months ago

This PR implements the ability to specify error codes for mtree_verify instruction the same way it is done for assert instructions.

Related issue: #1264

Fumuran commented 5 months ago

I noticed that for some reason we still use Felt as an error code for the U32assert2 operation (link), so I probably should create an issue to change it to the u32.

bobbinth commented 5 months ago

We should put this on hold until #1277 is merged and then make this work with the new structure.

bitwalker commented 5 months ago

@Overcastan I think you'll find it pretty easy to port this to #1277, if you look at how your implementation of u32clz, etc. was ported to the new structure, it's basically identical, though you'll probably want to reference the Assert non-terminal production in assembly/src/parser/grammar.lalrpop to see how to handle error code immediates specifically. Other than that, most everything else is relatively unchanged from the implementation in this PR.

plafer commented 3 months ago

@Overcastan Are you still working on this?

bobbinth commented 3 months ago

Now that #1277 has been merged, we should refresh this PR.

Fumuran commented 3 months ago

@plafer Yep, I'll rework it to work with a new version of assembler.

Fumuran commented 3 months ago

I decided to create a new PR for this issue, I think it will be easier than resolving conflicts in this one.