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

fix!: separate element decoding error from verification error #16

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

iajoiner
Copy link
Contributor

@iajoiner iajoiner commented Jun 19, 2024

Rationale for this change

For arithmetic (such as #14) to work it is necessary to separate element decoding error from verification error. There are already QueryError::Overflow and QueryError::InvalidString that handle some decoding errors. However currently in practice if overflows do take place we get VerificationError. This PR will fix this issue.

What changes are included in this PR?

  • add QueryError::MiscellaneousDecodingError, QueryError::InvalidIndexes and QueryError::MiscellaneousEvaluationError to account for decoding errors beyond overflows and invalid strings
  • if decoding errors happen we will use them instead of VerificationError
  • add overflow test in crates/proof-of-sql/src/sql/proof/provable_query_result_test.rs

Are these changes tested?

Yes.

Dustin-Ray
Dustin-Ray previously approved these changes Jun 19, 2024
Copy link
Contributor

@Dustin-Ray Dustin-Ray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - not sure if this is a breaking change or not with the switch to Result from Option

@iajoiner iajoiner changed the title fix: separate element decoding error from verification error fix!: separate element decoding error from verification error Jun 19, 2024
@iajoiner
Copy link
Contributor Author

@drcapybara You are right! It is a breaking change since it changes error messages when certain non-verification errors occur.

- add `QueryError::MiscellaneousDecodingError`, `QueryError::InvalidIndexes` and `QueryError::MiscellaneousEvaluationError` to account for decoding errors beyond overflows and invalid strings
- if decoding errors happen we will use them instead of VerificationError
Copy link
Contributor

@JayWhite2357 JayWhite2357 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@iajoiner iajoiner merged commit b1a01ae into main Jun 20, 2024
8 checks passed
@iajoiner iajoiner deleted the feat/overflow branch June 20, 2024 01:15
Copy link

🎉 This PR is included in version 0.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants