Skip to content

Commit 6edf044

Browse files
committed
feat: add generated bb-avm-sim package setup
1 parent 01b5f7f commit 6edf044

148 files changed

Lines changed: 1186 additions & 229 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ endef
4747
# PHONY TARGETS - List every target that has a file/dir of the same name.
4848
#==============================================================================
4949

50-
.PHONY: noir barretenberg noir-projects l1-contracts release-image boxes playground docs aztec-up spartan wsdb
50+
.PHONY: noir barretenberg noir-projects l1-contracts release-image boxes playground docs aztec-up spartan wsdb bb-avm-sim
5151

5252
#==============================================================================
5353
# BOOTSTRAP TARGETS
@@ -69,7 +69,7 @@ full: fast bb-full-tests bb-cpp-full yarn-project-benches
6969
bench: yarn-project-benches bb-sol bb-acir
7070

7171
# Release. Everything plus copy bb cross compiles to ts projects.
72-
release: fast bb-cpp-release-dir bb-ts-cross-copy ipc-runtime-cross
72+
release: fast bb-cpp-release-dir bb-ts-cross-copy bb-avm-sim-cross-copy ipc-runtime-cross
7373

7474
#==============================================================================
7575
# Noir
@@ -104,7 +104,7 @@ avm-transpiler-cross: avm-transpiler-cross-amd64-macos avm-transpiler-cross-arm6
104104
#==============================================================================
105105

106106
# Barretenberg - Aggregate target for all barretenberg sub-projects.
107-
barretenberg: bb-cpp bb-ts bb-rs bb-acir bb-docs bb-sol bb-bbup bb-crs
107+
barretenberg: bb-cpp bb-ts bb-avm-sim bb-rs bb-acir bb-docs bb-sol bb-bbup bb-crs
108108

109109
# BB C++ - Main aggregate target.
110110
bb-cpp: bb-cpp-native bb-cpp-wasm bb-cpp-wasm-threads
@@ -220,11 +220,17 @@ bb-cpp-full: bb-cpp bb-cpp-gcc bb-cpp-fuzzing bb-cpp-asan bb-cpp-smt bb-cpp-cros
220220

221221
# BB TypeScript - TypeScript bindings
222222
bb-ts: bb-cpp-wasm bb-cpp-wasm-threads bb-cpp-native ipc-runtime
223-
$(call build,$@,barretenberg/ts)
223+
$(call build,$@,barretenberg/ts,build_bb_js)
224224

225225
# Copies the cross-compiles into bb.js.
226226
bb-ts-cross-copy: bb-ts bb-cpp-cross
227-
$(call build,$@,barretenberg/ts,cross_copy)
227+
$(call build,$@,barretenberg/ts,cross_copy_bb_js)
228+
229+
bb-avm-sim: ipc-codegen ipc-runtime bb-cpp-native
230+
$(call build,$@,barretenberg/ts,build_bb_avm_sim)
231+
232+
bb-avm-sim-cross-copy: bb-avm-sim bb-cpp-cross
233+
$(call build,$@,barretenberg/ts,cross_copy_bb_avm_sim)
228234

229235
# BB Rust - barretenberg-rs FFI crate
230236
bb-rs: bb-ts bb-cpp-native
@@ -387,7 +393,7 @@ l1-contracts-tests: l1-contracts-verifier
387393
# Yarn Project - TypeScript monorepo with all TS packages
388394
#==============================================================================
389395

390-
yarn-project: bb-ts noir-projects l1-contracts wsdb
396+
yarn-project: bb-ts noir-projects l1-contracts wsdb bb-avm-sim
391397
$(call build,$@,yarn-project)
392398

393399
yarn-project-tests: yarn-project

aztec-up/bootstrap.sh

100755100644
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
source $(git rev-parse --show-toplevel)/ci3/source_bootstrap
33

4-
hash=$(hash_str $(cache_content_hash ^aztec-up/) $(../ipc-runtime/bootstrap.sh hash) $(../wsdb/bootstrap.sh hash) $(../yarn-project/bootstrap.sh hash))
4+
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))
55

66
# Bare aliases ("nightly", "latest") resolve to this major version.
77
DEFAULT_MAJOR_VERSION=${AZTEC_TOOLCHAIN_DEFAULT_MAJOR_VERSION:-4}
@@ -13,6 +13,10 @@ function wsdb_package_dirs {
1313
echo "$root/wsdb/ts"
1414
}
1515

16+
function barretenberg_ts_package_dirs {
17+
"$root"/barretenberg/ts/bootstrap.sh get_projects
18+
}
19+
1620
function build {
1721
# Noop if user doesn't have docker.
1822
if ! command -v docker &>/dev/null; then
@@ -111,7 +115,7 @@ EOF
111115
echo "Deploying packages to local npm registry (version: $version)..."
112116
{
113117
echo $root/ipc-runtime/ts
114-
echo $root/barretenberg/ts
118+
barretenberg_ts_package_dirs
115119
wsdb_package_dirs
116120
$root/noir/bootstrap.sh get_projects
117121
$root/yarn-project/bootstrap.sh get_projects
@@ -187,7 +191,8 @@ function prep_test_mac {
187191

188192
# Ensure we've cross-compiled bb for macos. Normally this is only done on releases.
189193
../barretenberg/cpp/bootstrap.sh build_cross amd64-macos true
190-
../barretenberg/ts/bootstrap.sh cross_copy amd64-macos
194+
../barretenberg/ts/bootstrap.sh cross_copy_bb_js amd64-macos
195+
../barretenberg/ts/bootstrap.sh cross_copy_bb_avm_sim amd64-macos
191196

192197
# Ensure build artifacts exist.
193198
if [ ! -f ./bin/0.0.1/versions ] || [ ! -d ./verdaccio-storage ]; then

barretenberg/acir_tests/bbjs-test/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"build": "yarn tsgo"
77
},
88
"dependencies": {
9-
"@aztec/bb.js": "portal:../../ts",
9+
"@aztec/bb.js": "portal:../../ts/bb.js",
1010
"commander": "^12.1.0"
1111
},
1212
"devDependencies": {

barretenberg/acir_tests/browser-test-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"serve": "serve -n -L -p ${PORT:-8080} -c ../serve.json dest"
1010
},
1111
"devDependencies": {
12-
"@aztec/bb.js": "portal:../../ts",
12+
"@aztec/bb.js": "portal:../../ts/bb.js",
1313
"@types/pako": "^2.0.3",
1414
"html-webpack-plugin": "^5.6.0",
1515
"pako": "^2.1.0",

barretenberg/acir_tests/scripts/bbjs_legacy_cli_prove.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export HARDWARE_CONCURRENCY=8
66
cd ../acir_tests/$1
77

88
# NOTE The bb.js main file is deprecated!
9-
bbjs_bin="../../../ts/dest/node/main.js"
9+
bbjs_bin="../../../ts/bb.js/dest/node/main.js"
1010

1111
output_dir=$(mktemp -d ./output-XXXXXX)
1212
trap "rm -rf $output_dir" EXIT

barretenberg/acir_tests/yarn.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ __metadata:
2020
languageName: unknown
2121
linkType: soft
2222

23-
"@aztec/bb.js@portal:../../ts::locator=bbjs-test%40workspace%3Abbjs-test":
23+
"@aztec/bb.js@portal:../../ts/bb.js::locator=bbjs-test%40workspace%3Abbjs-test":
2424
version: 0.0.0-use.local
25-
resolution: "@aztec/bb.js@portal:../../ts::locator=bbjs-test%40workspace%3Abbjs-test"
25+
resolution: "@aztec/bb.js@portal:../../ts/bb.js::locator=bbjs-test%40workspace%3Abbjs-test"
2626
dependencies:
2727
comlink: "npm:^4.4.1"
2828
commander: "npm:^12.1.0"
@@ -35,9 +35,9 @@ __metadata:
3535
languageName: node
3636
linkType: soft
3737

38-
"@aztec/bb.js@portal:../../ts::locator=browser-test-app%40workspace%3Abrowser-test-app":
38+
"@aztec/bb.js@portal:../../ts/bb.js::locator=browser-test-app%40workspace%3Abrowser-test-app":
3939
version: 0.0.0-use.local
40-
resolution: "@aztec/bb.js@portal:../../ts::locator=browser-test-app%40workspace%3Abrowser-test-app"
40+
resolution: "@aztec/bb.js@portal:../../ts/bb.js::locator=browser-test-app%40workspace%3Abrowser-test-app"
4141
dependencies:
4242
comlink: "npm:^4.4.1"
4343
commander: "npm:^12.1.0"
@@ -1201,7 +1201,7 @@ __metadata:
12011201
version: 0.0.0-use.local
12021202
resolution: "bbjs-test@workspace:bbjs-test"
12031203
dependencies:
1204-
"@aztec/bb.js": "portal:../../ts"
1204+
"@aztec/bb.js": "portal:../../ts/bb.js"
12051205
"@typescript/native-preview": "npm:7.0.0-dev.20251126.1"
12061206
commander: "npm:^12.1.0"
12071207
languageName: unknown
@@ -1308,7 +1308,7 @@ __metadata:
13081308
version: 0.0.0-use.local
13091309
resolution: "browser-test-app@workspace:browser-test-app"
13101310
dependencies:
1311-
"@aztec/bb.js": "portal:../../ts"
1311+
"@aztec/bb.js": "portal:../../ts/bb.js"
13121312
"@types/pako": "npm:^2.0.3"
13131313
html-webpack-plugin: "npm:^5.6.0"
13141314
pako: "npm:^2.1.0"

barretenberg/cpp/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ go*.tar.gz
1515
barretenberg_modules.dot
1616
barretenberg_modules.png
1717
src/barretenberg/bb/config.hpp
18+
src/barretenberg/avm/generated/
19+
src/barretenberg/cdb/generated/
1820
bench-out
1921
*.bak
2022
src/barretenberg/avm_fuzzer/corpus/**

barretenberg/cpp/.rebuild_patterns

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
^barretenberg/cpp/.*\.(cpp|cc|cxx|c\+\+|h|hpp|hxx|h\+\+|c|h|inl|inc|ipp|tpp|cmake)$
22
^barretenberg/cpp/.*CMakeLists\.txt$
33
^barretenberg/cpp/.*Dockerfile.*$
4+
^barretenberg/cpp/src/barretenberg/avm/avm_schema\.json$
5+
^barretenberg/cpp/src/barretenberg/cdb/cdb_schema\.json$
46
^barretenberg/cpp/scripts/
57
^barretenberg/cpp/bootstrap.sh
68
^barretenberg/cpp/CMakePresets.json

barretenberg/cpp/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ For bb.js, run:
188188

189189
```bash
190190
barretenberg/cpp/scripts/chonk_inputs.sh download
191-
barretenberg/ts/scripts/run_test.sh bbapi/chonk_pinned_inputs.test.js
191+
barretenberg/ts/bb.js/scripts/run_test.sh bbapi/chonk_pinned_inputs.test.js
192192
```
193193

194194
Typical workflow

barretenberg/cpp/CMakePresets.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@
409409
"CC": "$env{WASI_SDK_PREFIX}/bin/clang",
410410
"CXX": "$env{WASI_SDK_PREFIX}/bin/clang++",
411411
"CXXFLAGS": "-DBB_VERBOSE -fvisibility=hidden",
412+
"LDFLAGS": "--no-wasm-opt",
412413
"AR": "$env{WASI_SDK_PREFIX}/bin/llvm-ar",
413414
"RANLIB": "$env{WASI_SDK_PREFIX}/bin/llvm-ranlib"
414415
},
@@ -800,25 +801,25 @@
800801
"name": "amd64-linux",
801802
"configurePreset": "amd64-linux",
802803
"inheritConfigureEnvironment": true,
803-
"targets": ["bb", "nodejs_module", "bb-external", "aztec-wsdb"]
804+
"targets": ["bb", "nodejs_module", "bb-external", "aztec-wsdb", "bb-avm-sim"]
804805
},
805806
{
806807
"name": "arm64-linux",
807808
"configurePreset": "arm64-linux",
808809
"inheritConfigureEnvironment": true,
809-
"targets": ["bb", "nodejs_module", "bb-external", "aztec-wsdb"]
810+
"targets": ["bb", "nodejs_module", "bb-external", "aztec-wsdb", "bb-avm-sim"]
810811
},
811812
{
812813
"name": "amd64-macos",
813814
"configurePreset": "amd64-macos",
814815
"inheritConfigureEnvironment": true,
815-
"targets": ["bb", "nodejs_module", "bb-external", "aztec-wsdb"]
816+
"targets": ["bb", "nodejs_module", "bb-external", "aztec-wsdb", "bb-avm-sim"]
816817
},
817818
{
818819
"name": "arm64-macos",
819820
"configurePreset": "arm64-macos",
820821
"inheritConfigureEnvironment": true,
821-
"targets": ["bb", "nodejs_module", "bb-external", "aztec-wsdb"]
822+
"targets": ["bb", "nodejs_module", "bb-external", "aztec-wsdb", "bb-avm-sim"]
822823
},
823824
{
824825
"name": "amd64-windows",

0 commit comments

Comments
 (0)