Skip to content
Merged
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
1 change: 0 additions & 1 deletion .circleci/build_local
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ PUSH_LABEL=$3

PROJECTS=(
cpp:barretenberg-cpp:./dockerfiles/Dockerfile.x86_64-linux-clang:barretenberg-x86_64-linux-clang
cpp:barretenberg-cpp:./dockerfiles/Dockerfile.x86_64-linux-clang-assert:barretenberg-x86_64-linux-clang-assert
cpp:barretenberg-cpp:./dockerfiles/Dockerfile.wasm-linux-clang:barretenberg-wasm-linux-clang
# js:barretenberg-js
)
Expand Down
12 changes: 0 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,6 @@ jobs:
name: "Build"
command: cond_spot_run_build barretenberg-x86_64-linux-clang-assert 64

solidity-verifier-tests:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Build and test"
command: build sol

barretenberg-tests:
docker:
- image: aztecprotocol/alpine-build-image
Expand Down Expand Up @@ -258,7 +247,6 @@ workflows:
- x86_64-linux-clang
- x86_64-linux-clang-assert
- wasm-linux-clang
- solidity-verifier-tests: *bb_test
- honk-tests: *bb_test
- barretenberg-tests: *bb_test
- stdlib-primitives-tests: *bb_test
Expand Down
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
sol/broadcast
sol/cache
sol/out
sol/Dockerfile
sol/lib
cpp/build
cpp/srs_db/ignition
.gitmodules
23 changes: 23 additions & 0 deletions .github/workflows/solidity_verifier_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: solidity-verifier-test

on:
- workflow_dispatch
- push

env:
FOUNDRY_PROFILE: ci

jobs:
check:
strategy:
fail-fast: true

name: Solidity Verifier Tests
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Build docker image
run: docker build . -f sol/Dockerfile
6 changes: 0 additions & 6 deletions build_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,5 @@
"dockerfile": "js/Dockerfile",
"rebuildPatterns": ["^js/"],
"dependencies": ["barretenberg-wasm-linux-clang"]
},
"sol": {
"buildDir": "sol",
"dockerfile": "Dockerfile",
"rebuildPatterns": ["^sol/"],
"dependencies": ["barretenberg-x86_64-linux-clang-assert"]
}
}
3 changes: 1 addition & 2 deletions cpp/dockerfiles/Dockerfile.x86_64-linux-clang-assert
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ RUN cmake --preset default -DCMAKE_BUILD_TYPE=RelWithAssert -DCI=ON && cmake --b
FROM alpine:3.17
RUN apk update && apk add curl openmp
COPY --from=builder /usr/src/barretenberg/cpp/srs_db /usr/src/barretenberg/cpp/srs_db
COPY --from=builder /usr/src/barretenberg/cpp/build/bin/*_tests /usr/src/barretenberg/cpp/build/bin/
COPY --from=builder /usr/src/barretenberg/cpp/build/bin/solidity* /usr/src/barretenberg/cpp/build/bin/
COPY --from=builder /usr/src/barretenberg/cpp/build/bin/*_tests /usr/src/barretenberg/cpp/build/bin/
5 changes: 0 additions & 5 deletions sol/.dockerignore

This file was deleted.

21 changes: 19 additions & 2 deletions sol/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
FROM 278380418400.dkr.ecr.us-east-2.amazonaws.com/barretenberg-x86_64-linux-clang-assert
FROM alpine:3.17
RUN apk update \
&& apk upgrade \
&& apk add --no-cache \
build-base \
clang15 \
openmp-dev \
cmake \
ninja \
git \
curl \
perl

WORKDIR /usr/src/barretenberg/cpp

COPY ./cpp .
# Build everything to ensure everything builds. All tests will be run from the result of this build.
RUN cmake --preset default && cmake --build --preset default --target solidity_key_gen solidity_proof_gen

FROM docker.io/frolvlad/alpine-glibc:alpine-3.16_glibc-2.34 as builder
RUN apk update && apk add git curl build-base openmp-dev bash
Expand All @@ -7,7 +24,7 @@ COPY --from=0 /usr/src/barretenberg/cpp/build/bin /usr/src/barretenberg/cpp/buil
COPY --from=0 /usr/src/barretenberg/cpp/srs_db /usr/src/barretenberg/cpp/srs_db
WORKDIR /usr/src/barretenberg/sol
RUN git init
COPY . .
COPY ./sol .

# Copy forge binary directly from foundry
COPY --from=ghcr.io/foundry-rs/foundry:latest /usr/local/bin/forge /usr/local/bin/forge
Expand Down
11 changes: 10 additions & 1 deletion sol/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Run `bootstrap.sh` to clone git submodules, download SRS and generate verificati

Test are performed with a `TestBase` harness, it provides helpers for reading files and printing proofs. The tests also require proofs and verification keys, those are build as part of the `bootstrap.sh`.

Note that foundry is set to just run 1 fuzz run, this is mainly to limit the duty for CI, and then it can be hammered more heavily when needed.

## How To Run the Tests?

To run all tests, run the following scripts at the root of the repo:
Expand Down Expand Up @@ -68,4 +70,11 @@ mstore(0x24, val_2) // add second value after first
mstore(0x44, val_3) // add third value after second
revert(0x00, 0x64) // revert with a message containing 0x64 bytes defined above
```
When running a test, you will then see the three values `val_1, val_2, val_3` in the console.
When running a test, you will then see the three values `val_1, val_2, val_3` in the console.

# Docker
To run the docker image, which will build keygen and proofgen and then run tests, run the following from root:
```bash
# From root
docker build . -f sol/Dockerfile
```
6 changes: 6 additions & 0 deletions sol/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ cd ../cpp/srs_db
cd ../../sol

echo "Building c++ binaries..."
cd ../cpp
cmake --preset clang15
cmake --build --preset clang15 --target solidity_key_gen solidity_proof_gen
cd ../sol

echo "Generating keys..."
./scripts/init.sh

echo "Formatting code..."
Expand Down
2 changes: 1 addition & 1 deletion sol/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ libs = ['lib']
ffi = true

[fuzz]
runs = 5
runs = 1

solc = "0.8.18"

Expand Down