hashcloak / stoffelMPC

GNU Affero General Public License v3.0
35 stars 4 forks source link

Implement error handling #48

Open hdvanegasm opened 7 months ago

hdvanegasm commented 7 months ago

We need to define the proper error handling for instructions and operations in the components of the virtual machine in an elegant way.

hdvanegasm commented 6 months ago

I suggest implementing the error handling as in the repo: https://github.com/nervosnetwork/ckb-vm. There, they use Results for handling errors in the components of the VM (memory, registers, etc.) for operations like loading, storing, creating, and so on. Also, the instructions return Results. The Result handling should be moved to the outer execution.

We can define our own errors as an enum which implements the Error trait in a file errors.rs.