Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
50 changes: 44 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,21 @@ endef
# PHONY TARGETS - List every target that has a file/dir of the same name.
#==============================================================================

.PHONY: noir barretenberg noir-projects l1-contracts release-image boxes playground docs aztec-up spartan
.PHONY: noir barretenberg noir-projects l1-contracts release-image boxes playground docs aztec-up spartan wsdb

#==============================================================================
# BOOTSTRAP TARGETS
#==============================================================================

# Fast bootstrap.
fast: release-image barretenberg boxes playground docs aztec-up \
bb-tests l1-contracts-tests yarn-project-tests boxes-tests playground-tests aztec-up-tests docs-tests noir-protocol-circuits-tests release-image-tests spartan claude-tests
bb-tests l1-contracts-tests yarn-project-tests boxes-tests playground-tests aztec-up-tests docs-tests noir-protocol-circuits-tests release-image-tests spartan claude-tests ipc-codegen-tests

# Full bootstrap.
full: fast bb-full-tests bb-cpp-full yarn-project-benches

# Release. Everything plus copy bb cross compiles to ts projects.
release: fast bb-cpp-release-dir bb-ts-cross-copy
release: fast bb-cpp-release-dir bb-ts-cross-copy ipc-runtime-cross

#==============================================================================
# Noir
Expand Down Expand Up @@ -205,13 +205,13 @@ bb-cpp-asan:
bb-cpp-smt:
$(call build,$@,barretenberg/cpp,build_smt_verification)

bb-cpp-release-dir: bb-cpp-native bb-cpp-cross
bb-cpp-release-dir: bb-cpp-native bb-cpp-cross bb-cpp-wasm bb-cpp-wasm-threads
$(call build,$@,barretenberg/cpp,build_release_dir)

bb-cpp-full: bb-cpp bb-cpp-gcc bb-cpp-fuzzing bb-cpp-asan bb-cpp-smt bb-cpp-cross-arm64-macos bb-cpp-cross-arm64-ios bb-cpp-cross-arm64-android

# BB TypeScript - TypeScript bindings
bb-ts: bb-cpp-wasm bb-cpp-wasm-threads bb-cpp-native
bb-ts: bb-cpp-wasm bb-cpp-wasm-threads bb-cpp-native ipc-runtime
$(call build,$@,barretenberg/ts)

# Copies the cross-compiles into bb.js.
Expand Down Expand Up @@ -275,6 +275,44 @@ bb-tests: bb-cpp-native-tests bb-acir-tests bb-ts-tests bb-sol-tests bb-bbup-tes

bb-full-tests: bb-cpp-wasm-threads-tests bb-cpp-asan-tests bb-cpp-smt-tests

#==============================================================================
# IPC Codegen
#==============================================================================

.PHONY: ipc-codegen ipc-codegen-tests
ipc-codegen:
$(call build,$@,ipc-codegen)

ipc-codegen-tests: ipc-codegen
$(call test,$@,ipc-codegen)

.PHONY: ipc-runtime ipc-runtime-tests ipc-runtime-cross
ipc-runtime:
$(call build,$@,ipc-runtime)

ipc-runtime-tests: ipc-runtime
$(call test,$@,ipc-runtime)

# Cross-compile the NAPI addon for the 3 non-host release targets.
# Host (amd64-linux) addon is produced by the standalone `ipc-runtime` target.
ipc-runtime-cross-arm64-linux:
$(call build,$@,ipc-runtime,build_cross arm64-linux)

ipc-runtime-cross-amd64-macos:
$(call build,$@,ipc-runtime,build_cross amd64-macos)

ipc-runtime-cross-arm64-macos:
$(call build,$@,ipc-runtime,build_cross arm64-macos)

ipc-runtime-cross: ipc-runtime ipc-runtime-cross-arm64-linux ipc-runtime-cross-amd64-macos ipc-runtime-cross-arm64-macos

#==============================================================================
# WSDB
#==============================================================================

wsdb: ipc-codegen ipc-runtime bb-cpp-native
$(call build,$@,wsdb)

#==============================================================================
# .claude tooling
#==============================================================================
Expand Down Expand Up @@ -341,7 +379,7 @@ l1-contracts-tests: l1-contracts-verifier
# Yarn Project - TypeScript monorepo with all TS packages
#==============================================================================

yarn-project: bb-ts noir-projects l1-contracts
yarn-project: bb-ts noir-projects l1-contracts wsdb
$(call build,$@,yarn-project)

yarn-project-tests: yarn-project
Expand Down
13 changes: 11 additions & 2 deletions aztec-up/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
#!/usr/bin/env bash
source $(git rev-parse --show-toplevel)/ci3/source_bootstrap

hash=$(hash_str $(cache_content_hash ^aztec-up/) $(../yarn-project/bootstrap.sh hash))
hash=$(hash_str $(cache_content_hash ^aztec-up/) $(../ipc-runtime/bootstrap.sh hash) $(../wsdb/bootstrap.sh hash) $(../yarn-project/bootstrap.sh hash))

# Bare aliases ("nightly", "latest") resolve to this major version.
DEFAULT_MAJOR_VERSION=${AZTEC_TOOLCHAIN_DEFAULT_MAJOR_VERSION:-4}

function wsdb_package_dirs {
for package_dir in "$root"/wsdb/ts/packages/*; do
[ -d "$package_dir" ] && echo "$package_dir"
done
echo "$root/wsdb/ts"
}

function build {
# Noop if user doesn't have docker.
if ! command -v docker &>/dev/null; then
Expand Down Expand Up @@ -103,7 +110,9 @@ EOF
# TODO(AD): we have kludged a retry here. a local NPM install ought to be robust enough not to.
echo "Deploying packages to local npm registry (version: $version)..."
{
echo $root/barretenberg/ts
echo $root/ipc-runtime/ts
(cd $root/barretenberg/ts && ./bootstrap.sh get_projects)
wsdb_package_dirs
$root/noir/bootstrap.sh get_projects
$root/yarn-project/bootstrap.sh get_projects
} | DRY_RUN= parallel --tag --line-buffer --halt now,fail=1 "retry 'cd {} && dump_fail \"deploy_npm $version\" >/dev/null'"
Expand Down
3 changes: 3 additions & 0 deletions barretenberg/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ bench-out
rust/barretenberg-rs/src/generated_types.rs
rust/barretenberg-rs/src/api.rs
ts/src/cbind/generated/

# Codegen output dirs (ipc-codegen emits into a `generated/` subdir under each consumer)
**/generated/
14 changes: 14 additions & 0 deletions barretenberg/acir_tests/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@aztec/bb.js@portal:../../ts::locator=bbjs-test%40workspace%3Abbjs-test"
dependencies:
"@aztec/ipc-runtime": "portal:../../ipc-runtime/ts"
comlink: "npm:^4.4.1"
commander: "npm:^12.1.0"
idb-keyval: "npm:^6.2.1"
Expand All @@ -39,6 +40,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@aztec/bb.js@portal:../../ts::locator=browser-test-app%40workspace%3Abrowser-test-app"
dependencies:
"@aztec/ipc-runtime": "portal:../../ipc-runtime/ts"
comlink: "npm:^4.4.1"
commander: "npm:^12.1.0"
idb-keyval: "npm:^6.2.1"
Expand All @@ -50,6 +52,18 @@ __metadata:
languageName: node
linkType: soft

"@aztec/ipc-runtime@portal:../../ipc-runtime/ts::locator=%40aztec%2Fbb.js%40portal%3A..%2F..%2Fts%3A%3Alocator%3Dbbjs-test%2540workspace%253Abbjs-test":
version: 0.0.0-use.local
resolution: "@aztec/ipc-runtime@portal:../../ipc-runtime/ts::locator=%40aztec%2Fbb.js%40portal%3A..%2F..%2Fts%3A%3Alocator%3Dbbjs-test%2540workspace%253Abbjs-test"
languageName: node
linkType: soft

"@aztec/ipc-runtime@portal:../../ipc-runtime/ts::locator=%40aztec%2Fbb.js%40portal%3A..%2F..%2Fts%3A%3Alocator%3Dbrowser-test-app%2540workspace%253Abrowser-test-app":
version: 0.0.0-use.local
resolution: "@aztec/ipc-runtime@portal:../../ipc-runtime/ts::locator=%40aztec%2Fbb.js%40portal%3A..%2F..%2Fts%3A%3Alocator%3Dbrowser-test-app%2540workspace%253Abrowser-test-app"
languageName: node
linkType: soft

"@babel/code-frame@npm:^7.0.0":
version: 7.26.2
resolution: "@babel/code-frame@npm:7.26.2"
Expand Down
6 changes: 6 additions & 0 deletions barretenberg/cpp/.rebuild_patterns
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@
^barretenberg/cpp/scripts/
^barretenberg/cpp/bootstrap.sh
^barretenberg/cpp/CMakePresets.json
# bbapi and ipc_runtime generate C++ headers via ipc-codegen at CMake-time.
# Treat the codegen sources + templates as part of bb-cpp's input so the CI
# cache key invalidates when the codegen changes.
^ipc-codegen/src/.*\.ts$
^ipc-codegen/templates/cpp/.*$
^ipc-runtime/cpp/.*$
9 changes: 5 additions & 4 deletions barretenberg/cpp/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@
"CC": "$env{WASI_SDK_PREFIX}/bin/clang",
"CXX": "$env{WASI_SDK_PREFIX}/bin/clang++",
"CXXFLAGS": "-DBB_VERBOSE -fvisibility=hidden",
"LDFLAGS": "--no-wasm-opt",
"AR": "$env{WASI_SDK_PREFIX}/bin/llvm-ar",
"RANLIB": "$env{WASI_SDK_PREFIX}/bin/llvm-ranlib"
},
Expand Down Expand Up @@ -800,25 +801,25 @@
"name": "amd64-linux",
"configurePreset": "amd64-linux",
"inheritConfigureEnvironment": true,
"targets": ["bb", "nodejs_module", "bb-external"]
"targets": ["bb", "nodejs_module", "bb-external", "aztec-wsdb"]
},
{
"name": "arm64-linux",
"configurePreset": "arm64-linux",
"inheritConfigureEnvironment": true,
"targets": ["bb", "nodejs_module", "bb-external"]
"targets": ["bb", "nodejs_module", "bb-external", "aztec-wsdb"]
},
{
"name": "amd64-macos",
"configurePreset": "amd64-macos",
"inheritConfigureEnvironment": true,
"targets": ["bb", "nodejs_module", "bb-external"]
"targets": ["bb", "nodejs_module", "bb-external", "aztec-wsdb"]
},
{
"name": "arm64-macos",
"configurePreset": "arm64-macos",
"inheritConfigureEnvironment": true,
"targets": ["bb", "nodejs_module", "bb-external"]
"targets": ["bb", "nodejs_module", "bb-external", "aztec-wsdb"]
},
{
"name": "amd64-windows",
Expand Down
1 change: 1 addition & 0 deletions barretenberg/cpp/cmake/module.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ function(barretenberg_module_with_sources MODULE_NAME)
target_link_libraries(
${BENCHMARK_NAME}_bench_objects
PRIVATE
${MODULE_DEPENDENCIES}
benchmark::benchmark
${TRACY_LIBS}
${TBB_IMPORTED_TARGETS}
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ elif [ "$1" == "changed" ]; then
format_files "$files"
fi
elif [ "$1" == "check" ]; then
files=$(find ./src -iname *.hpp -o -iname *.cpp -o -iname *.tcc | grep -v bb/deps)
files=$(find ./src -iname *.hpp -o -iname *.cpp -o -iname *.tcc | grep -v bb/deps | grep -v '/generated/')
echo "$files" | parallel -N10 clang-format-20 --dry-run --Werror
elif [ -n "$1" ]; then
files=$(git diff-index --relative --name-only $1 | grep -e '\.\(cpp\|hpp\|tcc\)$')
Expand Down
11 changes: 9 additions & 2 deletions barretenberg/cpp/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if(WASM)
add_link_options(-Wl,--export-memory,--import-memory,--stack-first,-z,stack-size=1048576,--max-memory=4294967296)
endif()

include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${MSGPACK_INCLUDE} ${TRACY_INCLUDE} ${LMDB_INCLUDE} ${LIBDEFLATE_INCLUDE} ${HTTPLIB_INCLUDE} ${BACKWARD_INCLUDE} ${NLOHMANN_JSON_INCLUDE})
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${MSGPACK_INCLUDE} ${TRACY_INCLUDE} ${LMDB_INCLUDE} ${LIBDEFLATE_INCLUDE} ${HTTPLIB_INCLUDE} ${BACKWARD_INCLUDE} ${NLOHMANN_JSON_INCLUDE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ipc-runtime/cpp)

# Add avm-transpiler include path when library is provided
if(AVM_TRANSPILER_LIB)
Expand Down Expand Up @@ -128,10 +128,17 @@ if(NOT FUZZING AND NOT WASM AND NOT BB_LITE)
add_subdirectory(barretenberg/vm2)
add_subdirectory(barretenberg/ipc)
add_subdirectory(barretenberg/wsdb)
add_subdirectory(barretenberg/wsdb_client)
add_subdirectory(barretenberg/vm2_wsdb)
add_subdirectory(barretenberg/cdb)
add_subdirectory(barretenberg/avm)
add_subdirectory(barretenberg/nodejs_module)
endif()

# Pull in ipc-runtime for native IPC servers and clients.
if(NOT FUZZING AND NOT WASM AND NOT BB_LITE)
add_subdirectory(${CMAKE_SOURCE_DIR}/../../ipc-runtime/cpp ${CMAKE_BINARY_DIR}/ipc-runtime)
endif()

if(FUZZING_AVM)
if(FUZZING)
# Only add these if they weren't added above (when NOT FUZZING AND NOT WASM)
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