Skip to content

Commit

Permalink
feat(simulator): Fetch return values at circuit execution (AztecProto…
Browse files Browse the repository at this point in the history
…col/aztec-packages#5642)

We were deserializing a `Program` twice in the simulator. Once to
execute the circuit and again to fetch the return witness. Every call to
`executeCircuitWithBlackBoxSolver` is followed by a call to
`getReturnWitness` in the simulator. We should just pass the return
witness right away as to not cross the WASM boundary a second time and
as to avoid a second deserialization.

I settled on a new ACVM method rather than using abi decoding as the
return witnesses are stripped from the ABI. We can have a method that
returns both the fully solved witness and the return witness based upon
the circuit. This allows us to both avoid storing duplicate return
witness information and an unnecessary deserialization.
  • Loading branch information
AztecBot committed Apr 10, 2024
1 parent a0f7474 commit d114e9e
Show file tree
Hide file tree
Showing 173 changed files with 3,646 additions and 3,112 deletions.
2 changes: 1 addition & 1 deletion .aztec-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bb719200034e3bc6db09fb56538dadca4203abf4
413a4e0e4e22c0dcf86a2d3de6b75c98ae1d67d4
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ if [[ -z "${SKIP_NIX:-}" ]] && has nix; then
use nix
fi

fi
fi
2 changes: 0 additions & 2 deletions .github/Cross.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
passthrough = [
"HOME",
"RUST_BACKTRACE",
"BARRETENBERG_BIN_DIR",
"BLNS_JSON_PATH"
]
volumes = [
"HOME",
Expand Down
1 change: 1 addition & 0 deletions .github/scripts/acvm_js-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
set -eu

.github/scripts/wasm-bindgen-install.sh
.github/scripts/wasm-opt-install.sh
yarn workspace @noir-lang/acvm_js build
1 change: 1 addition & 0 deletions .github/scripts/noir-wasm-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
set -eu

.github/scripts/wasm-pack-install.sh
.github/scripts/wasm-opt-install.sh
yarn workspace @noir-lang/types build
yarn workspace @noir-lang/noir_wasm build
1 change: 1 addition & 0 deletions .github/scripts/noirc-abi-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
set -eu

.github/scripts/wasm-bindgen-install.sh
.github/scripts/wasm-opt-install.sh
yarn workspace @noir-lang/noirc_abi build
2 changes: 1 addition & 1 deletion .github/scripts/wasm-opt-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ cd $(dirname "$0")

./cargo-binstall-install.sh

cargo-binstall wasm-opt --version 0.116.0 -y
cargo-binstall wasm-opt --version 0.116.0 -y --force
Loading

0 comments on commit d114e9e

Please sign in to comment.