-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Validate outputs in kernel circuits (#7706)
Kernel circuits have a validation step that checks their output, which is constructed in an unconstrained function earlier. This check should not be needed when running in unconstrained mode, so they were skipped. However, this means that errors in the unconstraiend construction of the output could go unnoticed in tests that run without real proofs enabled, since those use the `-simulated` versions of kernels which are unconstrained. To catch these errors, we now force kernel circuits to always validate this output. --------- Co-authored-by: Leila Wang <[email protected]>
- Loading branch information
1 parent
76ef298
commit 9a98289
Showing
8 changed files
with
15 additions
and
6 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
8 changes: 8 additions & 0 deletions
8
noir-projects/noir-protocol-circuits/crates/types/src/validate.nr
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Returns whether to validate the output of the circuit. Eventually we'll want to change this | ||
// to `!dep::std::runtime::is_unconstrained`, so we skip unneeded validations when we | ||
// do not need to generate a proof. But for now, we always validate to make sure we catch | ||
// errors earlier, as most of our tests run with real proofs disabled, which means validation | ||
// checks get skipped. | ||
pub fn should_validate_output() -> bool { | ||
true | ||
} |