Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bb.js): (breaking change) bundles bb.js properly so that it works in the browser and in node #1855

Merged
merged 48 commits into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
dcca716
Revert "feat: Modify bb.js to be compatible with next.js (https://git…
charlielye Aug 25, 2023
e7d3696
The work. I accidently did it on barretenberg repo originally 🤦
charlielye Aug 25, 2023
fcef7c1
Simplify bb.js api (remove sync api). Avoids double embedding the wasms.
charlielye Aug 26, 2023
13417bf
Move bin-tests to be part of acir_tests just as another flow.
charlielye Aug 26, 2023
ecf872e
Refactor common code out of barretenberg_wasm.
charlielye Aug 26, 2023
7b77197
Headless chrome runner.
charlielye Aug 26, 2023
50d97c9
Vite example, to be sure. Playwright to test all 3 browsers.
charlielye Aug 28, 2023
2cbe241
Env var to pick browser.
charlielye Aug 31, 2023
fae7bf4
Merge remote-tracking branch 'origin/master' into cl/bb_bundling
charlielye Aug 31, 2023
9d1a993
Let's try just testing bb.js tests at same time as build for simplici…
charlielye Aug 31, 2023
0708c48
Address some review comments.
charlielye Aug 31, 2023
29bd585
Fix a single threaded serialization issue. Improve the test stuff.
charlielye Sep 1, 2023
0ce9de6
Merge remote-tracking branch 'origin/master' into cl/bb_bundling
charlielye Sep 2, 2023
89332ac
Merge remote-tracking branch 'origin/master' into cl/bb_bundling
charlielye Sep 2, 2023
9183444
Build
charlielye Sep 2, 2023
e65b1d8
Mac/Linux base64 can be unified.
charlielye Sep 4, 2023
0830183
Merge remote-tracking branch 'origin/master' into cl/bb_bundling
charlielye Sep 4, 2023
e6db480
Fix
charlielye Sep 4, 2023
7e36672
Run bb.js on spot as cci seems slow. Fix bunch of failing scripts due…
charlielye Sep 4, 2023
13ab8bb
Poke to try and rebuild bb.js
charlielye Sep 4, 2023
1356525
Fix
charlielye Sep 4, 2023
08c3b3a
Fix
charlielye Sep 4, 2023
bfa4e35
[TEST] ci test
ludamad Sep 4, 2023
7fa9fcd
Revert acir test
ludamad Sep 4, 2023
6373c88
Revert acir test
ludamad Sep 4, 2023
f3815dc
Revert acir test
ludamad Sep 4, 2023
f76ce97
Revert acir test
ludamad Sep 4, 2023
e99e01c
Revert acir test
ludamad Sep 4, 2023
563070e
Revert acir test
ludamad Sep 4, 2023
d804fcd
Revert acir test
ludamad Sep 4, 2023
a7e598d
Revert acir test
ludamad Sep 4, 2023
5e51762
Revert acir test
ludamad Sep 4, 2023
f08b783
Revert acir test
ludamad Sep 4, 2023
606d4a8
Revert
ludamad Sep 4, 2023
8102619
Revert
ludamad Sep 4, 2023
688441c
See if git in end-to-end
ludamad Sep 4, 2023
6331ae9
Merge remote-tracking branch 'origin/ludamad-patch-1' into cl/bb_bund…
charlielye Sep 4, 2023
b1d8ac3
Attempt to poke build.
charlielye Sep 4, 2023
17357db
Remove noop in build.
charlielye Sep 4, 2023
ab1f303
Remove framework examples.
charlielye Sep 4, 2023
e81290f
Merge remote-tracking branch 'origin/master' into cl/bb_bundling
charlielye Sep 4, 2023
fa6ede3
Merge remote-tracking branch 'origin/master' into cl/bb_bundling
charlielye Sep 4, 2023
21ede5e
Run double_verify_proof!
charlielye Sep 4, 2023
e0f1f45
Back to master.
charlielye Sep 4, 2023
835e7d7
Don't know st webkit only fails in cci :(
charlielye Sep 4, 2023
d0c6e2f
Add 1_mul to webapp for manual testing.
charlielye Sep 4, 2023
8495e04
Revert "Remove noop in build."
charlielye Sep 4, 2023
abf257c
Merge remote-tracking branch 'origin/master' into cl/bb_bundling
charlielye Sep 4, 2023
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
24 changes: 19 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,17 @@ jobs:
name: "Test"
command: ./scripts/ci/store_test_benchmark_logs $AZTEC_GITHUB_TOKEN

barretenberg-acir-tests-bb:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Build and test"
command: cond_spot_run_build barretenberg-acir-tests-bb 32

bb-js:
machine:
image: ubuntu-2004:202010-01
Expand All @@ -248,7 +259,7 @@ jobs:
- *checkout
- *setup_env
- run:
name: "Build"
name: "Build and test"
command: build bb.js

bb-js-tests:
Expand All @@ -259,10 +270,10 @@ jobs:
- *checkout
- *setup_env
- run:
name: "Test"
name: "Build and test"
command: cond_spot_run_tests bb.js

barretenberg-acir-tests:
bb-js-acir-tests:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
Expand All @@ -271,7 +282,7 @@ jobs:
- *setup_env
- run:
name: "Build and test"
command: cond_spot_run_build barretenberg-acir-tests 32
command: cond_spot_run_build barretenberg-acir-tests-bb.js 32

circuits-wasm-linux-clang:
docker:
Expand Down Expand Up @@ -1279,9 +1290,12 @@ workflows:
requires:
- bb-js
<<: *defaults
- barretenberg-acir-tests:
- barretenberg-acir-tests-bb:
requires:
- barretenberg-x86_64-linux-clang-assert
<<: *defaults
- bb-js-acir-tests:
requires:
- bb-js
<<: *defaults
- circuits-wasm-linux-clang: *defaults
Expand Down
10 changes: 6 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@
"**/.yarn": true,
"**/.yalc": true,
"**/node_modules": true,
"**/.pnp.*": true
"**/.pnp.*": true,
"circuits/cpp/barretenberg/**": true,
"**/msgpack-c/**": true
},
"[terraform]": {
"editor.defaultFormatter": "hashicorp.terraform"
Expand All @@ -128,8 +130,8 @@
// C++/Circuits settings
///////////////////////////////////////
"[cpp]": {
"editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd",
"editor.formatOnSave": true,
"editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd",
"editor.formatOnSave": true
},
//
// Clangd. Note that this setting may be overridden by user settings
Expand Down Expand Up @@ -164,7 +166,7 @@
// which ensures SRS can be read
"testMate.cpp.test.workingDirectory": "${workspaceFolder}/circuits/cpp/build",
// Filter all binaries that are not tests
"testMate.cpp.test.executables": "${workspaceFolder}/circuits/cpp/build/bin/*{test,Test,TEST}*",
"testMate.cpp.test.executables": "${workspaceFolder}/circuits/cpp/build/bin/*{test,Test,TEST}*"
// End C++/Circuits settings
///////////////////////////////////////
}
1 change: 1 addition & 0 deletions barretenberg
18 changes: 11 additions & 7 deletions bootstrap_docker.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/bash
# This script builds the projects listed in build_mainifest.sh, terminating when it reaches TARGET_PROJECT.
# This script builds the projects listed in build_mainifest.sh, terminating when it reaches PROJECT_NAME.
# If run from within a project, it will build only that project, unless env var ONLY_TARGET=false.
#
# Usage:
# boostrap_docker.sh [PROJECT_NAME]
#
# To build everything in build_manifest.sh:
# bootstrap_docker.sh
#
Expand All @@ -18,24 +21,25 @@

set -e

TARGET_PROJECT=$1
PROJECT_NAME=$1
COMMIT_HASH=$(git rev-parse HEAD)
ONLY_TARGET=${ONLY_TARGET:-}

# If we're calling this script from within a project directory, that's the target project.
if [ -z "$TARGET_PROJECT" ]; then
if [ -z "$PROJECT_NAME" ]; then
PATH_PREFIX=$(git rev-parse --show-prefix)
if [ -n "$PATH_PREFIX" ]; then
# We are in a project folder.
ONLY_TARGET=${ONLY_TARGET:-true}
TARGET_PROJECT=$(basename $PATH_PREFIX)
PROJECT_NAME=$(basename $PATH_PREFIX)
cd $(git rev-parse --show-cdup)
fi
fi

source ./build-system/scripts/setup_env $COMMIT_HASH '' mainframe_$USER
build_local $TARGET_PROJECT $ONLY_TARGET
source ./build-system/scripts/setup_env $COMMIT_HASH '' mainframe_$USER
build_local $PROJECT_NAME $ONLY_TARGET

if [ -z "$TARGET_PROJECT" ]; then
if [ -z "$PROJECT_NAME" ]; then
echo
echo "Success! You could now run e.g.:"
echo " docker run -ti --rm aztecprotocol/end-to-end:latest e2e_private_token_contract.test"
Expand Down
13 changes: 11 additions & 2 deletions build-system/scripts/build_local
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
set -eu

TARGET_PROJECT=$1
ONLY_TARGET=$2
ONLY_TARGET=${2:-}

if [ -n "${NO_CACHE:-}" ]; then
ADDITIONAL_ARGS=--no-cache
fi

ROOT=$(git rev-parse --show-toplevel)
source $ROOT/build_manifest.sh
Expand All @@ -20,6 +24,7 @@ for E in ${PROJECTS[@]}; do
WORKING_DIR=${ARR[1]}
DOCKERFILE=${ARR[2]}
REPO=${ARR[3]:-$PROJECT_DIR_NAME}
LAUNCH=${ARR[4]:-}

if [ "$ONLY_TARGET" == "true" -a ! "$PROJECT_DIR_NAME" = "$TARGET_PROJECT" ]; then
continue
Expand All @@ -44,9 +49,13 @@ for E in ${PROJECTS[@]}; do
echo "*** Building $PROJECT_DIR_NAME:$DOCKERFILE -> $REPO ***"
echo

time docker build --build-arg ARG_COMMIT_HASH=$COMMIT_HASH -f $DOCKERFILE -t $ECR_DEPLOY_URL/$REPO:latest .
time docker build ${ADDITIONAL_ARGS:-} --build-arg ARG_COMMIT_HASH=$COMMIT_HASH -f $DOCKERFILE -t $ECR_DEPLOY_URL/$REPO:latest .
docker tag $ECR_DEPLOY_URL/$REPO:latest aztecprotocol/$REPO:latest

if [ -n "$LAUNCH" ]; then
docker run -ti --rm aztecprotocol/$REPO:latest
fi

if [ "$PROJECT_DIR_NAME" = "$TARGET_PROJECT" ]; then
break
fi
Expand Down
3 changes: 2 additions & 1 deletion build-system/scripts/setup_env
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ JOB_NAME=$3
GIT_REPOSITORY_URL=${4:-}
BRANCH=${5:-}

BASH_ENV=${BASH_ENV:-}
BUILD_SYSTEM_PATH=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
PROJECT=$(cat PROJECT)
VERSION=$(cat VERSION)
Expand Down Expand Up @@ -95,7 +96,7 @@ source $BASH_ENV
if [ -n "$COMMIT_HASH" ]; then
# Install and ensure correct permissions on build instance key.
mkdir -p ~/.ssh
echo $BUILD_INSTANCE_KEY | base64 -d > ~/.ssh/build_instance_key
echo ${BUILD_INSTANCE_KEY:-} | base64 -d > ~/.ssh/build_instance_key
chmod 600 ~/.ssh/build_instance_key
fi

Expand Down
Loading