Skip to content
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

Better error message for not invoking AccountUpdate.requireSignature() #808

Closed
rpanic opened this issue Mar 27, 2023 · 3 comments · Fixed by #1095
Closed

Better error message for not invoking AccountUpdate.requireSignature() #808

rpanic opened this issue Mar 27, 2023 · 3 comments · Fixed by #1095
Assignees
Labels
error-messages Issues about making error messages better ITN-zkApps-E2E-testing product-eng For tracking our team's issues

Comments

@rpanic
Copy link
Contributor

rpanic commented Mar 27, 2023

Currently, if you forget to invoke requireSignature() on a AccountUpdate but try to test it on localBlockchain with proofs turned off, you get

Assert_failure src/lib/transaction_logic/zkapp_command_logic.ml:1266:17
      at raise_error (../../../../home/gregor/.opam/4.14.0/lib/js_of_ocaml-compiler/runtime/jsoo_runtime.ml:110:3)
      at apply_json_transaction (../../../../workspace_root/src/lib/snarky_js_bindings/lib/snarky_js_bindings_lib.ml:2933:11)
      at caml_call_gen (../../../../builtin/+stdlib.js:32:12)
      at Object.applyJsonTransaction (../../../../builtin/+jslib.js:289:12)
      at Object.sendTransaction (node_modules/snarkyjs/src/lib/mina.ts:436:16)
      at sendTransaction (node_modules/snarkyjs/src/lib/mina.ts:1021:10)
      at Object.send (node_modules/snarkyjs/src/lib/mina.ts:299:14)
      at Object.<anonymous> (src/lending/Lender.test.ts:427:20)

This error can lead to a lot of confusion and can be easily replaced by checking that in sendTransaction in the localBlockchain implementation

@Trivo25
Copy link
Member

Trivo25 commented May 9, 2023

I couldn't reproduce this error - can you give some more hints, please?

@Trivo25 Trivo25 self-assigned this Aug 14, 2023
@Trivo25
Copy link
Member

Trivo25 commented Aug 17, 2023

Closing because I couldn't reproduce. Everything I tested (with proofs on and off, using the LocalBlockchain, mutating fields on the AU or sending funds) resulted in the following error message. Looks like this bug fixed itself :)

Error: Transaction verification failed: Cannot update field 'xxx' because permission for this field is 'Signature', but the required authorization was not provided or is invalid.

@Trivo25 Trivo25 closed this as completed Aug 17, 2023
@Trivo25
Copy link
Member

Trivo25 commented Aug 21, 2023

It's a mismatch between authorizationKind and authorization, which results in a failing "assert" in the OCaml transaction logic, which has a bad error message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error-messages Issues about making error messages better ITN-zkApps-E2E-testing product-eng For tracking our team's issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants