-
Notifications
You must be signed in to change notification settings - Fork 170
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
feat: add as_witness
builtin function in order to constrain a witness to be equal to a variable
#4641
Conversation
I've confirmed that this works on @zac-williamson's poseidon circuit. Happy to bikeshed on naming. |
I'd like to hold off on this unless @zac-williamson really needs a fix today for this. I just don't see regular users being able to debug to the point where they can identify the exact point to add |
Happy to hold off on this if it's not urgent, just good to have this in our back pocket. |
@jfecher can you approve? |
…ic definition (noir-lang/noir#5041) feat: Implement turbofish operator (noir-lang/noir#3542) feat: add `as_witness` builtin function in order to constrain a witness to be equal to a variable (noir-lang/noir#4641) chore(experimental): Elaborate impls & non-trait impls (noir-lang/noir#5007) feat: add native rust implementation of schnorr signature verification (noir-lang/noir#5053) chore: Release Noir(0.30.0) (noir-lang/noir#4981)
Automated pull of development from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE fix(frontend): Call trait method with mut self from generic definition (noir-lang/noir#5041) feat: Implement turbofish operator (noir-lang/noir#3542) feat: add `as_witness` builtin function in order to constrain a witness to be equal to a variable (noir-lang/noir#4641) chore(experimental): Elaborate impls & non-trait impls (noir-lang/noir#5007) feat: add native rust implementation of schnorr signature verification (noir-lang/noir#5053) chore: Release Noir(0.30.0) (noir-lang/noir#4981) END_COMMIT_OVERRIDE --------- Co-authored-by: TomAFrench <tom@tomfren.ch>
Automated pull of development from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE fix(frontend): Call trait method with mut self from generic definition (#5041) feat: Implement turbofish operator (#3542) feat: add `as_witness` builtin function in order to constrain a witness to be equal to a variable (#4641) chore(experimental): Elaborate impls & non-trait impls (#5007) feat: add native rust implementation of schnorr signature verification (#5053) chore: Release Noir(0.30.0) (#4981) END_COMMIT_OVERRIDE --------- Co-authored-by: TomAFrench <tom@tomfren.ch>
Description
Problem*
Quick fix to #4629
Summary*
This PR adds a
as_witness
function which takes aField
and instructs the compiler to lay down an opcode which constrains a witness to be equal to this value.This prevents the issue in #4629 where we collect ever growing expressions which need to be broken down multiple times while reshaping the circuit. Doing this during acirgen instead allows us to avoid this repetition.
Additional Context
Documentation*
Check one:
Feature is experimental
PR Checklist*
cargo fmt
on default settings.