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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ 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 wsdb bb-avm-sim
.PHONY: noir barretenberg noir-projects l1-contracts release-image boxes playground docs aztec-up spartan lmdblib kvdb wsdb bb-avm-sim

#==============================================================================
# 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 contract-snapshots-tests release-image-tests spartan claude-tests ipc-codegen-tests
bb-tests l1-contracts-tests yarn-project-tests boxes-tests playground-tests aztec-up-tests docs-tests noir-protocol-circuits-tests contract-snapshots-tests release-image-tests spartan claude-tests ipc-codegen-tests lmdblib-tests wsdb-tests

# Full bootstrap.
full: fast bb-full-tests bb-cpp-full yarn-project-benches
Expand Down Expand Up @@ -326,11 +326,29 @@ ipc-runtime-cross-arm64-macos:
ipc-runtime-cross: ipc-runtime ipc-runtime-cross-arm64-linux ipc-runtime-cross-amd64-macos ipc-runtime-cross-arm64-macos

#==============================================================================
# WSDB
# Native packages (lmdblib, kvdb, wsdb)
#==============================================================================

wsdb: ipc-codegen ipc-runtime bb-cpp-native
$(call build,$@,wsdb)
# lmdblib and kvdb are barretenberg-free: they build against their own deps
# (lmdb, msgpack-c, node-addon-api) only, never bb.
.PHONY: lmdblib kvdb lmdblib-tests wsdb-tests
lmdblib:
$(call build,$@,native-packages/lmdblib)

kvdb: lmdblib
$(call build,$@,native-packages/kvdb)

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

# Native-package C++ tests (self-contained gtest binaries). kvdb has no C++ tests
# (its NAPI is exercised by yarn-project's kv-store tests). wsdb_tests use no bb
# headers; the bb-header parity/equivalence target is manual (WSDB_BUILD_BB_TESTS).
lmdblib-tests: lmdblib
$(call test,$@,native-packages/lmdblib)

wsdb-tests: wsdb
$(call test,$@,native-packages/wsdb)

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

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

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

hash=$(hash_str $(cache_content_hash ^aztec-up/) $(../ipc-runtime/bootstrap.sh hash) $(../wsdb/bootstrap.sh hash) $(../barretenberg/ts/bootstrap.sh hash) $(../yarn-project/bootstrap.sh hash))
hash=$(hash_str $(cache_content_hash ^aztec-up/) $(../ipc-runtime/bootstrap.sh hash) $(../native-packages/kvdb/bootstrap.sh hash) $(../native-packages/wsdb/bootstrap.sh hash) $(../barretenberg/ts/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
for package_dir in "$root"/native-packages/wsdb/ts/packages/*; do
[ -d "$package_dir" ] && echo "$package_dir"
done
echo "$root/wsdb/ts"
echo "$root/native-packages/wsdb/ts"
}

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

function barretenberg_ts_package_dirs {
Expand Down Expand Up @@ -117,6 +124,7 @@ EOF
echo $root/ipc-runtime/ts
barretenberg_ts_package_dirs
wsdb_package_dirs
kvdb_package_dirs
# l1-artifacts lives under l1-contracts, so it isn't enumerated by yarn-project's get_projects;
# publish it explicitly or @aztec/aztec's portal dependency can't resolve from the local registry.
echo $root/l1-contracts/l1-artifacts
Expand Down
4 changes: 2 additions & 2 deletions barretenberg/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ project(
# === Platform Guard Reference ===
# __wasm__ : Compiler-defined for WebAssembly. Guards threading, file I/O, networking.
# _WIN32 : Compiler-defined for Windows. Guards POSIX APIs (mmap, signals, IPC).
# BB_LITE : CMake option. Excludes server-side subsystems (lmdb, world_state, ipc, nodejs_module).
# BB_LITE : CMake option. Excludes server-side subsystems (ipc, vm2_wsdb, cdb, avm).
# Enabled for: iOS, Android, Windows cross-compiles.
# WASM : CMake variable mirroring __wasm__ for CMake-level logic.

Expand Down Expand Up @@ -45,7 +45,7 @@ option(ENABLE_PIC "Builds with position independent code" OFF)
option(SYNTAX_ONLY "only check syntax (-fsyntax-only)" OFF)
option(ENABLE_WASM_BENCH "Enable BB_BENCH benchmarking support in WASM builds (dev only, not for releases)" OFF)
option(AVM "enable building of vm2 module and bb-avm" ON)
option(BB_LITE "Exclude server-side subsystems: lmdb, world_state, ipc, nodejs_module" OFF)
option(BB_LITE "Exclude server-side subsystems: ipc, vm2_wsdb, cdb, avm" OFF)

if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
message(STATUS "Compiling for ARM.")
Expand Down
8 changes: 4 additions & 4 deletions barretenberg/cpp/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -801,25 +801,25 @@
"name": "amd64-linux",
"configurePreset": "amd64-linux",
"inheritConfigureEnvironment": true,
"targets": ["bb", "nodejs_module", "bb-external", "aztec-wsdb", "bb-avm-sim"]
"targets": ["bb", "nodejs_module", "bb-external", "bb-avm-sim"]
},
{
"name": "arm64-linux",
"configurePreset": "arm64-linux",
"inheritConfigureEnvironment": true,
"targets": ["bb", "nodejs_module", "bb-external", "aztec-wsdb", "bb-avm-sim"]
"targets": ["bb", "nodejs_module", "bb-external", "bb-avm-sim"]
},
{
"name": "amd64-macos",
"configurePreset": "amd64-macos",
"inheritConfigureEnvironment": true,
"targets": ["bb", "nodejs_module", "bb-external", "aztec-wsdb", "bb-avm-sim"]
"targets": ["bb", "nodejs_module", "bb-external", "bb-avm-sim"]
},
{
"name": "arm64-macos",
"configurePreset": "arm64-macos",
"inheritConfigureEnvironment": true,
"targets": ["bb", "nodejs_module", "bb-external", "aztec-wsdb", "bb-avm-sim"]
"targets": ["bb", "nodejs_module", "bb-external", "bb-avm-sim"]
},
{
"name": "amd64-windows",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ Note: Paths relative to `aztec-packages/barretenberg/cpp/src/barretenberg`
### Node Store (Cache + Metadata)
8. `crypto/merkle_tree/node_store/cached_content_addressed_tree_store.hpp`
9. `crypto/merkle_tree/node_store/content_addressed_cache.hpp`
10. `crypto/merkle_tree/node_store/tree_meta.hpp`
10. `crypto/merkle_tree/tree_meta.hpp`

### Append-Only Tree
11. `crypto/merkle_tree/append_only_tree/content_addressed_append_only_tree.hpp`

### Indexed Tree
12. `crypto/merkle_tree/indexed_tree/content_addressed_indexed_tree.hpp`
13. `crypto/merkle_tree/indexed_tree/indexed_leaf.hpp`
13. `crypto/merkle_tree/indexed_leaf.hpp`

## Summary of Module

Expand Down
16 changes: 4 additions & 12 deletions barretenberg/cpp/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,17 @@ add_subdirectory(barretenberg/ultra_honk)
add_subdirectory(barretenberg/vm2_stub)
add_subdirectory(barretenberg/wasi)

if(NOT BB_LITE)
add_subdirectory(barretenberg/lmdblib)
endif()

if(NOT FUZZING AND NOT WASM AND NOT BB_LITE)
# Fuzzing preset cannot be built with world_state as world_state cannot compile with MULTITHREADING=OFF
# Mobile builds exclude these modules that require LMDB or aren't needed on mobile
# Mobile builds exclude these modules that aren't needed on mobile
add_subdirectory(barretenberg/aztec)
add_subdirectory(barretenberg/world_state)
# 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/wsdb)
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()

Expand All @@ -147,7 +142,6 @@ if(FUZZING_AVM)
if(FUZZING)
# Only add these if they weren't added above (when NOT FUZZING AND NOT WASM)
add_subdirectory(barretenberg/aztec)
add_subdirectory(barretenberg/world_state)
add_subdirectory(barretenberg/vm2)
endif()
add_subdirectory(barretenberg/avm_fuzzer)
Expand Down Expand Up @@ -216,11 +210,9 @@ set(BARRETENBERG_TARGET_OBJECTS
set(BB_EXTERNAL_TARGET_OBJECTS ${BARRETENBERG_TARGET_OBJECTS})

if(NOT WASM AND NOT FUZZING AND NOT BB_LITE)
# enable merkle trees and lmdb (not for mobile builds)
# enable merkle trees (not for mobile builds)
list(APPEND BARRETENBERG_TARGET_OBJECTS $<TARGET_OBJECTS:crypto_merkle_tree_objects>)
list(APPEND BARRETENBERG_TARGET_OBJECTS $<TARGET_OBJECTS:lmdblib_objects>)
list(APPEND BARRETENBERG_TARGET_OBJECTS $<TARGET_OBJECTS:api_objects>)
list(APPEND BARRETENBERG_TARGET_OBJECTS $<TARGET_OBJECTS:world_state_objects>)
endif()

add_library(
Expand Down
1 change: 0 additions & 1 deletion barretenberg/cpp/src/barretenberg/avm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ target_link_libraries(
barretenberg
vm2_sim
wsdb_ipc_merkle_db
wsdb_ipc_client
cdb_ipc_client
ipc_runtime
env
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/src/barretenberg/avm/avm_execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace bb::avm {

using namespace bb::avm2;
using namespace bb::world_state;
using bb::crypto::merkle_tree::WorldStateRevision;

// Cancellation for the single in-flight simulation. bb-avm-sim runs exactly one
// simulation at a time; the SIGUSR1 handler (which may run on any thread) cancels
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/src/barretenberg/avm/avm_execute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "barretenberg/avm/generated/avm_ipc_server.hpp"
#include "barretenberg/cdb/cdb_ipc_client.hpp"
#include "barretenberg/vm2/simulation/lib/cancellation_token.hpp"
#include "barretenberg/wsdb/generated/wsdb_ipc_client.hpp"
#include "barretenberg/vm2_wsdb/generated/wsdb_ipc_client.hpp"

#include <atomic>

Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/src/barretenberg/avm/avm_ipc_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "barretenberg/avm/avm_execute.hpp"
#include "barretenberg/cdb/cdb_ipc_client.hpp"
#include "barretenberg/common/log.hpp"
#include "barretenberg/wsdb/generated/wsdb_ipc_client.hpp"
#include "barretenberg/vm2_wsdb/generated/wsdb_ipc_client.hpp"
#include "ipc_runtime/ipc_server.hpp"
#include "ipc_runtime/serve_helper.hpp"
#include "ipc_runtime/signal_handlers.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "barretenberg/avm_fuzzer/fuzz_lib/constants.hpp"
#include "barretenberg/aztec/aztec_constants.hpp"
#include "barretenberg/common/throw_or_abort.hpp"
#include "barretenberg/crypto/merkle_tree/indexed_tree/indexed_leaf.hpp"
#include "barretenberg/crypto/merkle_tree/indexed_leaf.hpp"
#include "barretenberg/crypto/poseidon2/poseidon2.hpp"
#include "barretenberg/vm2/common/aztec_types.hpp"
#include "barretenberg/vm2/simulation/lib/contract_crypto.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <memory>
#include <stack>

#include "barretenberg/crypto/merkle_tree/indexed_tree/indexed_leaf.hpp"
#include "barretenberg/crypto/merkle_tree/indexed_leaf.hpp"
#include "barretenberg/vm2/common/aztec_types.hpp"
#include "barretenberg/vm2/simulation/interfaces/db.hpp"
#include "barretenberg/vm2/simulation/lib/memory_merkle_db.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <vector>

#include "barretenberg/avm_fuzzer/common/interfaces/dbs.hpp"
#include "barretenberg/crypto/merkle_tree/indexed_tree/indexed_leaf.hpp"
#include "barretenberg/crypto/merkle_tree/indexed_leaf.hpp"
#include "barretenberg/vm2/common/avm_io.hpp"
#include "barretenberg/vm2/common/aztec_types.hpp"
#include "barretenberg/vm2/common/field.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "barretenberg/avm_fuzzer/fuzz_lib/simulator.hpp"
#include "barretenberg/avm_fuzzer/mutations/bytecode.hpp"
#include "barretenberg/avm_fuzzer/mutations/tx_data.hpp"
#include "barretenberg/crypto/merkle_tree/indexed_tree/indexed_leaf.hpp"
#include "barretenberg/crypto/merkle_tree/indexed_leaf.hpp"
#include "barretenberg/serialize/msgpack_impl.hpp"
#include "barretenberg/vm2/common/avm_io.hpp"
#include "barretenberg/vm2/common/aztec_types.hpp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "barretenberg/crypto/merkle_tree/indexed_tree/indexed_leaf.hpp"
#include "barretenberg/crypto/merkle_tree/indexed_leaf.hpp"
#include "barretenberg/vm2/common/aztec_types.hpp"
#include <random>
#include <vector>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "barretenberg/aztec/aztec_constants.hpp"
#include "barretenberg/crypto/merkle_tree/hash.hpp"
#include "barretenberg/crypto/merkle_tree/indexed_tree/indexed_leaf.hpp"
#include "barretenberg/crypto/merkle_tree/indexed_leaf.hpp"

namespace bb::aztec {

Expand Down
2 changes: 0 additions & 2 deletions barretenberg/cpp/src/barretenberg/benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ add_subdirectory(relations_bench)
add_subdirectory(sumcheck_bench)
add_subdirectory(translator_bench)
add_subdirectory(poseidon2_bench)
add_subdirectory(indexed_tree_bench)
add_subdirectory(append_only_tree_bench)
add_subdirectory(ultra_bench)
add_subdirectory(circuit_construction_bench)

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# merkle tree is agnostic to hash function
barretenberg_module(
crypto_merkle_tree
lmdblib
)
# Need -fPIC because it's linked into the nodejs_module shared library
set_target_properties(crypto_merkle_tree_objects PROPERTIES POSITION_INDEPENDENT_CODE ON)
Expand Down
Loading
Loading