feat(acvm): Execute multiple circuits #5380
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_circuitto be part of a statefulProgramExecutorthat builds a witness stack for every completedexecute_circuitcall. An initialexecute_programfunction instantiates theProgramExecutorand starts execution on ourmainentry point circuit. When aCallopcode is reached we pause execution and recursively callexecute_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
Circuitfunctions) then gets passed to the backend. For now, I have only done an additiveprove_and_verify_ultra_honk_programto 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.