Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
a44904b
initial alignment with devbox
charlielye Apr 15, 2024
56c4bfb
explicit version on format
charlielye Apr 15, 2024
5980561
build images.
charlielye Apr 15, 2024
9bfef99
Merge remote-tracking branch 'origin/master' into cl/devbox
charlielye Apr 15, 2024
ac92ea7
wip
charlielye Apr 16, 2024
e3c5455
wip
charlielye Apr 16, 2024
6dd375e
echo fix
charlielye Apr 16, 2024
ff94eb4
mac doesn't need manual id alignment
charlielye Apr 16, 2024
bed15f7
Merge remote-tracking branch 'origin/master' into cl/devbox
charlielye Apr 16, 2024
e5f8c5f
wip
charlielye Apr 16, 2024
cb69da0
wip
charlielye Apr 16, 2024
3160bb0
buildable from repo
charlielye Apr 16, 2024
607873b
comments
charlielye Apr 17, 2024
b2d54b5
wip
charlielye Apr 17, 2024
ca65661
Merge branch 'cl/devbox' of https://github.com/AztecProtocol/aztec-pa…
charlielye Apr 17, 2024
d0f95d4
wip
charlielye Apr 17, 2024
70ef43b
Merge branch 'cl/devbox' of github.com:aztecprotocol/aztec3-packages …
charlielye Apr 17, 2024
361f1c4
wip
charlielye Apr 17, 2024
0e943ad
wip
charlielye Apr 17, 2024
749a5ba
wip
charlielye Apr 17, 2024
6c34375
wip
charlielye Apr 17, 2024
24ce04d
wip
charlielye Apr 18, 2024
f416548
Merge remote-tracking branch 'origin/master' into cl/devbox
charlielye Apr 18, 2024
965dd85
Merge remote-tracking branch 'origin/master' into cl/devbox
charlielye Apr 18, 2024
fe183b2
try
charlielye Apr 18, 2024
2b44ade
try
charlielye Apr 18, 2024
fd188b0
try
charlielye Apr 18, 2024
d73464f
try
charlielye Apr 18, 2024
9068758
try
charlielye Apr 18, 2024
376f19e
try
charlielye Apr 18, 2024
7455dfd
try
charlielye Apr 18, 2024
195fdda
try
charlielye Apr 18, 2024
6279204
fix
charlielye Apr 18, 2024
883eb11
wip
charlielye Apr 19, 2024
9b9b510
Merge remote-tracking branch 'origin/master' into cl/devbox
charlielye Apr 20, 2024
2015191
format
charlielye Apr 20, 2024
35314e4
wip
charlielye Apr 22, 2024
accb462
Merge remote-tracking branch 'origin/master' into cl/devbox
charlielye Apr 22, 2024
2ce6d30
fix
charlielye Apr 24, 2024
5e7e6d4
Merge remote-tracking branch 'origin/master' into cl/devbox
charlielye Apr 24, 2024
a3b51bd
fix
charlielye Apr 24, 2024
5ae343c
fix
charlielye Apr 24, 2024
908859d
fix
charlielye Apr 24, 2024
68614a2
fix
charlielye Apr 24, 2024
2abafa4
fix
charlielye Apr 25, 2024
a5640b7
Merge remote-tracking branch 'origin/master' into cl/devbox
charlielye Apr 25, 2024
dd887f1
wip
charlielye Apr 25, 2024
46bb244
wip
charlielye Apr 25, 2024
38672ef
wip
charlielye Apr 26, 2024
cc8dd26
wip
charlielye Apr 26, 2024
28b077c
fix
charlielye Apr 26, 2024
04be927
fix
charlielye Apr 26, 2024
2187744
wip
charlielye Apr 26, 2024
dc07685
Merge branch 'cl/devbox' of github.com:aztecprotocol/aztec-packages i…
charlielye Apr 26, 2024
0901c1c
Merge remote-tracking branch 'origin/master' into cl/devbox
charlielye Apr 26, 2024
5b50188
Merge branch 'master' into cl/devbox
charlielye Apr 27, 2024
d3ab715
wip
charlielye Apr 27, 2024
c4edd70
Merge branch 'cl/devbox' of github.com:aztecprotocol/aztec-packages i…
charlielye Apr 27, 2024
bf36aef
wip
charlielye Apr 27, 2024
a45bf04
remove all custom timeouts. assume the global cli of 120s to be suffi…
charlielye Apr 27, 2024
1e1641a
wip
charlielye Apr 28, 2024
c4c1ddd
wip
charlielye Apr 28, 2024
83d76e9
wip
charlielye Apr 28, 2024
c3cbf34
wip
charlielye Apr 28, 2024
86aed70
ssh tweak
charlielye Apr 28, 2024
1934f8a
Disable some troublesome systemd services.
charlielye Apr 29, 2024
b57e042
Merge remote-tracking branch 'origin/master' into cl/devbox
charlielye Apr 29, 2024
373f027
Merge remote-tracking branch 'origin/master' into cl/devbox
charlielye May 1, 2024
ffa73e0
Merge remote-tracking branch 'origin/master' into cl/devbox
charlielye May 1, 2024
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
33 changes: 19 additions & 14 deletions .devcontainer/dev/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
{
"image": "node:lts-bookworm-slim",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
"name": "Development",
"build": {
"dockerfile": "../../build-images/Dockerfile",
"context": "../../build-images",
"target": "devbox"
},
"postCreateCommand": "curl -s install.aztec.network | VERSION=master NON_INTERACTIVE=1 BIN_PATH=/usr/local/bin bash -s",
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"noir-lang.vscode-noir"
]
}
},
"workspaceMount": "source=${localWorkspaceFolder},target=/root/workspace,type=bind",
"workspaceFolder": "/root/workspace"
"containerUser": "aztec-dev",
// ubuntu:noble is currently not supported.
// Can possibly workaround cherry-picking from here:
// https://github.com/devcontainers/features/blob/main/src/docker-in-docker/install.sh
//
// "image": "aztecprotocol/codespace",
// "features": {
// "docker-in-docker": {
// "version": "latest",
// "moby": true,
// "dockerDashComposeVersion": "v1"
// }
// },
"mounts": ["source=devbox-home,target=/home/aztec-dev,type=volume"]
}
12 changes: 9 additions & 3 deletions .github/workflows/ci-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ jobs:
needs: setup
runs-on: master-arm
steps:
- {uses: actions/checkout@v4, with: { ref: "${{ github.event.pull_request.head.sha }}"}}
- {
uses: actions/checkout@v4,
with: { ref: "${{ github.event.pull_request.head.sha }}" },
}
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
Expand All @@ -48,15 +51,18 @@ jobs:
needs: build
runs-on: master-arm
steps:
- {uses: actions/checkout@v4, with: { ref: "${{ github.event.pull_request.head.sha }}"}}
- {
uses: actions/checkout@v4,
with: { ref: "${{ github.event.pull_request.head.sha }}" },
}
- uses: ./.github/ci-setup-action
with:
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
concurrency_key: e2e-master-arm-e2e-tests
- name: Test
working-directory: ./yarn-project/end-to-end/
timeout-minutes: 15
run: earthly -P --no-output +uniswap-trade-on-l1-from-l2 --e2e_mode=cache
run: earthly -P --no-output +uniswap-trade-on-l1-from-l2

notify:
needs: [e2e]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
- name: Test
working-directory: ./yarn-project/end-to-end/
timeout-minutes: 25
run: earthly-ci -P --secret AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} --secret AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} --no-output +${{ matrix.test }} --e2e_mode=cache
run: earthly-ci -P --secret AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} --secret AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} --no-output +${{ matrix.test }}

bench-summary:
needs: e2e
Expand Down
4 changes: 2 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
// Displays code coverage report information within vscode
"ryanluker.vscode-coverage-gutters",
// Spell checking
"streetsidesoftware.code-spell-checker",
"streetsidesoftware.code-spell-checker"
// End C++/Circuits extensions
///////////////////////////////////////
],
Expand All @@ -58,7 +58,7 @@
// Most features are disabled in `settings.json`
// which confict with `clangd`
// Since we ignore GDB, we no longer need this extension
"ms-vscode.cpptools",
"ms-vscode.cpptools"
// End C++/Circuits unwanted extensions
///////////////////////////////////////
]
Expand Down
5 changes: 2 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
// Clangd. Note that this setting may be overridden by user settings
// to the default value "clangd".
//
"clangd.path": "clangd-15",
"clangd.path": "clangd-16",
//
// C/C++ (should be disabled)
//
Expand Down Expand Up @@ -165,6 +165,5 @@
"**/target/**": true,
"**/l1-contracts/lib/**": true,
"**/barretenberg/cpp/build*/**": true
},
"cmake.sourceDirectory": "/mnt/user-data/adam/aztec-packages/barretenberg/cpp"
}
}
7 changes: 2 additions & 5 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION 0.8
FROM ubuntu:lunar
FROM ubuntu:noble

build-ci:
BUILD ./avm-transpiler/+build
Expand All @@ -16,15 +16,12 @@ build-ci:
BUILD ./yarn-project/+end-to-end
BUILD ./yarn-project/+aztec

build-ci-small:
BUILD ./yarn-project/end-to-end/+e2e-escrow-contract

build:
# yarn-project has the entry point to Aztec
BUILD ./yarn-project/+build

test-end-to-end:
BUILD ./yarn-project/end-to-end/+test-all
BUILD ./yarn-project/end-to-end+e2e-tests

bench:
RUN echo hi
Expand Down
19 changes: 9 additions & 10 deletions avm-transpiler/Earthfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
VERSION 0.8
IMPORT ../noir AS noir
# we rely on noir source, which this image has
FROM noir+nargo

# move noir contents to /usr/src/noir
RUN mv /usr/src /noir && mkdir /usr/src && mv /noir /usr/src
# work in avm-transpiler
WORKDIR /usr/src/avm-transpiler
source:
# we rely on noir source, which this image has
FROM noir+nargo

RUN apt-get update && apt-get install -y git
# move noir contents to /usr/src/noir
RUN mv /usr/src /noir && mkdir /usr/src && mv /noir /usr/src
# work in avm-transpiler
WORKDIR /usr/src/avm-transpiler

COPY --dir scripts src Cargo.lock Cargo.toml rust-toolchain.toml .
COPY --dir scripts src Cargo.lock Cargo.toml rust-toolchain.toml .

source:
# for debugging rebuilds
RUN echo CONTENT HASH $(find . -type f -exec sha256sum {} ';' | sort | sha256sum | awk '{print $1}') | tee .content-hash

Expand All @@ -21,7 +20,7 @@ build:
RUN ./scripts/bootstrap_native.sh
SAVE ARTIFACT target/release/avm-transpiler avm-transpiler

run:
run:
#TODO needed?
FROM ubuntu:focal
COPY +build/avm-transpiler /usr/src/avm-transpiler
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
"generator": "Ninja",
"toolchainFile": "cmake/toolchains/wasm32-wasi.cmake",
"environment": {
"WASI_SDK_PREFIX": "${sourceDir}/src/wasi-sdk",
"WASI_SDK_PREFIX": "/opt/wasi-sdk",
"CC": "$env{WASI_SDK_PREFIX}/bin/clang",
"CXX": "$env{WASI_SDK_PREFIX}/bin/clang++",
"AR": "$env{WASI_SDK_PREFIX}/bin/llvm-ar",
Expand Down
83 changes: 7 additions & 76 deletions barretenberg/cpp/Earthfile
Original file line number Diff line number Diff line change
@@ -1,80 +1,13 @@
VERSION 0.8

build-base:
ARG TARGETARCH
FROM --platform=linux/$TARGETARCH ubuntu:lunar
RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
cmake \
lsb-release \
wget \
software-properties-common \
gnupg \
ninja-build \
npm \
libssl-dev \
jq \
bash \
libstdc++6 \
clang-format \
clang-16

IF [ $TARGETARCH = arm64 ]
# publish arm after, assumes x86 already exists, becomes multiplatform image
SAVE IMAGE --push aztecprotocol/bb-ubuntu-lunar
FROM --platform=linux/amd64 aztecprotocol/bb-ubuntu-lunar:x86-latest
SAVE IMAGE --push aztecprotocol/bb-ubuntu-lunar
ELSE
SAVE IMAGE --push aztecprotocol/bb-ubuntu-lunar:x86-latest
END

build-wasi-sdk-image:
WORKDIR /
RUN git clone --recursive https://github.com/WebAssembly/wasi-sdk.git
WORKDIR /wasi-sdk
RUN git checkout 9389ea5eeec98afc61039683ae92c6147fee9c54
ENV NINJA_FLAGS=-v
ENV MAKEFLAGS="-j$(nproc)"
RUN make build/llvm.BUILT
RUN make build/wasi-libc.BUILT
RUN make build/compiler-rt.BUILT
RUN make build/libcxx.BUILT
RUN make build/config.BUILT
SAVE ARTIFACT build/install/opt/wasi-sdk

build-wasi-sdk:
ARG TARGETARCH
# Wrapper just exists share files.
FROM scratch
WORKDIR /usr/src
COPY +get-wasi-sdk-image/wasi-sdk wasi-sdk
SAVE ARTIFACT wasi-sdk
SAVE IMAGE --push aztecprotocol/cache:wasi-sdk-threads-v21.0-$TARGETARCH

get-wasi-sdk-threads:
ARG TARGETARCH
# If this is failing, we need to run earthly --push +build-wasi-sdk
FROM aztecprotocol/cache:wasi-sdk-threads-v21.0-$TARGETARCH
SAVE ARTIFACT wasi-sdk

get-wasi-sdk:
# NOTE: currently only works with x86
# TODO Align with above
FROM +source
COPY ./scripts/install-wasi-sdk.sh ./scripts/
RUN ./scripts/install-wasi-sdk.sh
# TODO better output name to mirror wasi-sdk
SAVE ARTIFACT src/wasi-sdk-20.0 wasi-sdk

wasmtime:
FROM aztecprotocol/bb-ubuntu-lunar
FROM ubuntu:noble
RUN apt update && apt install -y curl xz-utils
RUN curl https://wasmtime.dev/install.sh -sSf | bash
SAVE ARTIFACT /root/.wasmtime/bin/wasmtime

source:
FROM aztecprotocol/bb-ubuntu-lunar
FROM ../../build-images+build
WORKDIR /usr/src/barretenberg
# cpp source
COPY --dir src/barretenberg src/CMakeLists.txt src
Expand Down Expand Up @@ -106,19 +39,17 @@ preset-wasm:
FROM +preset-wasm-threads
SAVE ARTIFACT build/bin
ELSE
COPY +get-wasi-sdk/wasi-sdk src/wasi-sdk
RUN cmake --preset wasm -Bbuild && cmake --build build --target barretenberg.wasm
RUN src/wasi-sdk/bin/llvm-strip ./build/bin/barretenberg.wasm
RUN /opt/wasi-sdk/bin/llvm-strip ./build/bin/barretenberg.wasm
SAVE ARTIFACT build/bin
SAVE IMAGE --cache-hint
END

preset-wasm-threads:
FROM +source
COPY +get-wasi-sdk-threads/wasi-sdk src/wasi-sdk
RUN cmake --preset wasm-threads -Bbuild && cmake --build build --target barretenberg.wasm
# TODO(https://github.com/AztecProtocol/barretenberg/issues/941) We currently do not strip barretenberg threaded wasm, for stack traces.
# RUN src/wasi-sdk/bin/llvm-strip ./build/bin/barretenberg.wasm
# RUN /opt/wasi-sdk/bin/llvm-strip ./build/bin/barretenberg.wasm
SAVE ARTIFACT build/bin

preset-gcc:
Expand Down Expand Up @@ -189,7 +120,7 @@ bench-binaries:
# Runs on the bench image, sent from the builder runner
bench-ultra-honk:
BUILD +wasmtime # prefetch
FROM +source
FROM ubuntu:noble
COPY --dir +bench-binaries/* .
# install SRS needed for proving
COPY --dir ./srs_db/+build/. srs_db
Expand All @@ -201,7 +132,7 @@ bench-ultra-honk:

bench-client-ivc:
BUILD +wasmtime # prefetch
FROM +source
FROM ubuntu:noble
COPY --dir +bench-binaries/* .
# install SRS needed for proving
COPY --dir ./srs_db/+build/. srs_db
Expand Down
9 changes: 3 additions & 6 deletions barretenberg/cpp/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ fi
# Download ignition transcripts.
(cd ./srs_db && ./download_ignition.sh 0)

# Install wasi-sdk.
./scripts/install-wasi-sdk.sh

# Attempt to just pull artefacts from CI and exit on success.
[ -n "${USE_CACHE:-}" ] && ./bootstrap_cache.sh && exit

Expand Down Expand Up @@ -82,19 +79,19 @@ AVAILABLE_MEMORY=0
case "$(uname)" in
Linux*)
# Check available memory on Linux
AVAILABLE_MEMORY=$(awk '/MemFree/ { printf $2 }' /proc/meminfo)
AVAILABLE_MEMORY=$(awk '/MemTotal/ { printf $2 }' /proc/meminfo)
;;
*)
echo "Parallel builds not supported on this operating system"
;;
esac
# This value may be too low.
# If builds fail with an amount of free memory greater than this value then it should be increased.
MIN_PARALLEL_BUILD_MEMORY=32000000
MIN_PARALLEL_BUILD_MEMORY=32854492

if [[ AVAILABLE_MEMORY -lt MIN_PARALLEL_BUILD_MEMORY ]]; then
echo "System does not have enough memory for parallel builds, falling back to sequential"
build_native
build_native
build_wasm
build_wasm_threads
else
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/cmake/threading.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if(MULTITHREADING)
add_link_options(-pthread)
if(WASM)
add_compile_options(--target=wasm32-wasi-threads)
add_link_options(--target=wasm32-wasi-threads)
add_link_options(--target=wasm32-wasi-threads -Wl,--shared-memory)
endif()
#add_compile_options(-fsanitize=thread)
#add_link_options(-fsanitize=thread)
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16

WORKDIR /usr/src/barretenberg/cpp
COPY . .
# Build bb binary and targets needed for benchmarking.
# Build bb binary and targets needed for benchmarking.
# Everything else is built as part linux-clang-assert.
# Benchmark targets want to run without asserts, so get built alongside bb.
RUN cmake --preset clang16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ RUN apt update && apt install -y \
libssl-dev \
jq \
bash \
libstdc++6 \
clang-format
libstdc++6

RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16
RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16 && apt install -y clang-format-16

WORKDIR /usr/src/barretenberg/cpp
COPY . .
Expand Down
8 changes: 4 additions & 4 deletions barretenberg/cpp/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ set -e
if [ "$1" == "staged" ]; then
echo Formatting barretenberg staged files...
for FILE in $(git diff-index --diff-filter=d --relative --cached --name-only HEAD | grep -e '\.\(cpp\|hpp\|tcc\)$'); do
clang-format -i $FILE
clang-format-16 -i $FILE
sed -i.bak 's/\r$//' $FILE && rm ${FILE}.bak
git add $FILE
done
elif [ "$1" == "check" ]; then
for FILE in $(find ./src -iname *.hpp -o -iname *.cpp -o -iname *.tcc | grep -v src/msgpack-c); do
clang-format --dry-run --Werror $FILE
clang-format-16 --dry-run --Werror $FILE
done
elif [ -n "$1" ]; then
for FILE in $(git diff-index --relative --name-only $1 | grep -e '\.\(cpp\|hpp\|tcc\)$'); do
clang-format -i $FILE
clang-format-16 -i $FILE
sed -i.bak 's/\r$//' $FILE && rm ${FILE}.bak
done
else
for FILE in $(find ./src -iname *.hpp -o -iname *.cpp -o -iname *.tcc | grep -v src/msgpack-c); do
clang-format -i $FILE
clang-format-16 -i $FILE
sed -i.bak 's/\r$//' $FILE && rm ${FILE}.bak
done
fi
Loading