Skip to content

Commit 4086480

Browse files
author
notnotraju
committed
Merge remote-tracking branch 'origin/merge-train/barretenberg' into rk/eccvm-audit-msm-relation
2 parents 9956dfd + d63c09f commit 4086480

File tree

863 files changed

+29607
-18786
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

863 files changed

+29607
-18786
lines changed

.test_patterns.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,19 @@ tests:
4545
error_regex: "field_t::range_constraint"
4646
owners:
4747
- *luke
48-
- regex: "barretenberg/acir_tests/scripts/run_test_browser.sh"
48+
- regex: "barretenberg/acir_tests/scripts/browser_prove.sh"
4949
error_regex: "Failed to fetch"
5050
owners:
5151
- *adam
52-
- regex: "barretenberg/acir_tests/scripts/run_test_browser.sh"
53-
error_regex: "Failed to fetch"
54-
owners:
55-
- *adam
56-
- regex: "barretenberg/acir_tests/scripts/run_test_browser.sh"
52+
- regex: "barretenberg/acir_tests/scripts/browser_prove.sh"
5753
error_regex: "RuntimeError: Out of bounds memory access"
5854
owners:
5955
- *adam
60-
- regex: "barretenberg/acir_tests/scripts/run_test_browser.sh"
56+
- regex: "barretenberg/acir_tests/scripts/browser_prove.sh"
6157
error_regex: "call_indirect to a null table entry"
6258
owners:
6359
- *adam
64-
- regex: "barretenberg/acir_tests/scripts/run_test_browser.sh"
60+
- regex: "barretenberg/acir_tests/scripts/browser_prove.sh"
6561
error_regex: "Input is not large enough"
6662
owners:
6763
- *adam
@@ -254,7 +250,7 @@ tests:
254250
- regex: "ivc-integration/src/rollup_ivc_integration.test.ts"
255251
error_regex: "Exceeded timeout of"
256252
owners:
257-
- *lucas
253+
- *luke
258254
- regex: "e2e_prover/full"
259255
error_regex: "ProvingError: Failed to verify proof from key!"
260256
- regex: "slasher/src/slasher_client.test.ts"

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
// Clangd. Note that this setting may be overridden by user settings
175175
// to the default value "clangd".
176176
//
177-
"clangd.path": "clangd-16",
177+
"clangd.path": "clangd-20",
178178
//
179179
// C/C++ (should be disabled)
180180
//

CI.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ CI3:
2323
- Restricting resources such a vcpus, memory and storage.
2424
- Building a single final slim release image from `release-image`.
2525
- Provides a consistent command interface on `./bootstrap.sh` scripts, e.g. `./bootstrap.sh clean|fast|full|test|test_cmds`.
26-
- Unifies how projects are tested allowing for a "build then test the entire repo" workflow. Projects expose their individual tests via `test_cmds` and they can all be parallelised at once to leverage maximum system throughput.
26+
- Unifies how projects are tested allowing for a "build then test the entire repo" workflow. Projects expose their individual tests via `test_cmds` and they can all be parallelized at once to leverage maximum system throughput.
2727
- Runs on a single (currently large, 128 vcpu) machine.
2828
- Significantly reduces the chance of flakey tests making their way into master, by "grinding" the tests in the master merge queue. This simply executes the tests as above, but across N instances. (TBD)
2929
- Provides a shared redis cache at the test level, meaning the same test never needs to be run twice in CI (except when grinding).
@@ -323,7 +323,7 @@ dl e6b8532f0c020b44
323323
Let's say you open up a test run log, you'll see something like:
324324

325325
```
326-
Command: parallelise 64 (exit: 0)
326+
Command: parallelize 64 (exit: 0)
327327
Starting test run with max 64 jobs...
328328
PASSED (http://ci.aztec-labs.com/736ae186bdf66226): yarn-project/end-to-end/scripts/run_test.sh simple e2e_synching
329329
PASSED (http://ci.aztec-labs.com/066e837f7af23761): yarn-project/end-to-end/scripts/run_test.sh simple e2e_public_testnet_transfer

avm-transpiler/Cargo.lock

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

avm-transpiler/bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cmd=${1:-}
66

77
hash=$(hash_str $(../noir/bootstrap.sh hash) $(cache_content_hash .rebuild_patterns))
88

9-
export GIT_COMMIT="0000000000000000000000000000000000000000"
9+
export GIT_COMMIT="$(cat ../noir/noir-repo-ref | head -n1)-aztec"
1010
export SOURCE_DATE_EPOCH=0
1111
export GIT_DIRTY=false
1212
export RUSTFLAGS="-Dwarnings"

aztec-nargo/README.md

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## `aztec-postprocess-contract`
2+
3+
The Aztec compilation process consists of two steps:
4+
1. `aztec-nargo` which just forwards all arguments to Noir's `nargo` compiler at the version tied to this version of aztec.
5+
2. `aztec-postprocess-contract` which post-processes the compiled contracts to prepare them for use in the Aztec ecosystem.
6+
7+
### `transpile_contract_and_gen_vks.sh`
8+
This script provides the core functionality behind the `aztec-postprocess-contract` command available via aztec-up. It performs postprocessing on compiled Noir contracts:
9+
1. Finds all contract artifacts in `target` directories
10+
2. Transpiles each artifact using the `avm-transpiler`
11+
3. Generates verification keys for each artifact using `bb` (`barretenberg`'s binary)
12+
4. Caches verification keys to speed up subsequent compilations
13+
14+
Example usage: `aztec-postprocess-contract` (via aztec-up) or directly `./transpile_contract_and_gen_vks.sh`

aztec-nargo/compile_then_postprocess.sh renamed to aztec-postprocess-contract/transpile_contract_and_gen_vks.sh

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
11
#!/usr/bin/env bash
2-
# This is a wrapper script for nargo.
3-
# Pass any args that you'd normally pass to nargo.
4-
# If the first arg is "compile",
5-
# run nargo and then postprocess any created artifacts.
2+
# This script performs postprocessing on compiled Noir contracts.
3+
# It expects to find compiled artifacts and transforms them via
4+
# transpilation and verification key generation.
65
#
7-
# Usage: compile_then_postprocess.sh [nargo args]
6+
# Usage: compile-contract [artifact_path ...]
7+
# If no paths provided, searches for artifacts in target/ directories
88
set -euo pipefail
99

1010
dir=$(dirname $0)
11-
NARGO=${NARGO:-"$dir/../noir/noir-repo/target/release/nargo"}
1211
TRANSPILER=${TRANSPILER:-"$dir/../avm-transpiler/target/release/avm-transpiler"}
1312
BB=${BB:-"$dir/../barretenberg/cpp/build/bin/bb"}
1413

15-
16-
if [ "${1:-}" != "compile" ]; then
17-
# if not compiling, just pass through to nargo verbatim
18-
$NARGO $@
19-
exit $?
20-
fi
21-
shift # remove the compile arg so we can inject --show-artifact-paths
22-
2314
# bb --version returns 00000000.00000000.00000000, so we compute
2415
# the binary hash to ensure we invalidate vk cache artifacts when bb changes
2516
bb_hash=$(sha256sum "$BB" | cut -d' ' -f1)
2617

27-
# Forward all arguments to nargo, tee output to console.
28-
# Nargo should be outputting errors to stderr, but it doesn't. Use tee to duplicate stdout to stderr to display errors.
29-
artifacts_to_process=$($NARGO compile --pedantic-solving --inliner-aggressiveness 0 --show-artifact-paths $@ | tee >(cat >&2) | grep -oP 'Saved contract artifact to: \K.*')
18+
# If artifact paths are provided as arguments, use those
19+
# Otherwise, search for contract artifacts in target directories
20+
if [ $# -gt 0 ]; then
21+
artifacts_to_process="$@"
22+
else
23+
# Find all contract artifacts in target directories
24+
artifacts_to_process=$(find . -name "*.json" -path "*/target/*" | grep -v "/cache/" | grep -v ".function_artifact_" || true)
25+
26+
if [ -z "$artifacts_to_process" ]; then
27+
echo "No contract artifacts found. Please compile your contracts first with 'nargo compile'."
28+
exit 1
29+
fi
30+
fi
3031

3132
# Postprocess each artifact
3233
# `$artifacts_to_process` needs to be unquoted here, otherwise it will break if there are multiple artifacts
@@ -82,3 +83,5 @@ for artifact in $artifacts_to_process; do
8283
mv "$artifact.tmp" "$artifact"
8384
done
8485
done
86+
87+
echo "Contract postprocessing complete!"

aztec-up/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ the user's `PATH` variable in their shell startup script so they can be found.
1111

1212
- `aztec` - The infrastructure container.
1313
- `aztec-cli` - A command-line tool for interacting with infrastructure.
14-
- `aztec-nargo` - A build of `nargo` from `noir` that is guaranteed to be version-aligned. Provides compiler, lsp and more. On `aztec-nargo compile <...>`, automatically transpiles artifacts using `avm-transpiler` and generates verification keys using `bb`.
14+
- `aztec-nargo` - A build of `nargo` from `noir` that is guaranteed to be version-aligned. Provides compiler, lsp and more.
15+
- `aztec-postprocess-contract` - Postprocessing tool for Aztec contracts that transpiles artifacts using `avm-transpiler` and generates verification keys using `bb`.
1516
- `aztec-sandbox` - A wrapper around docker-compose that launches services needed for sandbox testing.
1617
- `aztec-up` - A tool to upgrade the aztec toolchain to the latest, or specific versions.
1718
- `aztec-builder` - A useful tool for projects to generate ABIs and update their dependencies.

aztec-up/bin/aztec-install

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,11 @@ function title() {
5858
echo -e "${r}"
5959
fi
6060
echo -e "This will install the following scripts and update your PATH if necessary:"
61-
echo -e " ${bold}${g}aztec${r} - a collection of tools to launch subsystems and interact with the aztec network."
62-
echo -e " ${bold}${g}aztec-nargo${r} - aztec's build of nargo, the noir compiler toolchain."
63-
echo -e " ${bold}${g}aztec-up${r} - a tool to upgrade the aztec toolchain to the latest, or specific versions."
64-
echo -e " ${bold}${g}aztec-wallet${r} - our minimalistic CLI wallet"
61+
echo -e " ${bold}${g}aztec${r} - a collection of tools to launch subsystems and interact with the aztec network."
62+
echo -e " ${bold}${g}aztec-nargo${r} - aztec's build of nargo, the noir compiler toolchain."
63+
echo -e " ${bold}${g}aztec-postprocess-contract${r} - postprocessing tool for Aztec contracts (transpilation and VK generation)."
64+
echo -e " ${bold}${g}aztec-up${r} - a tool to upgrade the aztec toolchain to the latest, or specific versions."
65+
echo -e " ${bold}${g}aztec-wallet${r} - our minimalistic CLI wallet"
6566
echo
6667
read -p "Do you wish to continue? (y/n)" -n 1 -r
6768
echo
@@ -162,6 +163,7 @@ install_bin .aztec-run
162163
install_bin aztec
163164
install_bin aztec-up
164165
install_bin aztec-nargo
166+
install_bin aztec-postprocess-contract
165167
install_bin aztec-wallet
166168

167169
update_path_env_var $BIN_PATH

0 commit comments

Comments
 (0)