Coder Social home page Coder Social logo

Comments (3)

bobbinth avatar bobbinth commented on June 18, 2024 2

I think the main rationale is that mtree_verify acts kind of like an assert instruction. That is, if a Merkle path cannot be verified, the execution fails. These failures can happen in different contexts (e.g., asset is not present in account vault) and it would be helpful to let users specify their own error codes.

from miden-vm.

Overcastan avatar Overcastan commented on June 18, 2024

I'm not sure I understand the purpose of adding an error codes to the mtree_verify.
We decided to add error codes to the assert instructions because they were returning just a FailedAssertion error and a cycle number without additional data, so it was difficult to find out what exactly caused an error.
But in case of mtree_verify we have a specific error which contains necessary data about Merkle Tree and a value being checked.
I think I just missing something, @hackaugusto can you describe in more detail why this is necessary?

from miden-vm.

hackaugusto avatar hackaugusto commented on June 18, 2024

The motivation for the issue was the usage of mtree_verify in miden-base. There are two uses and having an error will make it clearer which one caused an issue (also for other errors)

In general, I think every instruction that can fail should have an error to make debugging easier. My ideal situation would be to have error code to every instruction that can fail. So that when I get a failure in a test, I can just search for the error code and find exactly the instruction that failed.

from miden-vm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.