-
Notifications
You must be signed in to change notification settings - Fork 251
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
[zk-sdk] Add error types and zero ciphertext instruction #1453
[zk-sdk] Add error types and zero ciphertext instruction #1453
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1453 +/- ##
=========================================
- Coverage 82.7% 82.7% -0.1%
=========================================
Files 871 872 +1
Lines 370333 370472 +139
=========================================
+ Hits 306536 306614 +78
- Misses 63797 63858 +61 |
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.
Looks good overall, just the one comment about the error names
zk-sdk/src/elgamal_program/errors.rs
Outdated
#[error("not enough funds in account")] | ||
NotEnoughFunds, | ||
#[error("transfer fee calculation error")] | ||
FeeCalculation, |
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.
Should these errors be changed or removed?
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.
Oh great point! I removed it. Thanks!
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.
Ok cool! Can you also get rid of NotEnoughFunds
?
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.
Oh oops, removed. Thanks!
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.
Looks great!
Problem
The proof data and instructions for the new elgamal program in zk-sdk are not added yet.
Summary of Changes
I added the zero-ciphertext instruction to start. Once this PR is merged after some feedback, then I think I can add the rest of the proof data in slightly larger chunk PRs.
ProofGenerationError
andProofVerificationError
. These types remain largely the same as in zk-token-sdk and in particular, wrapsRangeProofError
andSigmaProofError
.zero_balance
instruction data module from zk-token-sdk verbatim to make the diffs in the next commit easier to view.zero_balance
instruction data. The changes are essentially updatingZeroBalance...
toZeroCiphertext...
and re-organizing the imports.VerifyZeroCiphertext
instruction in the elgamal proof program.Fixes #