-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: CI to test aztec circuits with current commit of bberg (#418)
* More generators for aztec3. * update js vk (because we now use UP for merkle hashing) * Helpers for ECDSA in A3 (#364) * Add `stdlib_keccak` in cmake. Correct an assertion in `to_byte_array` in bigfield. * Add `random_element` to affine element. * negate y conditionally. * Change pedersen hash c_bind to use `pedersen_hash::lookup`. * c_binds and other ECDSA related fixes (#407) * Add v to stdlib ecdsa. * create an engine if its empty. * Add ecdsa c_bind. * print v as a uint32. * Add secp256k1 cbind. add c_bind.hpp Change hpp to h. remove hpp. * Add ecdsa in cmakelists. remove stdlib_ecdsa from build. * hack: (aztec3) introduce barretenberg crypto generator parameters hack (#408) * hack: introduce BARRETENBERG_CRYPTO_GENERATOR_PARAMETERS_HACK * doc: concise * chore: align BARRETENBERG_CRYPTO_GENERATOR_PARAMETERS_HACK usage * CI to test aztec circuits with current commit of bberg * build manifest * chore: align BARRETENBERG_CRYPTO_GENERATOR_PARAMETERS_HACK usage (#411) * try other branch of aztec packages * ci rename script * Update join_split test * bump aztec version and merge in aztec3-temporary fixes * aztec commit switched to branch * bump aztec commit and document * typo README.md * Update README.md --------- Co-authored-by: Suyash Bagad <[email protected]> Co-authored-by: Suyash Bagad <[email protected]> Co-authored-by: ludamad <[email protected]> Co-authored-by: ludamad <[email protected]>
- Loading branch information
1 parent
44d9cfd
commit 6263c69
Showing
9 changed files
with
178 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
set -e | ||
REPOSITORY=$1 | ||
SCRIPT_PATH=$2 | ||
shift | ||
shift | ||
|
||
cd $(query_manifest projectDir $REPOSITORY) | ||
|
||
mkdir -p /tmp/test-logs | ||
|
||
set -o pipefail | ||
cond_spot_run_script $REPOSITORY $JOB_NAME 32 $SCRIPT_PATH $@ | tee "/tmp/test-logs/$JOB_NAME.log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
master |
8 changes: 8 additions & 0 deletions
8
cpp/dockerfiles/Dockerfile.circuits-wasm-linux-clang-builder-runner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM ubuntu:kinetic | ||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y bash build-essential git libssl-dev cmake ninja-build curl binaryen xz-utils curl | ||
|
||
RUN curl https://wasmtime.dev/install.sh -sSf | bash /dev/stdin --version v3.0.1 | ||
WORKDIR /usr/src/barretenberg/cpp/src | ||
RUN curl -s -L https://github.com/CraneStation/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz | tar zxfv - | ||
WORKDIR /usr/src/barretenberg/cpp | ||
COPY . . |
18 changes: 18 additions & 0 deletions
18
cpp/dockerfiles/Dockerfile.circuits-x86_64-linux-clang-builder-runner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM alpine:3.17 | ||
RUN apk update \ | ||
&& apk upgrade \ | ||
&& apk add --no-cache \ | ||
bash \ | ||
build-base \ | ||
clang15 \ | ||
openmp \ | ||
openmp-dev \ | ||
cmake \ | ||
ninja \ | ||
git \ | ||
curl \ | ||
perl | ||
|
||
WORKDIR /usr/src/barretenberg/cpp | ||
|
||
COPY . . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# To be called from CI for testing with docker and AWS. | ||
# Can't be called locally unless AWS credentials are set up. | ||
# | ||
# Call from config.yml | ||
# Example: | ||
# command: cond_spot_run_script circuits-wasm-linux-clang-assert 1 wasm scripts/a3-tests -*.skip*:*.circuit* | ||
|
||
AZTEC_COMMIT=$1 # Aztec commit/branch to checkout (MANDATORY) | ||
NUM_TRANSCRIPTS=$2 # integer (MANDATORY) | ||
ARCH=$3 # x86_64 or wasm (MUST BE LOWERCASE) (MANDATORY) used in aztec's circuits `run_tests_local` | ||
# TESTS=$4 (MANDATORY) used in aztec's circuits `run_tests_local` (test files rel to circuits/cpp) | ||
# GTEST_FILTER=$5 (optional) used in aztec's circuits `run_tests_local` | ||
# *** See `run_tests_local` for the args forwarded to that script | ||
shift # arg1 (aztec commit) and arg2 (num transcripts) are not forwarded | ||
shift # to aztec's circuits `run_tests_local` | ||
|
||
$(aws ecr get-login --region us-east-2 --no-include-email) 2> /dev/null | ||
|
||
IMAGE_URI=278380418400.dkr.ecr.us-east-2.amazonaws.com/barretenberg-circuits-${ARCH}-linux-clang-builder-runner:cache-$COMMIT_HASH | ||
docker pull $IMAGE_URI | ||
|
||
if [ "$ARCH" != "wasm" ]; then | ||
# x86_64 / anything other than wasm | ||
PRESET=default | ||
CONFIGURE_OPTS="-DCMAKE_BUILD_TYPE=RelWithAssert -DCI=ON" | ||
BUILD_DIR=build | ||
else | ||
PRESET=wasm | ||
BUILD_DIR=build-wasm | ||
fi | ||
|
||
echo "*** Running Aztec circuits tests on commit: $AZTEC_COMMIT" | ||
# run tests in docker | ||
RUN_ARGS="$@" # helper var necessary for some reason to pass all args to docker run | ||
docker run --rm -t $IMAGE_URI /bin/sh -c "\ | ||
set -e; \ | ||
cd /usr/src/; \ | ||
git clone https://github.com/AztecProtocol/aztec3-packages.git; \ | ||
cd /usr/src/aztec3-packages/circuits/cpp; \ | ||
git checkout $AZTEC_COMMIT; \ | ||
rm -rf /usr/src/aztec3-packages/circuits/cpp/barretenberg; | ||
mv /usr/src/barretenberg .; \ | ||
cmake --preset $PRESET $CONFIGURE_OPTS; \ | ||
cmake --build --preset $PRESET; \ | ||
cd /usr/src/aztec3-packages/circuits/cpp/barretenberg/cpp/srs_db; \ | ||
./download_ignition.sh $NUM_TRANSCRIPTS; \ | ||
cd /usr/src/aztec3-packages/circuits/cpp; \ | ||
export PATH=\$PATH:~/.wasmtime/bin/; \ | ||
./scripts/run_tests_local $RUN_ARGS;" |