-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace panics with Results in the Rust bindings for much more descriptive failures #696
Comments
@nicc chat to Jo about whether zkApps Prod Eng. should be doing this |
For now zkApps Product should hold off and not implement this. It's likely to be a crypto thing. Will confirm |
@nicc Following up on your last comment. I believe the comment is out of date and Product Eng can pursue this, is that your current understanding too? |
@mitschabaude thinks this can likely be closed. Will confirm with crypto team first |
The line |
This is how it should be done: return match maybe_proof {
Ok(proof) => ...,
Err(err) => Err(JsError::from(err))
} |
Or like this: Err(str) => Err(JsError::new(str)), |
via @mrmr1993 There's a 2 line change to the WASM bindings which will give you a descriptive error instead of panicking when proving fails.
Make https://github.com/MinaProtocol/mina/blob/a3661e44e01b2c400d6eb5ac254c6ab7a91b3623/src/lib/crypto/kimchi_bindings/wasm/src/plonk_proof.rs#L551 return a Result<WasmProverProof, JSValue>
Change https://github.com/MinaProtocol/mina/blob/a3661e44e01b2c400d6eb5ac254c6ab7a91b3623/src/lib/crypto/kimchi_bindings/wasm/src/plonk_proof.rs#L612 to return maybe_proof.map_err(|str| str.into()) (or something like that), which will make it return the error as a JS exception
Additionally, https://github.com/MinaProtocol/mina/blob/a3661e44e01b2c400d6eb5ac254c6ab7a91b3623/src/lib/crypto/kimchi_bindings/wasm/src/plonk_proof.rs#L585
The text was updated successfully, but these errors were encountered: