Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
a447962
indent
ludamad Feb 25, 2025
ccaadf4
Merge remote-tracking branch 'origin/master' into ad/capture-app-stacks
ludamad Feb 26, 2025
31b84cd
merge
ludamad Feb 26, 2025
6b34123
merge fix
ludamad Feb 28, 2025
cd1d059
Merge remote-tracking branch 'origin/master' into ad/capture-app-stacks
ludamad Mar 3, 2025
1758628
fix merge
ludamad Mar 3, 2025
dcd9445
fixups
ludamad Mar 3, 2025
86fb817
refactor
ludamad Mar 3, 2025
b93a29b
tsc compiling
ludamad Mar 3, 2025
d4f4ebb
fix
ludamad Mar 3, 2025
6394ee8
comments
ludamad Mar 3, 2025
1d212dc
make format... format
ludamad Mar 3, 2025
f2097cc
flip flop on name of the thing
ludamad Mar 5, 2025
9a518c1
tinker more
ludamad Mar 5, 2025
c2128e6
Merge remote-tracking branch 'origin/master' into ad/capture-app-stacks
ludamad Mar 5, 2025
50bb8cd
fix releases
ludamad Mar 5, 2025
2d59b9c
fix
ludamad Mar 5, 2025
fb405eb
fix
ludamad Mar 6, 2025
965dcfd
Merge remote-tracking branch 'origin/master' into ad/capture-app-stacks
ludamad Mar 6, 2025
ee62a23
api changes
ludamad Mar 6, 2025
2a8d1a9
merge
ludamad Mar 6, 2025
7f6a583
continued refactoring
ludamad Mar 8, 2025
4d874f6
Merge remote-tracking branch 'origin/master' into ad/capture-app-stacks
ludamad Mar 8, 2025
9467a3b
fixes
ludamad Mar 10, 2025
6bb1dce
some warning cleanup
ludamad Mar 10, 2025
ef1c356
try out custom rule
ludamad Mar 10, 2025
71ef901
eslint pass
ludamad Mar 10, 2025
d9e68b4
fix linting
ludamad Mar 10, 2025
2fb5cf0
fix bootstrap
ludamad Mar 10, 2025
5d82337
Merge remote-tracking branch 'origin/master' into ad/capture-app-stacks
ludamad Mar 10, 2025
be6556f
post merge fixups
ludamad Mar 10, 2025
b07e1c3
fix
ludamad Mar 10, 2025
9f1c3d2
fix
ludamad Mar 10, 2025
337079e
fix TxProfileResult schema
ludamad Mar 11, 2025
f2277d5
aztec sandbox version
ludamad Mar 11, 2025
c55d6cd
wallet test in ci progress
ludamad Mar 11, 2025
5f80b17
sync
ludamad Mar 11, 2025
b517176
sync
ludamad Mar 11, 2025
6aa67d9
refactor flows
ludamad Mar 11, 2025
a027f51
fix profile.sh test
ludamad Mar 12, 2025
8011ac5
fix profile script
ludamad Mar 12, 2025
6343e93
Benchmarking changes
ludamad Mar 12, 2025
2055e7b
iterate on bench publish rate
ludamad Mar 12, 2025
e9e2043
benchmark pass
ludamad Mar 12, 2025
c8b199c
Working publish cadence
ludamad Mar 12, 2025
abd2c79
Working publish cadence
ludamad Mar 12, 2025
e5665ab
capturePrivateExecutionSteps
ludamad Mar 13, 2025
210a178
barretenberg benchmark pass
ludamad Mar 13, 2025
5393df0
more instrumentation work
ludamad Mar 13, 2025
e40e36e
Merge remote-tracking branch 'origin/ad/capture-app-stacks' into ad/c…
ludamad Mar 13, 2025
4235eee
Merge remote-tracking branch 'origin/master' into ad/capture-app-stacks
ludamad Mar 13, 2025
278aa8f
tweaks
ludamad Mar 13, 2025
f19936c
new bench working
ludamad Mar 13, 2025
0e26d7b
fix execution capture
ludamad Mar 13, 2025
efa12a2
fix execution capture
ludamad Mar 13, 2025
3ac7d3f
decouple
ludamad Mar 13, 2025
af8f3ee
lets go testing
ludamad Mar 14, 2025
c465eca
remove .ts
ludamad Mar 14, 2025
6177c86
Merge branch 'master' into ad/capture-app-stacks
ludamad Mar 14, 2025
75ecdab
fix cli
ludamad Mar 14, 2025
d196768
Merge remote-tracking branch 'origin/ad/capture-app-stacks' into ad/c…
ludamad Mar 14, 2025
899a67a
fix
ludamad Mar 14, 2025
1862d08
Merge remote-tracking branch 'origin/master' into ad/capture-app-stacks
ludamad Mar 14, 2025
69e32de
Merge remote-tracking branch 'origin/master' into ad/capture-app-stacks
ludamad Mar 14, 2025
85e76e0
patch noir repo to not have breaking comptime test
ludamad Mar 14, 2025
2549913
noir fix
ludamad Mar 14, 2025
b24ccc8
Update barretenberg/README.md
ludamad Mar 14, 2025
2d43bb3
Update barretenberg/cpp/src/barretenberg/bb/readme.md
ludamad Mar 14, 2025
8a7241b
fix review comments
ludamad Mar 14, 2025
680feb3
Merge remote-tracking branch 'origin/ad/capture-app-stacks' into ad/c…
ludamad Mar 14, 2025
0a60b9c
same fix for lint
ludamad Mar 14, 2025
c09f3cb
fix profile mode
ludamad Mar 14, 2025
f46c75a
fix noir repo
ludamad Mar 14, 2025
46a3751
Merge remote-tracking branch 'origin/master' into ad/capture-app-stacks
ludamad Mar 14, 2025
9ffd46b
fix noir repo patch
ludamad Mar 15, 2025
b44014f
fix lint command
ludamad Mar 15, 2025
881f0a5
update
ludamad Mar 15, 2025
74ec511
fix
ludamad Mar 15, 2025
9014280
skip problematic test
ludamad Mar 15, 2025
75bbf22
reinstate bench
ludamad Mar 15, 2025
6126395
Attempt skip fixes
ludamad Mar 15, 2025
0259fdd
flake fix
ludamad Mar 15, 2025
c716da6
skippity
ludamad Mar 15, 2025
6d250f0
fix
ludamad Mar 16, 2025
4c4a1a0
clientivc proving fix
ludamad Mar 16, 2025
ac1d1e9
noir up
ludamad Mar 16, 2025
be3f776
Merge remote-tracking branch 'origin/ad/capture-app-stacks' into ad/c…
ludamad Mar 16, 2025
e9773b5
give me a break...
ludamad Mar 16, 2025
99677ad
fix
ludamad Mar 16, 2025
2c5386e
Merge remote-tracking branch 'origin/ad/capture-app-stacks' into ad/c…
ludamad Mar 16, 2025
6e16f16
update
ludamad Mar 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .github/workflows/ci3-external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
ci-external:
runs-on: ubuntu-latest
# exclusive with ci3.yml, only run on forks.
if: github.event.pull_request.head.repo.full_name != github.repository
if: github.event.pull_request.head.repo.fork
steps:
#############
# Prepare Env
Expand All @@ -28,14 +28,11 @@ jobs:
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Fail If Draft
if: github.event.pull_request.draft && (github.event.action != 'labeled' || github.event.label.name != 'trigger-workflow')
if: github.event.pull_request.draft
run: echo "CI is not run on drafts." && exit 1

- name: External Contributor Checks
# Run only if a pull request event type and we have a forked repository origin.
if: |
(github.event_name == 'pull_request' || github.event_name == 'pull_request_target') &&
github.event.pull_request.head.repo.full_name != github.repository
run: |
set -o pipefail
git fetch origin ${{ github.event.pull_request.base.ref }} --depth=1 &>/dev/null
Expand All @@ -48,7 +45,7 @@ jobs:
echo "Error: External PRs can only target master, targeted: ${{ github.event.pull_request.base.ref }}."
exit 1
fi
labeled="${{contains(github.event.pull_request.labels.*.name, 'ci-external') || contains(github.event.pull_request.labels.*.name, 'ci-external-once')}}"
labeled="${{contains(github.event.pull_request.labels.*.name, 'ci-external') || github.event.label.name == 'ci-external-once'}}"
if [ "$labeled" = false ]; then
echo "External PRs need the 'ci-external' or 'ci-external-once' labels to run."
exit 1
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci3.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ concurrency:
jobs:
ci:
runs-on: ubuntu-latest
# exclusive with ci3-external.yml: if it is a pull request target only run if it is NOT a fork.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
# exclusive with ci3-external.yml: never run on forks
# (github.event.pull_request.head.repo.fork resolves to nil if not a pull request)
if: github.event.pull_request.head.repo.fork != true
environment: ${{ startsWith(github.ref, 'refs/tags/v') && 'master' || '' }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -89,12 +90,11 @@ jobs:
- name: Download benchmarks
if: matrix.settings.arch == 'amd64' && github.event_name == 'push' && github.ref_name == 'master'
run: |
./ci3/cache_download barretenberg-bench-results-$(git rev-parse HEAD).tar.gz
./ci3/cache_download yarn-project-bench-results-$(git rev-parse HEAD).tar.gz
# ./ci3/cache_download yarn-project-p2p-bench-results-$(git rev-parse HEAD).tar.gz
# Note: sets SKIP_BB_BENCH in GITHUB_ENV for below step.
./ci.sh gh-bench

- name: Store barretenberg benchmark result
if: matrix.settings.arch == 'amd64' && github.event_name == 'push' && github.ref_name == 'master'
if: matrix.settings.arch == 'amd64' && github.event_name == 'push' && github.ref_name == 'master' && env.SKIP_BB_BENCH != 'true'
continue-on-error: true
uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29
with:
Expand Down
19 changes: 17 additions & 2 deletions .test_patterns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,23 @@ tests:
owners:
- *leila

- regex: "spartan/bootstrap.sh test-local"
skip: true
- regex: "spartan/bootstrap.sh test-kind-upgrade-rollup-version"
owners:
- *adam

- regex: "spartan/bootstrap.sh test-cli-upgrade-with-lock"
owners:
- *adam

- regex: "spartan/bootstrap.sh test-kind-smoke"
owners:
- *adam

- regex: "spartan/bootstrap.sh test-kind-transfer"
owners:
- *adam

- regex: "spartan/bootstrap.sh test-prod-deployment"
owners:
- *adam

Expand Down
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,5 +181,11 @@
"typescript.tsserver.maxTsServerMemory": 4096,
"typescript.tsdk": "yarn-project/node_modules/typescript/lib",
"markdown.extension.toc.levels": "2..6",
"noir.nargoPath": "${workspaceFolder}/noir/noir-repo/target/release/nargo"
"noir.nargoPath": "${workspaceFolder}/noir/noir-repo/target/release/nargo",
"auto-close-tag.activationOnLanguage": [
"xml",
"markdown",
"HTML (EEx)",
"HTML (Eex)"
]
}
3 changes: 2 additions & 1 deletion aztec-up/bin/.aztec-run
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
# Such stuff belongs in higher level e.g. `aztec` or `aztec-wallet` scripts.
set -euo pipefail

CONTAINER_NAME=$1
# Can be overriden by env var CONTAINER_NAME, e.g. to start two sandboxes.
CONTAINER_NAME=${CONTAINER_NAME:-$1}
shift

VERSION=${VERSION:-"latest"}
Expand Down
7 changes: 5 additions & 2 deletions barretenberg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
> [!WARNING]
> :warning: **<https://github.com/AztecProtocol/barretenberg> is a mirror-only repository, please only use <https://github.com/AztecProtocol/aztec-packages>. Do not use this for any purpose other than reference.** :warning:

![banner](../.github/img/bb_banner.png)

# Barretenberg

Barretenberg (or `bb` for short) is an optimized elliptic curve library for the bn128 curve, and a PLONK SNARK prover.
Expand Down Expand Up @@ -473,6 +471,11 @@ command script import ~/aztec-packages/barretenberg/cpp/scripts/lldb_format.py

Now when you `print` things with e.g. `print bigfield_t.get_value()` or inspect in VSCode (if you opened the debug console and put in these commands) then you will get pretty-printing of these types. This can be expanded fairly easily with more types if needed.


#### Debugging and profiling realistic ClientIVC flows

To download realistic ClientIVC benchmark inputs from last master, use `./barretenberg/cpp/bootstrap.sh download_e2e_ivc_inputs` and run ClientIVC proving with --input runtime_stack on those inputs. By default, tries to pull from last master, but you can pass a historic commit as an argument.

#### Using Tracy to Profile Memory/CPU/Gate Counts

Tracy is a tool that gives us an in-depth look at certain performance related metrics, including memory, CPU usage, time, and circuit gate counts.
Expand Down
1 change: 0 additions & 1 deletion barretenberg/acir_tests/bench_acir_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ set -e

cd "$(dirname "$0")"

set -x
TEST_NAMES=("$@")
THREADS=(1 4 16 32 64)
BENCHMARKS=$LOG_FILE
Expand Down
58 changes: 40 additions & 18 deletions barretenberg/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,46 @@ source $(git rev-parse --show-toplevel)/ci3/source
# Download ignition up front to ensure no race conditions at runtime.
[ -n "${SKIP_BB_CRS:-}" ] || ./scripts/download_bb_crs.sh

./bbup/bootstrap.sh $@
./cpp/bootstrap.sh $@
./ts/bootstrap.sh $@
./acir_tests/bootstrap.sh $@
function bootstrap_all {
./bbup/bootstrap.sh $@
./cpp/bootstrap.sh $@
./ts/bootstrap.sh $@
./acir_tests/bootstrap.sh $@
}

cmd=${1:-}
if [ "$cmd" == "bench" ]; then
rm -rf bench-out && mkdir -p bench-out
./scripts/combine_benchmarks.py \
native ./cpp/bench-out/client_ivc_17_in_20_release.json \
native ./cpp/bench-out/client_ivc_release.json \
native ./cpp/bench-out/ultra_honk_release.json \
wasm ./cpp/bench-out/client_ivc_wasm.json \
wasm ./cpp/bench-out/ultra_honk_wasm.json \
"" ./cpp/bench-out/client_ivc_op_count.json \
"" ./cpp/bench-out/client_ivc_op_count_time.json \
wasm ./acir_tests/bench-out/ultra_honk_rec_wasm_memory.txt \
function hash {
cache_content_hash "^barretenberg"
}

function bench {
rm -rf bench-out && mkdir -p bench-out
local hash=$(hash)
if cache_download barretenberg-bench-results-$hash.tar.gz; then
return
fi
bootstrap_all bench
./scripts/combine_benchmarks.py \
./cpp/bench-out/*.json \
./acir_tests/bench-out/*.txt \
> ./bench-out/bb-bench.json
cache_upload barretenberg-bench-results-$hash.tar.gz ./bench-out/bb-bench.json
}

cmd=${1:-}
[ -n "$cmd" ] && shift

cache_upload barretenberg-bench-results-$COMMIT_HASH.tar.gz ./bench-out/bb-bench.json
fi
case "$cmd" in
hash)
hash
;;
""|clean|ci|fast|test|test_cmds|release)
bootstrap_all $cmd $@
;;
bench)
bench
;;
*)
echo "Unknown command: $cmd"
exit 1
;;
esac
1 change: 1 addition & 0 deletions barretenberg/cpp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ srs_db/*/bn254_g*
CMakeUserPresets.json
.vscode/settings.json
acir_tests
client-ivc-inputs-out
# we may download go in scripts/collect_heap_information.sh
go*.tar.gz
barretenberg_modules.dot
Expand Down
53 changes: 51 additions & 2 deletions barretenberg/cpp/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ cmd=${1:-}
export preset=clang16-assert
export pic_preset="clang16-pic"
export hash=$(cache_content_hash .rebuild_patterns)
export capture_ivc_folder=../../yarn-project/end-to-end/private-flows-ivc-inputs-out

# Injects version number into a given bb binary.
# Means we don't actually need to rebuild bb to release a new version if code hasn't changed.
Expand Down Expand Up @@ -173,7 +174,7 @@ function test_cmds {
grep -v 'DISABLED_' | \
while read -r test; do
echo -e "$hash barretenberg/cpp/scripts/run_test.sh $bin_name $test"
done
done || (echo "Failed to list tests in $bin" && exit 1)
done
}

Expand Down Expand Up @@ -205,6 +206,10 @@ function bench {

rm -rf bench-out && mkdir -p bench-out

# A bit pattern breaking, but the best code to instrument our private IVC flows exists in yarn-project,
# while the best code for benchmarking these IVC flows exists here.
# ../../yarn-project/end-to-end/bootstrap.sh generate_private_ivc_inputs

# Ultra honk.
function ultra_honk_release {
./build/bin/ultra_honk_bench \
Expand Down Expand Up @@ -245,14 +250,44 @@ function bench {
--benchmark_out=./bench-out/client_ivc_wasm.json \
--benchmark_filter="ClientIVCBench/Full/6$"
}
function client_ivc_flow {
set -eu
local flow=$1
local inputs_folder="$capture_ivc_folder/$flow"
local start=$(date +%s%N)
local maybe_allow_fail="false"
# TODO(AD) this should verify!
if [ "$flow" == "amm-add-liquidity" ]; then
maybe_allow_fail="true"
fi
mkdir -p "bench-out/$flow-proof-files"
./build/bin/bb prove -o "bench-out/$flow-proof-files" -b "$inputs_folder/acir.msgpack" -w "$inputs_folder/witnesses.msgpack" --scheme client_ivc --input_type runtime_stack || $maybe_allow_fail
echo "$flow has proven."
local end=$(date +%s%N)
local elapsed_ns=$(( end - start ))
local elapsed_ms=$(( elapsed_ns / 1000000 ))
cat > "./bench-out/$flow-ivc.json" <<EOF
{
"benchmarks": [
{
"name": "$flow-ivc-proof",
"time_unit": "ms",
"real_time": ${elapsed_ms}
}
]
}
EOF
}

function run_benchmark {
set -eu
local start_core=$(( ($1 - 1) * HARDWARE_CONCURRENCY ))
local end_core=$(( start_core + (HARDWARE_CONCURRENCY - 1) ))
echo taskset -c $start_core-$end_core bash -c "$2"
taskset -c $start_core-$end_core bash -c "$2"
}

export -f ultra_honk_release ultra_honk_wasm client_ivc_17_in_20_release client_ivc_release client_ivc_op_count client_ivc_op_count_time client_ivc_wasm run_benchmark
export -f ultra_honk_release ultra_honk_wasm client_ivc_17_in_20_release client_ivc_release client_ivc_op_count client_ivc_op_count_time client_ivc_wasm client_ivc_flow run_benchmark

local num_cpus=$(get_num_cpus)
local jobs=$((num_cpus / HARDWARE_CONCURRENCY))
Expand All @@ -266,6 +301,8 @@ function bench {
client_ivc_op_count_time \
client_ivc_wasm

# Split up the flows into chunks to run in parallel - otherwise we run out of CPUs to pin.
parallel -v --line-buffer --tag --jobs "$jobs" run_benchmark {#} '"client_ivc_flow {}"' ::: $(ls "$capture_ivc_folder")
}

# Upload assets to release.
Expand All @@ -291,6 +328,18 @@ case "$cmd" in
build
test
;;
download_e2e_ivc_inputs)
# Download the inputs for the private flows.
# Takes an optional master commit to download them from. Otherwise, downloads from latest master commit.
git fetch origin master
# Setting this env var will cause the script to download the inputs from the given commit (through the behavior of cache_content_hash).
export AZTEC_CACHE_COMMIT=${1:-origin/master}

# Error if the inputs are not found in cache.
export DOWNLOAD_ONLY=${DOWNLOAD_ONLY:-1}
../../yarn-project/end-to-end/bootstrap.sh generate_private_ivc_inputs
echo "Downloaded inputs for private flows to $capture_ivc_folder"
;;
"hash")
echo $hash
;;
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/scripts/_benchmark_remote_lock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ echo "Benchmarking lock created at ~/BENCHMARK_IN_PROGRESS."
trap cleanup EXIT
trap cleanup INT # handle ctrl-c

# don't exit, the caller script will run
# don't exit, the caller script will run
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ClientIVC {
using DataBusDepot = stdlib::DataBusDepot<ClientCircuit>;

/**
* @brief A full proof for the IVC scheme containing a Mega proof showing correctness of the hiding circuit (which
* @brief A full proof for the IVC scheme containing a Mega proof showing correctness of the hiding circuit (which
* recursive verified the last folding and decider proof) and a Goblin proof (translator VM, ECCVM and last merge
* proof).
*
Expand Down
Loading