-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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-token-sdk] Re-organize error types #34034
Merged
samkim-crypto
merged 8 commits into
solana-labs:master
from
samkim-crypto:zk-token-sdk/range-proof-errors
Nov 16, 2023
Merged
[zk-token-sdk] Re-organize error types #34034
samkim-crypto
merged 8 commits into
solana-labs:master
from
samkim-crypto:zk-token-sdk/range-proof-errors
Nov 16, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #34034 +/- ##
=========================================
- Coverage 81.9% 81.9% -0.1%
=========================================
Files 812 813 +1
Lines 219656 219651 -5
=========================================
- Hits 179989 179984 -5
Misses 39667 39667 |
joncinque
previously approved these changes
Nov 15, 2023
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.
Just some small little micro-nits, looks great otherwise!
Co-authored-by: Jon Cinque <me@jonc.dev>
joncinque
approved these changes
Nov 16, 2023
mergify bot
pushed a commit
that referenced
this pull request
Nov 16, 2023
* add deserialization error type for encryption * re-organize sigma proof error types * re-organize range proof error types * update pod conversion module * update instruction error types * clippy * fix `thiserror` visibility * Apply suggestions from code review Co-authored-by: Jon Cinque <me@jonc.dev> --------- Co-authored-by: Jon Cinque <me@jonc.dev> (cherry picked from commit 0fd4762) # Conflicts: # zk-token-sdk/src/instruction/withdraw.rs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The error types in the zk-token-sdk are organized by
ProofError
, which does not allow fine-grained control of different ways that proof generation can produce error.Summary of Changes
Re-organized error types in the zk-token-sdk.
AuthenticatedEncryptionError
andElGamalError
types and replaced pod conversion to return these error types instead ofProofError
.SigmaProofVerificationError
type to deal with sigma proof errors. Previously, we used a universalProofError
to catch sigma proof error, which provided less flexibility.RangeProofGenerationError
andRangeProofVerificationError
. TheRangeProofGenerationError
variants are added in a follow-up PR ([zk-token-sdk] Add range proof generation error types #34065).convert
module, so I updated it.ProofError
intoProofGenerationError
andProofVerificationError
and updated the instruction module accordingly. I also addedInstructionError
to catch errors that are not related to proof generation or verification (e.g. instruction decryption).Fixes #