Comments (3)
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.
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.
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)
- authenticate a note
- check an account procedures
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)
- MASM arithmetic instructions should accept constants HOT 3
- u32and should accept err HOT 9
- u32 bitwise operations should accept immediate values
- allow odd number of characters in hex constants HOT 2
- Add recursive call limit HOT 4
- MASM test runner HOT 1
- Add procedures to initialize the hasher state HOT 2
- Add procedures to read and verify data from the advice stack HOT 3
- Test sha256_hash_memory is flaky
- Add mutation testing strategy HOT 3
- Create method to add list of values to advice provider
- Change `FailedSignatureGeneration`'s inner type to `String`
- Allow setting the kernel via the CLI
- Allow setting debug mode via CLI HOT 3
- Allow repeat opcode to be set programmatically HOT 1
- comparison instructions should accept immediate values HOT 1
- When both values are not u32 the error for instruction u32assert2 should carry both
- Add an inverse of u32split instruction HOT 1
- Allow changing constant values prior to execution
- Optimization of `sys::truncate_stack` procedure in `stdlib`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from miden-vm.