-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(acvm): Execute multiple circuits (#5380)
Resolves noir-lang/noir#4428 This is a followup to #5341 which does the initial ACIR generation work for multiple ACIR functions. Execution is now done by moving `execute_circuit` to be part of a stateful `ProgramExecutor` that builds a witness stack for every completed `execute_circuit` call. An initial `execute_program` function instantiates the `ProgramExecutor` and starts execution on our `main` entry point circuit. When a `Call` opcode is reached we pause execution and recursively call `execute_circuit`, which then returns the solved witness for that call. We then resolve the outputs of that execution by reading the return witnesses from the inner solved witness. We then push the nested call solved witness onto the witness stack and continue execution of our main ACVM instance. This is quite similar to the process used by foreign calls with Brillig, except it is now done with the main ACVM rather than the contained Brillig VM. This witness stack and program (list of `Circuit` functions) then gets passed to the backend. For now, I have only done an additive `prove_and_verify_ultra_honk_program` to show the process working for the basic non-inlined ACIR programs supplied here. I wanted to leave any WASM exports or ACVM JS changes for a follow-up PR as they are quite a bit of changes on their own. --------- Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com> Co-authored-by: Tom French <tom@tomfren.ch> Co-authored-by: jfecher <jfecher11@gmail.com>
- Loading branch information
1 parent
a979150
commit bb71920
Showing
25 changed files
with
480 additions
and
130 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
6 changes: 6 additions & 0 deletions
6
barretenberg/acir_tests/flows/prove_and_verify_ultra_honk_program.sh
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,6 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
VFLAG=${VERBOSE:+-v} | ||
|
||
$BIN prove_and_verify_ultra_honk_program $VFLAG -c $CRS_PATH -b ./target/acir.gz |
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
Oops, something went wrong.