|
| 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. |
0 commit comments