-
Notifications
You must be signed in to change notification settings - Fork 143
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
Fix self-updating verification key #812
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the script, runs excellently. LGTM :D
src/lib/account_update.ts
Outdated
let isProver = proverData !== undefined; | ||
if (!isProver && priorAccountUpdates === undefined) { | ||
throw Error( | ||
'invariant violation: only the prover can call `setProofAuthorizationKind()` without passing in `priorAccountUpdates`' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can the user run into this error? I tried to reproduce it but I don't quite understand how to trigger it 😅
setProofAuthorizationKind
seems only to happen when we analyze method
s. Could we come up with a better error message that gives guidance on what the potential issues could be? The error message has some internal parameters used, which could be confusing without knowing the code of SnarkyJS.
priorAccountUpdates
is confusing since that mostly seems like an internal thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error is not supposed to ever happen :D I just added this as an 'assert' to make sure that we notice when the assumptions here are violated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it! Do you think it would be of any value to indicate that this error should never happen and means something is really broken in a more obvious way?
Maybe decreasing unknown error fatigue would be nice, and give a message that lets users know that it's not the fault of their zkApp?
Co-authored-by: Martin Minkov <minkovlmartin@gmail.com>
fixes #813 - updating of the zkapp verification key
there was a bug where the update was using the new (not old) verification key hash inside
body.authorizationKind