You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat!: make compute_nullifier_without_context unconstrained (#8742)
With noir-lang/noir#5717 closed, we can now
make `compute_nullifier_without_context` `unconstrained`, as it should
have been. This clears the multiple warnings caused by calling
`get_nsk_app` without an `unsafe` block.
I also moved the implementation of `TransparentNote` around, since we
were calling the now unconstrained version. This nicely would've
resulted in a warning about a missing `unsafe` block had I not changed
it 😁
---------
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
Copy file name to clipboardexpand all lines: docs/docs/migration_notes.md
+10
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,16 @@ Aztec is in full-speed development. Literally every version breaks compatibility
8
8
9
9
## TBD
10
10
11
+
### [Aztec.nr] Changes to `NullifiableNote`
12
+
13
+
The `compute_nullifier_without_context` function is now `unconstrained`. It had always been meant to be called in unconstrained contexts (which is why it did not receive the `context` object), but now that Noir supports trait functions being `unconstrained` this can be implemented properly. Users must add the `unconstrained` keyword to their implementations of the trait:
14
+
15
+
```diff
16
+
impl NullifiableNote for MyCustomNote {
17
+
- fn compute_nullifier_without_context(self) -> Field {
18
+
+ unconstrained fn compute_nullifier_without_context(self) -> Field {
19
+
```
20
+
11
21
### [Aztec.nr] Make `TestEnvironment` unconstrained
12
22
13
23
All of `TestEnvironment`'s functions are now `unconstrained`, preventing accidentally calling them in a constrained circuit, among other kinds of user error. Becuase they work with mutable references, and these are not allowed to cross the constrained/unconstrained barrier, tests that use `TestEnvironment` must also become `unconstrained`. The recommended practice is to make _all_ Noir tests and test helper functions be `unconstrained:
0 commit comments