Skip to content

Commit 1c3b9f3

Browse files
authored
feat: merge-train/barretenberg (#16606)
BEGIN_COMMIT_OVERRIDE chore: inline bb-cli-lib into bb executable (#16602) chore: Add comment to prevent out-of-sync databus ranges (#16589) chore(bb): CLAUDE.md (#16614) fix: set gate challenges in initial accumulator (#16613) fix: solidity gate challenge generation (#16623) chore: civc tidy 2 (#16600) END_COMMIT_OVERRIDE
2 parents 860dab2 + 620c91e commit 1c3b9f3

27 files changed

+409
-266
lines changed

barretenberg/cpp/CLAUDE.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
succint aztec-packages cheat sheet.
2+
3+
THE PROJECT ROOT IS AT TWO LEVELS ABOVE THIS FOLDER. Typically, the repository is at ~/aztec-packages. all advice is from the root.
4+
5+
Run ./bootstrap.sh at the top-level to be sure the repo fully builds.
6+
Bootstrap scripts can be called with relative paths e.g. ../barretenberg/bootstrap.sh
7+
You can use DISABLE_AVM=1 to bootstrap things generally.
8+
9+
# Working on modules:
10+
11+
## barretenberg/
12+
The core proving system library. Focus development is in barretenberg/cpp.
13+
14+
### cpp/ => cpp code for prover library
15+
Bootstrap modes:
16+
- `./bootstrap.sh` => full build, needed for other components
17+
- `./bootstrap.sh build` => standard build
18+
- `DISABLE_AVM=1 ./bootstrap.sh build_native` => quick build without AVM. Good for verifying compilation works. Needed to build ts/
19+
Development commands:
20+
- cmake --preset build-no-avm
21+
cd build-no-avm
22+
ninja <test>
23+
NOTE: DO NOT add the -j flag, default is optimal.
24+
where test is based on what you're working on:
25+
- `./bin/ultra_honk_tests` - Ultra Honk circuit tests
26+
- `./bin/client_ivc_tests` - Client IVC tests
27+
- `./bin/api_tests` - API/CLI tests
28+
- `./bin/stdlib_*_tests` - Standard library tests
29+
- `./bin/crypto_*_tests` - Cryptographic primitive tests
30+
31+
### Barretenberg module components:
32+
- **commitment_schemes/** - Polynomial commitment schemes (KZG, IPA)
33+
- **crypto/** - Cryptographic primitives (hashes, merkle trees, fields)
34+
- **ecc/** - Elliptic curve operations
35+
- **flavor/** - Circuit proving system flavors (Ultra, Mega)
36+
- **honk/** - The Honk proving system implementation
37+
- **stdlib/** - Circuit-friendly implementations of primitives
38+
- **ultra_honk/** - Ultra Honk prover/verifier
39+
- **client_ivc/** - Client-side IVC (Incremental Verifiable Computation)
40+
- **vm2/** - AVM implementation (not enabled, but might need to be fixed for compilation issues in root ./bootstrap.sh)
41+
- **bbapi/** - BB API for external interaction. If changing here, we will also want to update the ts/ folder because bb.js consumes this. (first build ninja bb in build/)
42+
- **dsl/** - ACIR definition in C++. This is dictated by the serialization in noir/, so refactor should generally not change the structure without confirming that the user is changing noir.
43+
44+
### ts/ => typescript code for bb.js
45+
Bootstrap modes:
46+
- `./bootstrap.sh` => generate TypeScript bindings and build. See package.json for more fine-grained commands.
47+
Other commands:
48+
- `yarn build:esm` => the quickest way to rebuild, if only changes inside ts/ folder, and only testing yarn-project.
49+
50+
## noir/
51+
### noir-repo/ => clone of noir programming language git repo
52+
Bootstrap modes:
53+
- `./bootstrap.sh` => standard build
54+
55+
## avm-transpiler:
56+
Transpiles Noir to AVM bytecode
57+
Bootstrap modes:
58+
- `./bootstrap.sh` => standard build
59+
60+
## Integration testing:
61+
The focus is on barretenberg/cpp development. Other components need to work with barretenberg changes:
62+
63+
### yarn-project/end-to-end - E2E tests that verify the full stack
64+
Run end-to-end tests from the root directory:
65+
```bash
66+
# Run specific e2e tests
67+
yarn-project/end-to-end/scripts/run_test.sh simple e2e_block_building
68+
# To run this you CANNOT USE DISABLE_AVM=1. Only run this if the user asks (e.g. 'run the prover full test') You first need to confirm with the user that they want to build without AVM.
69+
yarn-project/end-to-end/scripts/run_test.sh simple e2e_prover/full
70+
71+
### yarn-project IVC integration tests
72+
Run IVC (Incremental Verifiable Computation) integration tests from the root:
73+
```bash
74+
# Run specific IVC tests
75+
yarn-project/scripts/run_test.sh ivc-integration/src/native_client_ivc_integration.test.ts
76+
yarn-project/scripts/run_test.sh ivc-integration/src/wasm_client_ivc_integration.test.ts
77+
yarn-project/scripts/run_test.sh ivc-integration/src/browser_client_ivc_integration.test.ts
78+
79+
# Run rollup IVC tests (with verbose logging)
80+
BB_VERBOSE=1 yarn-project/scripts/run_test.sh ivc-integration/src/rollup_ivc_integration.test.ts
81+
```
82+
83+
When making barretenberg changes, ensure these tests still pass.

barretenberg/cpp/scripts/test_civc_standalone_vks_havent_changed.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ cd ..
1111
# - Generate a hash for versioning: sha256sum bb-civc-inputs.tar.gz
1212
# - Upload the compressed results: aws s3 cp bb-civc-inputs.tar.gz s3://aztec-ci-artifacts/protocol/bb-civc-inputs-[hash(0:8)].tar.gz
1313
# Note: In case of the "Test suite failed to run ... Unexpected token 'with' " error, need to run: docker pull aztecprotocol/build:3.0
14-
pinned_short_hash="197c2f73"
14+
pinned_short_hash="dba43b65"
1515
pinned_civc_inputs_url="https://aztec-ci-artifacts.s3.us-east-2.amazonaws.com/protocol/bb-civc-inputs-${pinned_short_hash}.tar.gz"
1616

1717
function compress_and_upload {

barretenberg/cpp/src/barretenberg/bb/CMakeLists.txt

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,23 @@
1-
# Used also by bb_cli_bench
2-
barretenberg_module(
3-
bb-cli-lib
4-
barretenberg
5-
env
6-
api
7-
circuit_checker
8-
${TRACY_LIBS}
9-
libdeflate::libdeflate_static)
10-
11-
if(NOT DISABLE_AZTEC_VM)
12-
add_dependencies(bb-cli-lib vm2)
13-
endif()
14-
151
if (NOT(FUZZING))
162
add_executable(
173
bb
184
main.cpp
5+
cli.cpp
196
)
207
target_link_libraries(
218
bb
229
PRIVATE
23-
bb-cli-lib
10+
barretenberg
11+
env
12+
api
13+
circuit_checker
14+
${TRACY_LIBS}
15+
libdeflate::libdeflate_static
2416
tracy_mem
2517
)
18+
if(NOT DISABLE_AZTEC_VM)
19+
add_dependencies(bb vm2)
20+
endif()
2621
if(CHECK_CIRCUIT_STACKTRACES OR ENABLE_STACKTRACES)
2722
target_link_libraries(
2823
bb

0 commit comments

Comments
 (0)