-
Notifications
You must be signed in to change notification settings - Fork 513
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
Introduce halo2_proofs::circuit::Value
#598
Conversation
This is a more usable and type-safe replacement for `Option<V>` in circuit synthesis.
29502a5
to
a43b3df
Compare
Force-pushed to fill in the changelogs. The breaking changes to the public API aren't quite as bad as I thought! Still large, but enumerable. |
zcash/orchard#336 has the migration of |
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 really good!! Just have some questions regarding the ops
traits impls for Value
.
Feels much better now avoiding a lot of unwrap
s and ok_or(Error::Synthesis)
. The readability will be improved quite a lot also IMO.
Thanks a lot for working on this @str4d 🥳
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.
utACK
Consider shortening uses of Value::known
by importing it and using known(...)
.
This doesn't actually work; Rust lets you import enum cases, but not struct methods. We'd need a standalone method instead, which would then be weird as it would lack context ( |
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.
utACK
Co-authored-by: ying tong <yingtong@z.cash>
This replaces every usage of
Option<V>
for representing witnessed values that may not have a known value (e.g. advice cells during keygen).This is a very big breaking change to the public API, but does not alter circuit compatibility.
Closes #509.