diff --git a/.devcontainer/dev/devcontainer.json b/.devcontainer/dev/devcontainer.json index 88631f248fd..cbef7f77374 100644 --- a/.devcontainer/dev/devcontainer.json +++ b/.devcontainer/dev/devcontainer.json @@ -1,6 +1,6 @@ { "name": "Development", - "image": "aztecprotocol/devbox:3.1", + "image": "aztecprotocol/devbox:3.2", "features": { // Use custom fork with noble added to list of supported distros. "./docker-in-docker": {} diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 234574c30e2..c4cb4386deb 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -51,7 +51,7 @@ body: attributes: label: Node Version description: Your Node.js version - placeholder: e.g. 24.15.0 + placeholder: e.g. 26.12.0 - type: textarea id: additional-context attributes: diff --git a/.nvmrc b/.nvmrc index f3c88209af5..3635429b74f 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v24.15.0 +v26.12.0 diff --git a/barretenberg/.claude/skills/benchmark-chonk/SKILL.md b/barretenberg/.claude/skills/benchmark-chonk/SKILL.md index ff46ce600a6..6e7eb9f674d 100644 --- a/barretenberg/.claude/skills/benchmark-chonk/SKILL.md +++ b/barretenberg/.claude/skills/benchmark-chonk/SKILL.md @@ -131,7 +131,7 @@ HARDWARE_CONCURRENCY=8 BB_BENCH=1 \ ``` The wasmtime wrapper sets: -- `-Wthreads=y -Sthreads=y` — enable WASM threads and shared memory +- `-Wthreads=y -Wshared-memory=y -Wexceptions=y -Sthreads=y` — enable WASM threads, shared memory and exception handling - `--env HARDWARE_CONCURRENCY` — thread count - `--env BB_BENCH` — enable operation counting (requires configuring with `-DENABLE_WASM_BENCH=ON`; it is OFF by default in the `wasm-threads` preset to keep the shipped wasm fast) - `--dir=$HOME/.bb-crs --dir=.` — filesystem access for CRS and working directory diff --git a/barretenberg/.claude/skills/profile-chonk/SKILL.md b/barretenberg/.claude/skills/profile-chonk/SKILL.md index df2977eb6c7..6d382439b44 100644 --- a/barretenberg/.claude/skills/profile-chonk/SKILL.md +++ b/barretenberg/.claude/skills/profile-chonk/SKILL.md @@ -138,7 +138,7 @@ ssh $BB_SSH_KEY $BB_SSH_INSTANCE " cd $REMOTE_DIR HARDWARE_CONCURRENCY=$HARDWARE_CONCURRENCY \ /home/ubuntu/.wasmtime/bin/wasmtime run \ - -Wthreads=y -Sthreads=y -Wshared-memory=y \ + -Wthreads=y -Wexceptions=y -Sthreads=y -Wshared-memory=y \ --env HARDWARE_CONCURRENCY --env HOME --env BB_BENCH=1 \ --dir=\$HOME/.bb-crs --dir=. \ ./bin/bb prove \ diff --git a/barretenberg/.claude/skills/remote-bench/SKILL.md b/barretenberg/.claude/skills/remote-bench/SKILL.md index a4845bc42d7..f34e43f4217 100644 --- a/barretenberg/.claude/skills/remote-bench/SKILL.md +++ b/barretenberg/.claude/skills/remote-bench/SKILL.md @@ -203,7 +203,7 @@ ssh $BB_SSH_KEY $BB_SSH_INSTANCE \ "cd $BB_SSH_CPP_PATH/build-wasm-threads && \ HARDWARE_CONCURRENCY=16 \ /home/ubuntu/.wasmtime/bin/wasmtime run \ - -Wthreads=y -Sthreads=y \ + -Wthreads=y -Wshared-memory=y -Wexceptions=y -Sthreads=y \ --env HARDWARE_CONCURRENCY \ --env HOME \ --env BB_BENCH=1 \ diff --git a/barretenberg/acir_tests/headless-test/package.json b/barretenberg/acir_tests/headless-test/package.json index 1f16ffb506e..0db3ad32e87 100644 --- a/barretenberg/acir_tests/headless-test/package.json +++ b/barretenberg/acir_tests/headless-test/package.json @@ -10,7 +10,7 @@ "dependencies": { "chalk": "^5.3.0", "commander": "^12.1.0", - "playwright": "1.49.0", + "playwright": "1.63.0", "puppeteer": "^24.22.3" }, "devDependencies": { diff --git a/barretenberg/acir_tests/yarn.lock b/barretenberg/acir_tests/yarn.lock index 91e9dd9eb49..0c3d79ceb2d 100644 --- a/barretenberg/acir_tests/yarn.lock +++ b/barretenberg/acir_tests/yarn.lock @@ -2466,16 +2466,6 @@ __metadata: languageName: node linkType: hard -"fsevents@npm:2.3.2": - version: 2.3.2 - resolution: "fsevents@npm:2.3.2" - dependencies: - node-gyp: "npm:latest" - checksum: 10c0/be78a3efa3e181cda3cf7a4637cb527bcebb0bd0ea0440105a3bb45b86f9245b307dc10a2507e8f4498a7d4ec349d1910f4d73e4d4495b16103106e07eee735b - conditions: os=darwin - languageName: node - linkType: hard - "fsevents@npm:~2.3.2": version: 2.3.3 resolution: "fsevents@npm:2.3.3" @@ -2486,15 +2476,6 @@ __metadata: languageName: node linkType: hard -"fsevents@patch:fsevents@npm%3A2.3.2#optional!builtin": - version: 2.3.2 - resolution: "fsevents@patch:fsevents@npm%3A2.3.2#optional!builtin::version=2.3.2&hash=df0bf1" - dependencies: - node-gyp: "npm:latest" - conditions: os=darwin - languageName: node - linkType: hard - "fsevents@patch:fsevents@npm%3A~2.3.2#optional!builtin": version: 2.3.3 resolution: "fsevents@patch:fsevents@npm%3A2.3.3#optional!builtin::version=2.3.3&hash=df0bf1" @@ -2675,7 +2656,7 @@ __metadata: dependencies: chalk: "npm:^5.3.0" commander: "npm:^12.1.0" - playwright: "npm:1.49.0" + playwright: "npm:1.63.0" puppeteer: "npm:^24.22.3" ts-node: "npm:^10.9.2" typescript: "npm:^5.4.2" @@ -4097,27 +4078,23 @@ __metadata: languageName: node linkType: hard -"playwright-core@npm:1.49.0": - version: 1.49.0 - resolution: "playwright-core@npm:1.49.0" +"playwright-core@npm:1.63.0": + version: 1.63.0 + resolution: "playwright-core@npm:1.63.0" bin: playwright-core: cli.js - checksum: 10c0/22c1a72fabdcc87bd1cd4d40a032d2c5b94cf94ba7484dc182048c3fa1c8ec26180b559d8cac4ca9870e8fd6bdf5ef9d9f54e7a31fd60d67d098fcffc5e4253b + checksum: 10c0/39c1ebae4029ca2e9371e00a5588d962038e24b6e0bdb7d0d27374dde04838f349b83ae0c8b3b648653d0935cba7fb9011f1201adaab9dd0db7801ad6c75e9aa languageName: node linkType: hard -"playwright@npm:1.49.0": - version: 1.49.0 - resolution: "playwright@npm:1.49.0" +"playwright@npm:1.63.0": + version: 1.63.0 + resolution: "playwright@npm:1.63.0" dependencies: - fsevents: "npm:2.3.2" - playwright-core: "npm:1.49.0" - dependenciesMeta: - fsevents: - optional: true + playwright-core: "npm:1.63.0" bin: playwright: cli.js - checksum: 10c0/e94d662747cd147d0573570fec90dadc013c1097595714036fc8934a075c5a82ab04a49111b03b1f762ea86429bdb7c94460901896901e20970b30ce817cc93f + checksum: 10c0/d1fd048a89be27c9aba6757dc4f70eff4a5163b49f439ad691767be8b2a482327d0dd1928b4f73c8fe0d8b33aab2c9dc2670424ab60f112d9e98e91b94e3b090 languageName: node linkType: hard diff --git a/barretenberg/cpp/CLAUDE.md b/barretenberg/cpp/CLAUDE.md index a31f266ece4..3e1cd891153 100644 --- a/barretenberg/cpp/CLAUDE.md +++ b/barretenberg/cpp/CLAUDE.md @@ -89,7 +89,7 @@ clang-format-20 -i These are load-bearing: violating them will compile on native but break WASM, or skew test output in CI. Use the listed alternative unconditionally. - **Logging: use `info(...)` / `vinfo(...)` from `barretenberg/common/log.hpp`, never `std::cout` or `std::cerr`.** The macros route through `log_function` and respect `bb_log_level`; direct `std::cout` is unfiltered, uncaptured in CI logs, and skews benchmark output. -- **Aborts and exceptions: use `throw_or_abort(msg)` from `barretenberg/common/throw_or_abort.hpp`, never bare `throw` or `std::abort()`.** WASM builds set `BB_NO_EXCEPTIONS`, which turns `throw` into `abort()` — bare `throw` compiles differently and misformats the message, and raw `std::abort()` drops the message entirely. For header-only libraries that must use exception syntax, use the `THROW`/`RETHROW` macros from `common/try_catch_shim.hpp`. +- **Aborts and exceptions: use `throw_or_abort(msg)` from `barretenberg/common/throw_or_abort.hpp`, never bare `throw` or `std::abort()`.** Builds that set `BB_NO_EXCEPTIONS` (the `clang20-no-exceptions` preset; WASM builds now use wasm exception handling) turn `throw_or_abort` into `abort()`, and raw `std::abort()` drops the message entirely. For header-only libraries that must use exception syntax, use the `THROW`/`RETHROW` macros from `common/try_catch_shim.hpp`. - **Assertions: use `BB_ASSERT(cond, msg)` / `BB_ASSERT_EQ` / `BB_ASSERT_NEQ` / `BB_ASSERT_GT` / etc. from `barretenberg/common/assert.hpp`, never bare `assert(...)`.** `BB_ASSERT` hooks into the benchmark-assertion framework and has distinct debug/release behavior; `assert` is stripped in release builds and silently diverges in WASM. - **Release builds: do not reach for the `release` CMake preset unless the user is reproducing a performance issue.** Debug/default presets are much faster to compile and sufficient for correctness work. diff --git a/barretenberg/cpp/CMakePresets.json b/barretenberg/cpp/CMakePresets.json index bcb0a8b9d32..8088676132a 100644 --- a/barretenberg/cpp/CMakePresets.json +++ b/barretenberg/cpp/CMakePresets.json @@ -421,8 +421,7 @@ "CMAKE_FIND_ROOT_PATH_MODE_PACKAGE": "ONLY", "CMAKE_C_COMPILER_WORKS": "ON", "CMAKE_CXX_COMPILER_WORKS": "ON", - "MULTITHREADING": "OFF", - "CMAKE_CXX_FLAGS": "-DBB_NO_EXCEPTIONS" + "MULTITHREADING": "OFF" } }, { diff --git a/barretenberg/cpp/cmake/arch.cmake b/barretenberg/cpp/cmake/arch.cmake index c8158dfb8cc..41132e9ea16 100644 --- a/barretenberg/cpp/cmake/arch.cmake +++ b/barretenberg/cpp/cmake/arch.cmake @@ -2,7 +2,11 @@ if(WASM) # Disable SLP vectorization on WASM as it's brokenly slow. To give an idea, with this off it still takes # 2m:18s to compile scalar_multiplication.cpp, and with it on I estimate it's 50-100 times longer. I never # had the patience to wait it out... - add_compile_options(-fno-exceptions -fno-slp-vectorize) + add_compile_options(-fno-slp-vectorize) + # Standard (exnref) wasm exception handling. wasi-sdk 33+ ships a sysroot built with it, selected by + # -fwasm-exceptions at link time; libunwind provides the unwinder. + add_compile_options(-fwasm-exceptions -mllvm -wasm-use-legacy-eh=false) + add_link_options(-fwasm-exceptions -lunwind) endif() # Target skylake on x86 for AVX2 etc. ARM is handled by the zig wrapper scripts diff --git a/barretenberg/cpp/cmake/benchmark.cmake b/barretenberg/cpp/cmake/benchmark.cmake index fb72f700766..d18755e9d5d 100644 --- a/barretenberg/cpp/cmake/benchmark.cmake +++ b/barretenberg/cpp/cmake/benchmark.cmake @@ -18,3 +18,7 @@ if(NOT benchmark_FOUND) set_property(DIRECTORY ${benchmark_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL) set_property(DIRECTORY ${benchmark_BINARY_DIR} PROPERTY EXCLUDE_FROM_ALL) endif() +# The library builds with -pedantic-errors, and clang 23 (wasi-sdk 34) flags its __COUNTER__ as a C2y extension. +if(TARGET benchmark AND CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 23) + target_compile_options(benchmark PRIVATE -Wno-c2y-extensions) +endif() diff --git a/barretenberg/cpp/cmake/threading.cmake b/barretenberg/cpp/cmake/threading.cmake index 5092e8064c6..99c25b93768 100644 --- a/barretenberg/cpp/cmake/threading.cmake +++ b/barretenberg/cpp/cmake/threading.cmake @@ -3,8 +3,8 @@ if(MULTITHREADING) add_compile_options(-pthread) add_link_options(-pthread) if(WASM) - add_compile_options(--target=wasm32-wasi-threads) - add_link_options(--target=wasm32-wasi-threads -Wl,--shared-memory) + add_compile_options(--target=wasm32-wasip1-threads) + add_link_options(--target=wasm32-wasip1-threads -Wl,--shared-memory) # Prevent indirect call type mismatch errors in thread_local destructors # (without this the benchmark flow fails at destruction point for WASM) add_compile_options(-fno-c++-static-destructors) diff --git a/barretenberg/cpp/scripts/benchmark_wasm.sh b/barretenberg/cpp/scripts/benchmark_wasm.sh index 0b4483c7c09..a307fe3ffe7 100755 --- a/barretenberg/cpp/scripts/benchmark_wasm.sh +++ b/barretenberg/cpp/scripts/benchmark_wasm.sh @@ -17,4 +17,4 @@ cmake --build --preset wasm-threads --target $BENCHMARK cd build-wasm-threads # Consistency with _wasm.sh targets / shorter $COMMAND. cp ./bin/$BENCHMARK . -wasmtime run --env HARDWARE_CONCURRENCY=$HARDWARE_CONCURRENCY -Wthreads=y -Sthreads=y --dir=.. $COMMAND \ No newline at end of file +wasmtime run --env HARDWARE_CONCURRENCY=$HARDWARE_CONCURRENCY -Wthreads=y -Wshared-memory=y -Wexceptions=y -Sthreads=y --dir=.. $COMMAND \ No newline at end of file diff --git a/barretenberg/cpp/scripts/benchmark_wasm_remote.sh b/barretenberg/cpp/scripts/benchmark_wasm_remote.sh index 62213556579..18ce7aa0543 100755 --- a/barretenberg/cpp/scripts/benchmark_wasm_remote.sh +++ b/barretenberg/cpp/scripts/benchmark_wasm_remote.sh @@ -27,4 +27,4 @@ ssh $BB_SSH_KEY $BB_SSH_INSTANCE "mkdir -p $BB_SSH_CPP_PATH/build-wasm-threads" scp $BB_SSH_KEY ./bin/$BENCHMARK $BB_SSH_INSTANCE:$BB_SSH_CPP_PATH/build-wasm-threads # run wasm benchmarking ssh $BB_SSH_KEY $BB_SSH_INSTANCE \ - "cd $BB_SSH_CPP_PATH/build-wasm-threads ; /home/ubuntu/.wasmtime/bin/wasmtime run --env HARDWARE_CONCURRENCY=$HARDWARE_CONCURRENCY -Wthreads=y -Sthreads=y --dir=.. $COMMAND" + "cd $BB_SSH_CPP_PATH/build-wasm-threads ; /home/ubuntu/.wasmtime/bin/wasmtime run --env HARDWARE_CONCURRENCY=$HARDWARE_CONCURRENCY -Wthreads=y -Wshared-memory=y -Wexceptions=y -Sthreads=y --dir=.. $COMMAND" diff --git a/barretenberg/cpp/scripts/profile_wasm_samply.sh b/barretenberg/cpp/scripts/profile_wasm_samply.sh index 218ed2b8f89..27d0e333f30 100755 --- a/barretenberg/cpp/scripts/profile_wasm_samply.sh +++ b/barretenberg/cpp/scripts/profile_wasm_samply.sh @@ -16,4 +16,4 @@ cmake --build --preset wasm-threads --target $BENCHMARK cd build-wasm-threads # Consistency with _wasm.sh targets / shorter $COMMAND. cp ./bin/$BENCHMARK . -samply record wasmtime run --profile=perfmap --env HARDWARE_CONCURRENCY=$HARDWARE_CONCURRENCY -Wthreads=y -Sthreads=y --dir=.. $COMMAND \ No newline at end of file +samply record wasmtime run --profile=perfmap --env HARDWARE_CONCURRENCY=$HARDWARE_CONCURRENCY -Wthreads=y -Wshared-memory=y -Wexceptions=y -Sthreads=y --dir=.. $COMMAND \ No newline at end of file diff --git a/barretenberg/cpp/scripts/wasmtime.sh b/barretenberg/cpp/scripts/wasmtime.sh index 3ad657d5798..f59c4588e4b 100755 --- a/barretenberg/cpp/scripts/wasmtime.sh +++ b/barretenberg/cpp/scripts/wasmtime.sh @@ -5,6 +5,8 @@ set -eu export WASMTIME_BACKTRACE_DETAILS=1 exec wasmtime run \ -Wthreads=y \ + -Wshared-memory=y \ + -Wexceptions=y \ -Sthreads=y \ ${HARDWARE_CONCURRENCY:+--env HARDWARE_CONCURRENCY} \ --env HOME \ diff --git a/barretenberg/cpp/src/barretenberg/bbapi/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/bbapi/CMakeLists.txt index e7a90defb53..827c086d1de 100644 --- a/barretenberg/cpp/src/barretenberg/bbapi/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/bbapi/CMakeLists.txt @@ -22,7 +22,7 @@ if(NOT FUZZING) ) add_custom_command( OUTPUT ${BB_GEN_OUTPUTS} - COMMAND node --experimental-strip-types --experimental-transform-types --no-warnings + COMMAND node --experimental-strip-types --no-warnings ${IPC_CODEGEN_DIR}/src/generate.ts --schema ${BB_SCHEMA} --lang cpp diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplonk.hpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplonk.hpp index 98b5e0dc69c..0112f0bb328 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplonk.hpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplonk.hpp @@ -615,7 +615,7 @@ template class ShplonkVerifier_ { * */ template -static std::vector compute_shplonk_batching_challenge_powers(const Fr& shplonk_batching_challenge, +inline std::vector compute_shplonk_batching_challenge_powers(const Fr& shplonk_batching_challenge, const size_t virtual_log_n, bool has_zk = false, bool committed_sumcheck = false) diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/small_subgroup_ipa/small_subgroup_ipa.hpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/small_subgroup_ipa/small_subgroup_ipa.hpp index 7422a1f9e86..ce188e77b32 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/small_subgroup_ipa/small_subgroup_ipa.hpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/small_subgroup_ipa/small_subgroup_ipa.hpp @@ -420,7 +420,7 @@ template class SmallSubgroupIPAVerifier { * @return Polynomial */ template -static std::vector compute_challenge_polynomial_coeffs( +inline std::vector compute_challenge_polynomial_coeffs( const std::vector& multivariate_challenge) { diff --git a/barretenberg/cpp/src/barretenberg/common/ref_vector.hpp b/barretenberg/cpp/src/barretenberg/common/ref_vector.hpp index bfc92e13055..d4f1b63d5ec 100644 --- a/barretenberg/cpp/src/barretenberg/common/ref_vector.hpp +++ b/barretenberg/cpp/src/barretenberg/common/ref_vector.hpp @@ -173,7 +173,7 @@ template RefVector concatenate(const RefVector& ref_vector, c } /* @details Ensures a nested vector holds reference objects */ -template static std::vector> to_vector_of_ref_vectors(std::vector>& vec) +template inline std::vector> to_vector_of_ref_vectors(std::vector>& vec) { std::vector> result; for (std::vector& inner : vec) { diff --git a/barretenberg/cpp/src/barretenberg/common/throw_or_abort.hpp b/barretenberg/cpp/src/barretenberg/common/throw_or_abort.hpp index c6856f40c26..7956a978d22 100644 --- a/barretenberg/cpp/src/barretenberg/common/throw_or_abort.hpp +++ b/barretenberg/cpp/src/barretenberg/common/throw_or_abort.hpp @@ -1,9 +1,16 @@ #pragma once #include "barretenberg/env/throw_or_abort_impl.hpp" #include "log.hpp" +#include #include inline void throw_or_abort [[noreturn]] (std::string const& err) { +#if defined(__wasm__) && !defined(BB_NO_EXCEPTIONS) + // Throw inside the module, so catch blocks such as bbapi's error responses see it. The JavaScript environment's + // throw_or_abort_impl throws a JS error, which unwinds the module without running them or any destructors. + throw std::runtime_error(err); +#else throw_or_abort_impl(err.c_str()); +#endif } diff --git a/barretenberg/cpp/src/barretenberg/common/utils.cpp b/barretenberg/cpp/src/barretenberg/common/utils.cpp index 312ccb9a377..f55167a5273 100644 --- a/barretenberg/cpp/src/barretenberg/common/utils.cpp +++ b/barretenberg/cpp/src/barretenberg/common/utils.cpp @@ -1,5 +1,7 @@ #include "./utils.hpp" +#include + namespace bb::utils { std::vector hex_to_bytes(const std::string& hex) diff --git a/barretenberg/cpp/src/barretenberg/crypto/schnorr/schnorr.tcc b/barretenberg/cpp/src/barretenberg/crypto/schnorr/schnorr.tcc index 16fe624c72d..b8f1d3d2eef 100644 --- a/barretenberg/cpp/src/barretenberg/crypto/schnorr/schnorr.tcc +++ b/barretenberg/cpp/src/barretenberg/crypto/schnorr/schnorr.tcc @@ -51,7 +51,7 @@ template static inline Fq compute_schnorr_challenge_dst() * @return e as a bb::fr element */ template -static typename G1::Fq schnorr_generate_challenge(const typename G1::Fq& message_field, +inline typename G1::Fq schnorr_generate_challenge(const typename G1::Fq& message_field, const typename G1::affine_element& pubkey, const typename G1::affine_element& R) { diff --git a/barretenberg/rust/bootstrap.sh b/barretenberg/rust/bootstrap.sh index b49097e57f4..445dcff0d68 100755 --- a/barretenberg/rust/bootstrap.sh +++ b/barretenberg/rust/bootstrap.sh @@ -11,7 +11,7 @@ hash=$(hash_str $(cache_content_hash .rebuild_patterns)) # generated client never depends on hand-maintained copies of them. function generate { local root=$(git rev-parse --show-toplevel) - (cd barretenberg-rs && node --experimental-strip-types --experimental-transform-types --no-warnings \ + (cd barretenberg-rs && node --experimental-strip-types --no-warnings \ "$root/ipc-codegen/src/generate.ts" \ --schema "$root/barretenberg/cpp/src/barretenberg/bbapi/bb_schema.json" \ --lang rust \ diff --git a/barretenberg/ts/bb.js/scripts/generate.sh b/barretenberg/ts/bb.js/scripts/generate.sh index 5bb35ba4ca9..f9a0153c8ca 100755 --- a/barretenberg/ts/bb.js/scripts/generate.sh +++ b/barretenberg/ts/bb.js/scripts/generate.sh @@ -10,7 +10,7 @@ BBAPI="$ROOT/barretenberg/cpp/src/barretenberg/bbapi" # bb.js keeps its historical API surface (poseidon2Hash, Poseidon2Hash), so the # Bb service prefix is stripped from identifiers; wire tags keep it. -node --experimental-strip-types --experimental-transform-types --no-warnings \ +node --experimental-strip-types --no-warnings \ "$ROOT/ipc-codegen/src/generate.ts" \ --schema "$BBAPI/bb_schema.json" \ --lang ts \ diff --git a/barretenberg/ts/bb.js/src/bbapi/exception_handling.test.ts b/barretenberg/ts/bb.js/src/bbapi/exception_handling.test.ts index 3c90963fd11..e13674e1a89 100644 --- a/barretenberg/ts/bb.js/src/bbapi/exception_handling.test.ts +++ b/barretenberg/ts/bb.js/src/bbapi/exception_handling.test.ts @@ -23,9 +23,8 @@ describe('BBApi Exception Handling from bb.js', () => { g2Point: new Uint8Array(10), // Only 10 bytes (needs 128) - will cause exception }; - // In WASM builds, throw_or_abort calls abort directly which throws a generic Error - // In native builds with exceptions, our try-catch in bbapi converts it to ErrorResponse - // This test verifies that errors are catchable from bb.js (even if as generic Error in WASM) + // The wasm builds with exception handling, so bbapi's try-catch converts the C++ exception to an ErrorResponse, + // as it does natively. expect(() => { api.srsInitSrs(invalidCommand); }).toThrow(); @@ -49,4 +48,22 @@ describe('BBApi Exception Handling from bb.js', () => { expect((error as Error).message).toContain('invalid points_buf size'); } }); + + it('answers with an error response rather than aborting the module', async () => { + const logs: string[] = []; + const loggingBackend = await BarretenbergWasmSyncBackend.new(undefined, msg => logs.push(msg)); + try { + expect(() => + new SyncApi(loggingBackend).srsInitSrs({ + numPoints: 100, + pointsBuf: new Uint8Array(10), + g2Point: new Uint8Array(10), + }), + ).toThrow('invalid points_buf size'); + // The JS environment logs this when the module aborts rather than catching the exception itself. + expect(logs.filter(log => log.includes('aborted'))).toEqual([]); + } finally { + loggingBackend.destroy(); + } + }, 60000); }); diff --git a/bootstrap.sh b/bootstrap.sh index dde97c8dd0d..396d2ad9e2d 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -12,10 +12,10 @@ # Expected toolchain versions. export expected_min_clang_version=20.0.0 export expected_min_cmake_version=3.24 -export expected_min_node_version=24.12.0 +export expected_min_node_version=26.12.0 export expected_min_zig_version=0.15.1 export expected_abs_rust_version=1.89.0 -export expected_abs_wasi_version=27.0 +export expected_abs_wasi_version=34.0 export expected_abs_foundry_version=1.8.5 export expected_abs_yarn_version=4.13.0 @@ -66,8 +66,8 @@ function install_node { curl -s -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash . "$HOME/.nvm/nvm.sh" --no-use fi - nvm install --lts - nvm alias default lts/* + nvm install $expected_min_node_version + nvm alias default $expected_min_node_version } function install_node_utils { diff --git a/build-images/bootstrap.sh b/build-images/bootstrap.sh index 474aec6c76c..270480c9ac1 100755 --- a/build-images/bootstrap.sh +++ b/build-images/bootstrap.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash source $(git rev-parse --show-toplevel)/ci3/source_bootstrap -version="3.1" +version="3.2" arch=$(arch) branch=${BRANCH:-$(git rev-parse --abbrev-ref HEAD)} diff --git a/build-images/run.sh b/build-images/run.sh index 288937a7264..547623def41 100755 --- a/build-images/run.sh +++ b/build-images/run.sh @@ -41,5 +41,5 @@ else -vdevbox-var-lib-docker:/var/lib/docker \ -v$HOME/.ssh/id_rsa:/home/aztec-dev/.ssh/id_rsa:ro \ --privileged \ - aztecprotocol/devbox:3.1 + aztecprotocol/devbox:3.2 fi diff --git a/build-images/src/Dockerfile b/build-images/src/Dockerfile index 67dd8ced00c..cd6a6a5e3b2 100644 --- a/build-images/src/Dockerfile +++ b/build-images/src/Dockerfile @@ -61,9 +61,9 @@ RUN curl -L https://foundry.paradigm.xyz | bash \ # We use this image for test isolation. FROM base-build AS build -# APT repo for node (24.15.0) +# APT repo for node (26.12.0) RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg -ENV NODE_MAJOR=24 +ENV NODE_MAJOR=26 RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list RUN apt update && \ @@ -102,7 +102,7 @@ RUN apt update && \ pkg-config \ libssl-dev \ # Node - nodejs=24.15.0-1nodesource1 \ + nodejs=26.12.0-1nodesource1 \ # Python (clang bindings for wasm bindgen.) python3 \ python3-clang \ @@ -121,10 +121,10 @@ RUN wget https://apt.llvm.org/llvm.sh && \ # Install wasi-sdk. RUN arch=$(uname -m) && \ if [ "$arch" = "aarch64" ]; then arch="arm64"; fi && \ - wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-27/wasi-sdk-27.0-${arch}-linux.tar.gz && \ - tar xvf wasi-sdk-27.0-${arch}-linux.tar.gz && \ - mv wasi-sdk-27.0-${arch}-linux /opt/wasi-sdk && \ - rm wasi-sdk-27.0-${arch}-linux.tar.gz + wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-34/wasi-sdk-34.0-${arch}-linux.tar.gz && \ + tar xvf wasi-sdk-34.0-${arch}-linux.tar.gz && \ + mv wasi-sdk-34.0-${arch}-linux /opt/wasi-sdk && \ + rm wasi-sdk-34.0-${arch}-linux.tar.gz # Install foundry. COPY --from=foundry /opt/foundry /opt/foundry @@ -154,9 +154,9 @@ RUN curl -fsSL https://releases.hashicorp.com/terraform/1.7.5/terraform_1.7.5_li && chmod +x /usr/local/bin/terraform \ && rm terraform.zip -# Install wasmtime. -RUN curl -fsSL https://github.com/bytecodealliance/wasmtime/releases/download/v20.0.2/wasmtime-v20.0.2-$(uname -m)-linux.tar.xz | tar xJ \ - && mv wasmtime-v20.0.2-$(uname -m)-linux/wasmtime /usr/local/bin \ +# Install wasmtime. 46 is the last release with wasi-threads (-Sthreads), which the threaded wasm tests use. +RUN curl -fsSL https://github.com/bytecodealliance/wasmtime/releases/download/v46.0.3/wasmtime-v46.0.3-$(uname -m)-linux.tar.xz | tar xJ \ + && mv wasmtime-v46.0.3-$(uname -m)-linux/wasmtime /usr/local/bin \ && rm -rf wasmtime* # Install zig. @@ -171,7 +171,7 @@ RUN curl -sL https://github.com/mikefarah/yq/releases/download/v4.42.1/yq_linux_ -o /usr/local/bin/yq && chmod +x /usr/local/bin/yq # Install playwright for browser testing. Ensure accessible for other users. -RUN npx -y playwright@1.49 install --with-deps && mv /root/.cache/ms-playwright /opt/ms-playwright +RUN npx -y playwright@1.63.0 install --with-deps && mv /root/.cache/ms-playwright /opt/ms-playwright ENV PLAYWRIGHT_BROWSERS_PATH=/opt/ms-playwright @@ -214,7 +214,7 @@ RUN apt update && \ zsh \ inotify-tools \ # Annoyingly unminimize upgrades nodejs. - nodejs=24.15.0-1nodesource1 \ + nodejs=26.12.0-1nodesource1 \ # smt_verification dependencies python3-venv \ python3-pip \ diff --git a/ci3/aws/ami_id_amd64 b/ci3/aws/ami_id_amd64 index 43b3d727378..df270515a2a 100644 --- a/ci3/aws/ami_id_amd64 +++ b/ci3/aws/ami_id_amd64 @@ -1 +1 @@ -ami-0b92d1f5e1e85dd99 +ami-005af01ba84151744 diff --git a/ci3/aws/ami_id_arm64 b/ci3/aws/ami_id_arm64 index a34ef19e926..218856fd58c 100644 --- a/ci3/aws/ami_id_arm64 +++ b/ci3/aws/ami_id_arm64 @@ -1 +1 @@ -ami-0bd6dbacd3fb445bc +ami-0a6b922f8414b98e8 diff --git a/ci3/aws/ami_update.sh b/ci3/aws/ami_update.sh index 1ff6434e33f..aed2a0555a9 100755 --- a/ci3/aws/ami_update.sh +++ b/ci3/aws/ami_update.sh @@ -54,8 +54,8 @@ ssh $ssh_args -F build_instance_ssh_config ubuntu@$ip 'export CRS_FORMAT=uncompr # Pull devbox onto host, and build into docker-in-docker volume. ssh $ssh_args -F build_instance_ssh_config ubuntu@$ip " - docker run --privileged --rm -v bootstrap_ci_local_docker:/var/lib/docker aztecprotocol/devbox:3.1 bash -c \" - docker pull aztecprotocol/build:3.1 + docker run --privileged --rm -v bootstrap_ci_local_docker:/var/lib/docker aztecprotocol/devbox:3.2 bash -c \" + docker pull aztecprotocol/build:3.2 \" " diff --git a/ci3/bootstrap_ec2 b/ci3/bootstrap_ec2 index 402a5847998..b7189462525 100755 --- a/ci3/bootstrap_ec2 +++ b/ci3/bootstrap_ec2 @@ -401,7 +401,7 @@ start_build() { --pids-limit=65536 \ --shm-size=2g \ --ulimit nofile=1048576:1048576 \ - aztecprotocol/devbox:3.1 bash -c $(printf '%q' "$container_script") + aztecprotocol/devbox:3.2 bash -c $(printf '%q' "$container_script") } # If stdout is a tty, run in foreground, otherwise run in background and handle spot termination notices. diff --git a/ci3/docker_isolate b/ci3/docker_isolate index 210937e0d9a..bbf0880b161 100755 --- a/ci3/docker_isolate +++ b/ci3/docker_isolate @@ -79,7 +79,7 @@ cid=$(docker run -d \ -e TEST_TIMING_FILE \ -e RUN_ID \ "${arg_env_vars[@]}" \ - aztecprotocol/build:3.1 \ + aztecprotocol/build:3.2 \ /bin/bash -c "$cmd") set +x # At this point we know it's started, and can handle SIGTERM to kill the container. diff --git a/ci3/tests/signal_test b/ci3/tests/signal_test index e76d9735091..c4421de6536 100755 --- a/ci3/tests/signal_test +++ b/ci3/tests/signal_test @@ -73,8 +73,8 @@ if ! docker info &>/dev/null; then exit 0 fi -if ! docker image inspect aztecprotocol/build:3.1 &>/dev/null; then - echo "SKIP: aztecprotocol/build:3.1 image not available" +if ! docker image inspect aztecprotocol/build:3.2 &>/dev/null; then + echo "SKIP: aztecprotocol/build:3.2 image not available" exit 0 fi diff --git a/labs-patches/0020-fix-foundation-bump-supertest-to-7.1-for-Node-26.patch b/labs-patches/0020-fix-foundation-bump-supertest-to-7.1-for-Node-26.patch new file mode 100644 index 00000000000..ca375487035 --- /dev/null +++ b/labs-patches/0020-fix-foundation-bump-supertest-to-7.1-for-Node-26.patch @@ -0,0 +1,64 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Charlie <5764343+charlielye@users.noreply.github.com> +Date: Wed, 21 Oct 2026 14:39:41 +0000 +Subject: [PATCH] fix(foundation): bump supertest to 7.1 for Node 26 + +On Node 26, supertest 6 resets the second of two concurrent requests +(read ECONNRESET), which fails the manual batching tests in +safe_json_rpc_client.test.ts. supertest 7.1.0 and later handle it, on +Node 24 as well. + +Co-Authored-By: Claude Opus 5.5 +Claude-Session: https://claude.ai/code/session_01G5s7nEWrYapDK2CWpEzcAf + +diff --git a/yarn-project/foundation/package.json b/yarn-project/foundation/package.json +index 50886664b3e554d48e9366bbf3ab3ea5a083feb1..50592fca7349e33aeea590b3eb8eec281a56a5ab 100644 +--- a/yarn-project/foundation/package.json ++++ b/yarn-project/foundation/package.json +@@ -196,7 +196,7 @@ + "globals": "^16.1.0", + "jest": "^30.0.0", + "prettier": "^3.5.3", +- "supertest": "^6.3.3", ++ "supertest": "^7.1.0", + "ts-node": "^10.9.1", + "typescript": "^5.3.3", + "typescript-eslint": "^8.32.1", +diff --git a/yarn-project/yarn.lock b/yarn-project/yarn.lock +index f3b1bd1dadbb21a3f7bb0349aebae010ea434490..177ceaa85180e6b5c889b71aaffa2c8da60e095c 100644 +GIT binary patch +delta 1066 +zcmZ`&O=z4&7-n~~`)xa|`PprPY1(c#MQSwbH~%x6LsRh3L+Pb$ih`l@TUN8X$tLYd +z3D`q&Ht4G$sCbhqUi3pO)}seO5wRB!p4y8xh$j(>lY@9sW?pz_-sgE?o_XH)UdKP* +z#-D!wXzztD(BAInbMSbjG2!{PjRWu|y-qVmJi2{STlYhlfg +zdbh%J?q<)E<-vNtyGlA~!Q&6>^RvtA{{td0@n(4rzOGi947L_Szqhp& +zM)1pK^>{I?*Up@rIw%ic>4nA3-i?9Tx;YB)-6rb5R|~aTardd(^W6&V$l~|wwJU!V +zUtY~Fm*A7D+2jOkcMrE(x58+%Hym_Z6y85I)`b3*Y`m26leO71?f(+4-EFo16}S!c +zmFyJ!*vyW>xA*Etx0zr(2p6bV)`sY*_exUlydW4;LA;?hDw8v(7!h7Z#+f5j*^pyK +zwB#`-fm?5#)FgWAi49EC=w0NDk(gj!8^VP3%BAZhx73mg7t-O|A%Jgwq5t%G3 +zgJVHP;*7S0N<}ay$>`3Jm@DQ@lp0HlIj1JiL$JYVVGNf#O-B#-+-=l~^;{X5v + +delta 890 +zcmY*XJ&2t}6y?2__g?Z%bocG9KLLqrEV6FGWB%vfHDWA86k{;KkjgN3el!+YqD!LH +zLQ*_!Y*a2*TBH%T2uSz}Z7j4?#Ky)#yHu`VFV2dM#hKv_Gxwf3=lptGeRfOT{ppX9 +zpBtWC7@WPmy1!W6AM~sH!?&L3d3p5n(~EoOMh%Dhd*{Z>-|*4VXoc^8Je>8DZZbR0 +zr*95d_=_De<142p6P}-(%-C?Z*5BHgJigU`MU&_M;_uH-AK?c-?`FJyX}UDjbAIl^ +zkz@SQrRfH5elQWdc(`4-2I9$Ga0+CR)~o7W@ikD8)@g89i%Levh#_i}NvCK`l``dI +zjIyp&YismCl#tNGs#9Bni6v-XY^!Vt$$N##Vl}NKi)d^?3rYt^fo$sd&YflEr#2OUhIupw&d0JYq04Cz2o)G)j($ti)(iP*q{Jyt;qr +zsm0FTwBc~Wk$z{d`||xYn5(%yvDK}w-zaatb9MXL);jRF?~T`Z8^xGkaiSZ-f5I<< +z*c<7&;=i}V3BC+sllk@L>kog9ru@c-;(=XbvXns==@i9^DuwJpnYK$0I!fx +Date: Wed, 21 Oct 2026 16:00:31 +0000 +Subject: [PATCH] chore: bump playwright to 1.63.0 + +Chromium 131, which playwright 1.49 ships, cannot compile wasm that uses +standard (exnref) exception handling, and fails with "invalid value type +'exn', enable with --experimental-wasm-exnref". aztec-packages is moving +bb's wasm to exnref and its CI image to playwright 1.63.0 browsers +(Chromium 153), which compile it. The 1.49 pins also point at browsers +that image no longer installs. + +Co-Authored-By: Claude Opus 5.5 +Claude-Session: https://claude.ai/code/session_01G5s7nEWrYapDK2CWpEzcAf + +diff --git a/playground/package.json b/playground/package.json +index 89a087c4c452e6888ba56b296cf616fa3a5c43f8..e79dd5c7b7798aed133e49cc19f160f79d13bb28 100644 +--- a/playground/package.json ++++ b/playground/package.json +@@ -42,7 +42,7 @@ + }, + "devDependencies": { + "@eslint/js": "^9.18.0", +- "@playwright/test": "1.49.0", ++ "@playwright/test": "1.63.0", + "@types/buffer-json": "^2", + "@types/node": "^22.15.17", + "@types/react": "^19.0.6", +diff --git a/playground/yarn.lock b/playground/yarn.lock +index 0a10b9416320c9fb18459be426293fb76dacb461..c51f597bafa7436e802e3e66b676c9c86eb3f15c 100644 +GIT binary patch +delta 580 +zcmYL`y^2&p5QVun(uEy_0b$KF98jvey1TjrLEk_hz@V$EJCXJ81vXfW4K8?NgBc7A +zMhu4C6&8#)F%S$EVIIK9NF)2A?uMtJs=jm1yI;HKKX=!Mvp(R*SF`P#E(|a3&6^rN +zz(oK4B?ZUQehBVnWj*>Tc(yqx>dwOE^Y?DQ+vv7?|LwxT_-NJ7$0sNK)!FU*>}9$C^!ff>bLX##c!1LnNyUNX +zoNQqvQve!CjLN|R#$ug>0-{0+Y6;1y7H|<`MaL2`H7ik2f{VeU0;6xxRE5EqYAl$f +zDG6)a7mAY%nS9|i-u&7v#@|Q%&XxaQ|B}DpzIK`Y&UkdvPbFOzpr&d=Ns*;k%A6zx +z@}${Sf>NtX-UJlK)!~#I8ww;PicKzBw38(@Y@@UV%&`{GW(6Cr&8*o50%u*40M!_) +XT)6dOgk3=a9v<9UY|cORXQzJvSDdx5 + +delta 854 +zcmaKq&x_VK5XQ+@#A>V5`h#sReccKz3NMpnl1cW~zd$^CGnph?Y +zFy1)7>-S6hFpgnyX~$@^R)1Li=KJNPksjmp=r4Px7uWYoRX_TZT9|IE?~(KL{<@u* +z5TQ6zE4o~Q&CY>tni3HcHEnW=7K?GzO2TYHKyd6!)GcBTma%aztyzX#Lu8Xut;rT` +z9r;YAa!e#w-cxGQBhgh2vpieZ-{@+O5u7*M(jGTFekCC#C-@j8Iuj3sbl|k2-Y_aV$B5P*ri}n222>W)){Qpjl8KTcr-DWOdJtCM9?96 +a*{hM4K-|DJXkw1GUw$J@KmK*Nv+)l^athx7 + +diff --git a/yarn-project/ivc-integration/package.json b/yarn-project/ivc-integration/package.json +index 130368d205d08892c3d972048079033caa3c0205..4b18bfe7627adf823ba430aac35ab5b7955d0d89 100644 +--- a/yarn-project/ivc-integration/package.json ++++ b/yarn-project/ivc-integration/package.json +@@ -68,7 +68,7 @@ + "@aztec-labs/stdlib": "workspace:^", + "change-case": "^5.4.4", + "pako": "^2.1.0", +- "playwright": "1.49.0", ++ "playwright": "1.63.0", + "puppeteer": "^24.22.3", + "tslib": "^2.4.0" + }, +@@ -80,7 +80,7 @@ + "@aztec-labs/simulator": "workspace:^", + "@aztec-labs/world-state": "workspace:^", + "@jest/globals": "^30.0.0", +- "@playwright/test": "1.49.0", ++ "@playwright/test": "1.63.0", + "@types/jest": "^30.0.0", + "@types/node": "^22.15.17", + "@types/pako": "^2.0.3", +diff --git a/yarn-project/kv-store/package.json b/yarn-project/kv-store/package.json +index b8ca0acb9e49a42205ae228c6dc196d527c3a8dd..edb24ec9b82acde79500c313ccdf3abcb42e766d 100644 +--- a/yarn-project/kv-store/package.json ++++ b/yarn-project/kv-store/package.json +@@ -54,7 +54,7 @@ + "@vitest/browser-playwright": "^4.0.0", + "buffer": "^6.0.3", + "jest": "^30.0.0", +- "playwright": "1.49.0", ++ "playwright": "1.63.0", + "ts-node": "^10.9.1", + "typescript": "^5.3.3", + "util": "^0.12.5", +diff --git a/yarn-project/yarn.lock b/yarn-project/yarn.lock +index 177ceaa85180e6b5c889b71aaffa2c8da60e095c..a9e0b59e45c81700379bd5ac3872f83472fea3ee 100644 +GIT binary patch +delta 693 +zcmaKpy=zoa5XIT7c`y46N{j{+10h%$SZ40W+_?e8%EHEkfNi*+U||djc9Mk@+gZ59 +zD$DRx$tVxfP42wKE+OYlY;8!ZkDcg|eS%dcSdjWFMASo28{k +z>A}Oh_qSG;uutv&&F=a3%vyJ$Q|jB*#rFDIcYgY}w;j$j{T;89CiI*U6|-j`;VlOp +zvNhT$$ckMu$$F)A_6D^`kiCV-31t=#WRNbAL(Ni>){>M^8qH5e{CMH5ffRbeY8%1ft-wX?f#RgtL>m_n)Yqo)c=e9y>90IV$-xg +zs-~V@-rBymTKJtX{lh5*HbDqxE}RIYW2?0f!hsc8Ar(9>TZuVoX@&L{l?+Kr=~*Tv +z97PVOZ2)j8izuY(bWjOJz+xnlQGir2YHZ(q>8%Vmdri^l@n&!K +GG5-Q`dCQjo + +delta 898 +zcmZ9KyK5Cu5XQN=kIh{ra*e1_BlsXiB6{8r(9*`ngouS8V7e5DOz%+{Q*D +zo>bOv#5VxtQmyZgWK0y{L%c% +zsc+lMi(aRC{d{$%LFVg^YhOCU;LSIO%kQ&|eJfX76n>*>bH`SUbkK1*<@?ot@=gaw4Jy9;sHg_*)XO+_-Dqtd-1T2DJLCGAX +zHyXV1pfrS_vPB(p4l1w^lkhRKAh|O}c*(PKmRXS^OWbI5DP=D$^U>QJcobkzfs-;S +zCPUy-37f1*NtC&B%_IF|b4^l<)FyQX$L6XJ+uGu&JSxhWrS73}I#j*VU+V5E`!95- +zmQB>rpf+AeE0i*bjstqlI9QWqW=i`&V~HrEMvh7O8AVz@@ +zgyA%$$ysZoQ$WWO1e3Mp +zPh1Bdk|r2jS#D@V3=}1H8H`dEC`qaE>Tzef9BDxSv#(pWbvCFSEDzfC +zRmrIvN50uaEJKb`zRo9!l$1xI;#C(#@Wl#n{AVVNN&IcD$cEM_9Ov=fL +zBsDS@gOrkao+C;Gl@f9;j10~&P1(#2(aK>p6hk+7