Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
1c10d71
refactor(bbapi): migrate bb + bb.js to ipc-codegen/ipc-runtime; delet…
charlielye Aug 30, 2026
e3fd534
test(bb-docs): budget the recursive example for running alongside a f…
charlielye Sep 30, 2026
5cd3ac0
perf(ipc): conditional SHM wakes made safe, and bb served by the seri…
charlielye Oct 6, 2026
84c1b0e
perf(ipc-runtime): skip the async hop in SpawnedProcessBackend.call, …
charlielye Oct 7, 2026
528c6dc
perf(ipc-runtime): pair SHM async responses through an in-order queue…
charlielye Oct 7, 2026
88ca7b7
perf(ipc-runtime): attribute call errors inside the client, not with …
charlielye Oct 7, 2026
3ac1601
test(bb.js): warm each poseidon bench mode before timing it
charlielye Oct 7, 2026
20c04b3
perf(ipc-runtime): share the in-order pending queue with the UDS client
charlielye Oct 7, 2026
9a35cb5
test(bb.js): don't mark the sync bench body async (require-await)
charlielye Oct 8, 2026
aa396f4
refactor(bb-rs): drop the pre-codegen compatibility layer
charlielye Oct 8, 2026
1db7ebf
fix(bb-rs): publish the ipc-runtime crate so barretenberg-rs can release
charlielye Oct 8, 2026
01df6ae
refactor(ipc-runtime): publish the Rust crate from ipc-runtime's own …
charlielye Oct 8, 2026
5d7a4ce
fix(ipc-runtime): fence the SHM conditional wake handshake
charlielye Oct 8, 2026
0051dc8
fix(ipc-runtime): drop the stream frame cap, buffer only what arrives
charlielye Oct 8, 2026
0fb7928
fix(ipc-runtime): keep stray stdout out of the stdio frame stream
charlielye Oct 8, 2026
018e97f
refactor(bb.js): remove findNapiBinary
charlielye Oct 8, 2026
b8a89ca
docs(bb): drop stale nodejs_module and findNapiBinary references
charlielye Oct 9, 2026
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
20 changes: 8 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -149,21 +149,17 @@ bb-crs:
bb-bbup:
$(call build,$@,barretenberg/bbup)

# Yarn install for nodejs_module (needed by presets that build nodejs_module)
bb-cpp-yarn:
$(call run_command,$@,$(ROOT)/barretenberg/cpp,$(ROOT)/ci3/denoise 'cd src/barretenberg/nodejs_module && yarn --immutable')

# Format check (skipped if cache hit)
bb-cpp-format-check:
$(call build,$@,barretenberg/cpp,build_format_check)

# BB C++ Native - Split into compilation and linking phases
# Compilation phase: Build barretenberg + vm2_sim objects (can run in parallel with avm-transpiler)
bb-cpp-native-objects: bb-cpp-yarn
bb-cpp-native-objects:
$(call build,$@,barretenberg/cpp,build_native_objects)

# Linking phase: Link all native binaries (needs avm-transpiler)
bb-cpp-native: bb-cpp-native-objects avm-transpiler-native bb-cpp-yarn bb-cpp-format-check
bb-cpp-native: bb-cpp-native-objects avm-transpiler-native bb-cpp-format-check
$(call build,$@,barretenberg/cpp,build_native)

bb-cpp-chonk-inputs:
Expand All @@ -178,25 +174,25 @@ bb-cpp-wasm-threads:
$(call build,$@,barretenberg/cpp,build_preset wasm-threads)

# Cross-compile object phases (parallel with avm-transpiler cross-compile)
bb-cpp-cross-arm64-linux-objects: bb-cpp-yarn
bb-cpp-cross-arm64-linux-objects:
$(call build,$@,barretenberg/cpp,build_cross_objects arm64-linux)

bb-cpp-cross-amd64-macos-objects: bb-cpp-yarn
bb-cpp-cross-amd64-macos-objects:
$(call build,$@,barretenberg/cpp,build_cross_objects amd64-macos)

bb-cpp-cross-arm64-macos-objects: bb-cpp-yarn
bb-cpp-cross-arm64-macos-objects:
$(call build,$@,barretenberg/cpp,build_cross_objects arm64-macos)

# Cross-compile for ARM64 Linux (release only)
bb-cpp-cross-arm64-linux: bb-cpp-native bb-cpp-cross-arm64-linux-objects avm-transpiler-cross-arm64-linux bb-cpp-yarn
bb-cpp-cross-arm64-linux: bb-cpp-native bb-cpp-cross-arm64-linux-objects avm-transpiler-cross-arm64-linux
$(call build,$@,barretenberg/cpp,build_preset arm64-linux)

# Cross-compile for AMD64 macOS (release only)
bb-cpp-cross-amd64-macos: bb-cpp-cross-arm64-linux bb-cpp-cross-amd64-macos-objects avm-transpiler-cross-amd64-macos bb-cpp-yarn
bb-cpp-cross-amd64-macos: bb-cpp-cross-arm64-linux bb-cpp-cross-amd64-macos-objects avm-transpiler-cross-amd64-macos
$(call build,$@,barretenberg/cpp,build_preset amd64-macos)

# Cross-compile for ARM64 macOS (release or CI_FULL)
bb-cpp-cross-arm64-macos: bb-cpp-cross-amd64-macos bb-cpp-cross-arm64-macos-objects avm-transpiler-cross-arm64-macos bb-cpp-yarn
bb-cpp-cross-arm64-macos: bb-cpp-cross-amd64-macos bb-cpp-cross-arm64-macos-objects avm-transpiler-cross-arm64-macos
$(call build,$@,barretenberg/cpp,build_preset arm64-macos)

# Cross-compile for AMD64 Windows (release only)
Expand Down
6 changes: 2 additions & 4 deletions barretenberg/.claude/skills/benchmark-avm/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ The benchmark is a jest test, `yarn-project/bb-prover/src/avm_proving_tests/avm_
The bulk test drives a real public-tx flow: it **simulates** the `AvmTest` contract against a live **world-state DB**, then **proves** with `bb-avm`. Since the world-state runs as a separate **IPC process** (`aztec-wsdb`) reached through two top-level components, `wsdb/` and `ipc-runtime/`, that are `portal:`-linked into yarn-project. A plain `./bootstrap.sh build yarn-project` does **not** wire these up (it serves cached artifacts), and the pinned `AvmTest` artifact and several `dest/` trees might go stale. The archaeology to discover all this is what turns a "quick bench" into hours; the recipe below is the distilled fast path. Run it from the repo root:

```bash
# 1. C++ binaries: AVM prover + native addon (@aztec/native) + IPC world-state DB
# 1. C++ binaries: AVM prover + IPC world-state DB
(cd barretenberg/cpp && cmake --preset default -DAVM=ON \
&& cmake --build build --target bb-avm aztec-wsdb nodejs_module)
(cd barretenberg/ts && BUILD_CPP=0 ./scripts/copy_native.sh) # place nodejs_module.node where findNapiBinary() looks
&& cmake --build build --target bb-avm aztec-wsdb)

# 2. IPC world-state stack (portal deps; NOT set up by a yarn-project build).
# wsdb/bootstrap.sh copies the aztec-wsdb binary built in step 1 into wsdb/ts/build/<arch>/.
Expand Down Expand Up @@ -46,7 +45,6 @@ Fast triage when the bulk test fails during setup:
| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `TypeError: NativeWorldState is not a constructor` (or `BaseNativeWorldState`), thrown from `world-state/dest/native/native_world_state_instance.js` | Stale `world-state`/`@aztec/native` `dest/` — merge-train changed the native world-state API (`@aztec/native` no longer exports `NativeWorldState`) but the compiled JS is pre-merge | `yarn build` (step 4) to recompile `dest/`. A cached `./bootstrap.sh build yarn-project` will **not** fix this — it restores the stale build. |
| `Cannot find module '@aztec-labs/wsdb'` / `'@aztec-foundation/ipc-runtime'` | The portal deps aren't installed | steps 2 + `yarn install` (step 4) |
| `NAPI binary not found for current platform` | `nodejs_module.node` not where `findNapiBinary()` looks | `(cd barretenberg/ts && BUILD_CPP=0 ./scripts/copy_native.sh)` |
| Test **reverts**: `expect(result.revertCode.isOK()).toBe(true)` fails, log shows `Reverted code: Reverted` and `Total instructions executed: 0` | Stale `AvmTest` artifact — pre-merge bytecode embeds old constants/gas vs the rebuilt bb-avm/simulator, so the call reverts at dispatch | step 3 (recompile `avm_test_contract`) + `yarn workspace @aztec/noir-test-contracts.js generate` + `yarn build` |

Note: `Total instructions executed: 0` prints even on a **healthy** passing run — that counter is a cosmetic metrics quirk, not a signal. The real health check is `revertCode` (OK vs Reverted) and a non-trivial `Proving (all)` time (a real bulk trace proves in ~4–5s; a truly empty one would be near-instant).
Expand Down
3 changes: 1 addition & 2 deletions barretenberg/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ cmake-build-debug
bench-out

# Generated code from msgpack schema (run `yarn generate` in ts/)
rust/barretenberg-rs/src/generated_types.rs
rust/barretenberg-rs/src/api.rs
rust/barretenberg-rs/src/generated/
ts/src/cbind/generated/

# Codegen output dirs (ipc-codegen emits into a `generated/` subdir under each consumer)
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Bootstrap modes:
- `./bootstrap.sh` => generate TypeScript bindings and build. See package.json for more fine-grained commands.
Other commands:
- `yarn build:esm` => the quickest way to rebuild, if only changes inside ts/ folder, and only testing yarn-project.
- `BUILD_CPP=1 scripts/copy_native.sh` => Ensures required cpp code is build (bb and nodejs_module) and copies into expected location.
- `BUILD_CPP=1 bb.js/scripts/copy_native.sh` => Builds the native bb binary and copies it to where bb.js expects it.

## Integration testing

Expand Down
3 changes: 2 additions & 1 deletion barretenberg/acir_tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"ws": "^8.17.1",
"basic-ftp": "^5.2.0",
"node-forge": "^1.3.2",
"serialize-javascript": "^7.0.3"
"serialize-javascript": "^7.0.3",
"@aztec-foundation/ipc-runtime": "portal:../../ipc-runtime/ts"
}
}
8 changes: 8 additions & 0 deletions barretenberg/acir_tests/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@aztec-foundation/bb.js@portal:../../ts/bb.js::locator=bbjs-test%40workspace%3Abbjs-test"
dependencies:
"@aztec-foundation/ipc-runtime": "@aztec-foundation/ipc-runtime"
comlink: "npm:^4.4.1"
commander: "npm:^12.1.0"
idb-keyval: "npm:^6.2.1"
Expand All @@ -32,6 +33,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@aztec-foundation/bb.js@portal:../../ts/bb.js::locator=browser-test-app%40workspace%3Abrowser-test-app"
dependencies:
"@aztec-foundation/ipc-runtime": "@aztec-foundation/ipc-runtime"
comlink: "npm:^4.4.1"
commander: "npm:^12.1.0"
idb-keyval: "npm:^6.2.1"
Expand All @@ -44,6 +46,12 @@ __metadata:
languageName: node
linkType: soft

"@aztec-foundation/ipc-runtime@portal:../../ipc-runtime/ts::locator=%40aztec%2Facir-tests%40workspace%3A.":
version: 0.0.0-use.local
resolution: "@aztec-foundation/ipc-runtime@portal:../../ipc-runtime/ts::locator=%40aztec%2Facir-tests%40workspace%3A."
languageName: node
linkType: soft

"@aztec/acir-tests@workspace:.":
version: 0.0.0-use.local
resolution: "@aztec/acir-tests@workspace:."
Expand Down
1 change: 1 addition & 0 deletions barretenberg/cpp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ barretenberg_modules.dot
barretenberg_modules.png
src/barretenberg/bb/config.hpp
src/barretenberg/avm/generated/
src/barretenberg/bbapi/generated/
src/barretenberg/cdb/generated/
bench-out
*.bak
Expand Down
10 changes: 5 additions & 5 deletions barretenberg/cpp/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@
{
"name": "amd64-windows",
"displayName": "Build for Windows amd64 with Zig",
"description": "Cross-compile for Windows x86_64 using Zig (MinGW). Excludes ipc/lmdb/world_state/nodejs_module (no Windows support).",
"description": "Cross-compile for Windows x86_64 using Zig (MinGW). Excludes world_state (no Windows support).",
"inherits": "cross-base",
"environment": {
"CC": "zig cc -target x86_64-windows-gnu",
Expand Down Expand Up @@ -801,25 +801,25 @@
"name": "amd64-linux",
"configurePreset": "amd64-linux",
"inheritConfigureEnvironment": true,
"targets": ["bb", "nodejs_module", "bb-external", "bb-avm-sim"]
"targets": ["bb", "bb-external", "bb-avm-sim"]
},
{
"name": "arm64-linux",
"configurePreset": "arm64-linux",
"inheritConfigureEnvironment": true,
"targets": ["bb", "bb-avm", "nodejs_module", "bb-external", "bb-avm-sim"]
"targets": ["bb", "bb-avm", "bb-external", "bb-avm-sim"]
},
{
"name": "amd64-macos",
"configurePreset": "amd64-macos",
"inheritConfigureEnvironment": true,
"targets": ["bb", "nodejs_module", "bb-external", "bb-avm-sim"]
"targets": ["bb", "bb-external", "bb-avm-sim"]
},
{
"name": "arm64-macos",
"configurePreset": "arm64-macos",
"inheritConfigureEnvironment": true,
"targets": ["bb", "nodejs_module", "bb-external", "bb-avm-sim"]
"targets": ["bb", "bb-external", "bb-avm-sim"]
},
{
"name": "amd64-windows",
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function build_native_objects {
if ! cache_exists barretenberg-$native_preset-$hash.zst; then
cmake --preset "$native_preset"
targets=$(cmake --build --preset "$native_preset" --target help | awk -F: '$1 ~ /(_objects|_tests|_bench|_gen|.a)$/ && $1 !~ /^cmake_/{print $1}' | tr '\n' ' ')
cmake --build --preset "$native_preset" --target $targets nodejs_module
cmake --build --preset "$native_preset" --target $targets
fi
}

Expand Down
6 changes: 1 addition & 5 deletions barretenberg/cpp/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,9 @@ if(NOT FUZZING AND NOT WASM AND NOT BB_LITE)
add_subdirectory(barretenberg/world_state_reference)
# NOTE: Do not conditionally base this on the AVM flag as it defines a necessary vm2_sim library.
add_subdirectory(barretenberg/vm2)
add_subdirectory(barretenberg/ipc)
add_subdirectory(barretenberg/vm2_wsdb)
add_subdirectory(barretenberg/cdb)
add_subdirectory(barretenberg/avm)
# nodejs_module hosts only the msgpack_client NAPI wrappers now (bb.js's SHM
# transport). The lmdb_store kv-store NAPI moved to native-packages/kvdb.
add_subdirectory(barretenberg/nodejs_module)
endif()

# Pull in ipc-runtime as a C++ dependency. Provides the `ipc_runtime`
Expand Down Expand Up @@ -226,7 +222,7 @@ add_library(
)

# bb-external: static library for external consumers (e.g. barretenberg-rs).
# Uses the core object list without lmdb/world_state — FFI consumers only need bbapi().
# Uses the core object list without lmdb/world_state — FFI consumers only need ipc_ffi_entry().
# Built with -fvisibility=hidden; only WASM_EXPORT symbols remain visible.
if(NOT WASM)
# world_state_reference (the in-memory reference merkle DB and its bb_wsref_* C ABI) rides
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/src/barretenberg/api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ if(AVM_TRANSPILER_LIB)
endif()

if(NOT WASM AND NOT BB_LITE)
target_link_libraries(api_objects PRIVATE ipc)
target_link_libraries(api_objects PRIVATE ipc_runtime)
endif()
Loading
Loading