Skip to content
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: Sync from aztec-packages #4670

Merged
merged 14 commits into from
Mar 29, 2024
Merged

feat: Sync from aztec-packages #4670

merged 14 commits into from
Mar 29, 2024

Conversation

AztecBot
Copy link
Collaborator

@AztecBot AztecBot commented Mar 28, 2024

Automated pull of Noir development from aztec-packages.
BEGIN_COMMIT_OVERRIDE
feat(acvm): Execute multiple circuits (AztecProtocol/aztec-packages#5380)
feat(acir_gen): Fold attribute at compile-time and initial non inlined ACIR (AztecProtocol/aztec-packages#5341)
refactor: inject fetcher instead of using global (AztecProtocol/aztec-packages#5502)
END_COMMIT_OVERRIDE

AztecBot and others added 13 commits March 28, 2024 16:49
…-packages#5502)

This PR refactors the GithubDependencyResolver to take a fetch
implementation instead of always using the global default
)

Resolves #4428

This is a followup to
AztecProtocol/aztec-packages#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>
)

Resolves #4428

This is a followup to
AztecProtocol/aztec-packages#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>
@vezenovm vezenovm enabled auto-merge March 29, 2024 18:50
@vezenovm vezenovm added this pull request to the merge queue Mar 29, 2024
Merged via the queue into master with commit a0f7474 Mar 29, 2024
43 checks passed
@vezenovm vezenovm deleted the aztec-packages branch March 29, 2024 19:29
TomAFrench added a commit that referenced this pull request Apr 3, 2024
Automated pull of Noir development from
[aztec-packages](https://github.com/AztecProtocol/aztec-packages).
BEGIN_COMMIT_OVERRIDE
feat(acvm): Execute multiple circuits
(AztecProtocol/aztec-packages#5380)
feat(acir_gen): Fold attribute at compile-time and initial non inlined
ACIR (AztecProtocol/aztec-packages#5341)
refactor: inject fetcher instead of using global
(AztecProtocol/aztec-packages#5502)
END_COMMIT_OVERRIDE

---------

Co-authored-by: vezenovm <mvezenov@gmail.com>
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants