Skip to content

Commit

Permalink
Merge branch 'master' into zw/barrett-reduction
Browse files Browse the repository at this point in the history
  • Loading branch information
codygunton authored Jul 12, 2024
2 parents 5131af8 + 9bcbb6c commit 2f7e8ac
Show file tree
Hide file tree
Showing 2,639 changed files with 100,904 additions and 52,401 deletions.
60 changes: 45 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ jobs:
command: cond_spot_run_build noir-packages 32
aztec_manifest_key: noir-packages

avm-transpiler:
avm-transpiler-x86_64:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
Expand All @@ -243,7 +243,7 @@ jobs:
command: cond_spot_run_build avm-transpiler 32
aztec_manifest_key: avm-transpiler

aztec-nargo:
avm-transpiler-arm64:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
Expand All @@ -252,7 +252,31 @@ jobs:
- *setup_env
- run:
name: "Build"
command: cond_spot_run_build aztec-nargo 32
command: cond_spot_run_build avm-transpiler 32 arm64
aztec_manifest_key: avm-transpiler

avm-transpiler-ecr-manifest:
machine:
image: default
resource_class: medium
steps:
- *checkout
- *setup_env
- run:
name: "Create ECR manifest"
command: create_ecr_manifest avm-transpiler x86_64,arm64
aztec_manifest_key: avm-transpiler

aztec-nargo:
machine:
image: default
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Build image"
command: build aztec-nargo
aztec_manifest_key: aztec-nargo

l1-contracts:
Expand Down Expand Up @@ -417,15 +441,11 @@ jobs:
should_release || exit 0
yarn-project/deploy_npm.sh latest
- run:
name: "Release canary to NPM: l1-contracts"
name: "Update aztec-up"
command: |
should_release || exit 0
deploy_npm l1-contracts canary
- run:
name: "Release latest to NPM: l1-contracts"
command: |
should_release || exit 0
deploy_npm l1-contracts latest
if [ -n "$COMMIT_TAG" ]; then
deploy_terraform "" aztec-up/terraform
fi
# Repeatable config for defining the workflow below.
defaults: &defaults
Expand Down Expand Up @@ -505,15 +525,24 @@ workflows:
<<: *defaults

# Transpiler
- avm-transpiler:
- avm-transpiler-x86_64:
requires:
- noir-ecr-manifest
- noir-x86_64
<<: *defaults
- avm-transpiler-arm64:
requires:
- noir-arm64
<<: *defaults
- avm-transpiler-ecr-manifest:
requires:
- avm-transpiler-x86_64
- avm-transpiler-arm64
<<: *defaults

# aztec-nargo (nargo & transpiler)
- aztec-nargo:
requires:
- avm-transpiler
- avm-transpiler-ecr-manifest
<<: *defaults

# Barretenberg
Expand All @@ -531,8 +560,9 @@ workflows:

- noir-projects:
requires:
- avm-transpiler
- avm-transpiler-ecr-manifest
- noir-ecr-manifest
- barretenberg-x86_64-linux-clang
<<: *defaults

# Yarn Project
Expand Down
18 changes: 18 additions & 0 deletions .devcontainer/sandbox_only/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "Sandbox Only",
"image": "node:lts-bookworm",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"onCreateCommand": "cp -R /root/workspace /root/scripts && rm -rf /root/workspace/* && sh /root/scripts/onCreateCommand.sh sandbox_only",
"postAttachCommand": "sh /root/scripts/postAttachCommand.sh",
"customizations": {
"vscode": {
"settings": {},
"extensions": ["noir-lang.vscode-noir"]
}
},
"workspaceMount": "source=${localWorkspaceFolder}/.devcontainer/scripts,target=/root/workspace,type=bind",
"workspaceFolder": "/root/workspace",
"forwardPorts": [8080]
}
23 changes: 13 additions & 10 deletions .devcontainer/scripts/onCreateCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@ if ! grep -q "PXE_URL" ~/.bashrc; then
fi

if ! grep -q "alias sandbox" ~/.bashrc; then
echo "alias sandbox=\"npx create-aztec-app sandbox\"" >> ~/.bashrc
echo "alias sandbox=\"npx aztec-app sandbox\"" >> ~/.bashrc
fi
corepack enable

source ~/.bashrc
yes | npx create-aztec-app -t $TYPE -n $NAME -s
mv $NAME/* $NAME/.* .
rm -rf $NAME
if [ "$TYPE" != "sandbox_only" ]; then
source ~/.bashrc
yes | npx create-aztec-app -t $TYPE -n $NAME -s
mv $NAME/* $NAME/.* .
rm -rf $NAME

yarn

yarn

npx -y playwright install --with-deps
yarn add @aztec/builder
yarn prep
npx -y playwright install --with-deps
yarn add @aztec/builder
yarn prep
fi
5 changes: 2 additions & 3 deletions .devcontainer/scripts/postAttachCommand.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/usr/bin/env bash
TYPE=$1
NAME=$2

apt update
apt install gh
gh codespace ports visibility 8080:public -c $CODESPACE_NAME

npx create-aztec-app sandbox start
npx aztec-app sandbox start

r=$(tput sgr0) # Reset color
bold=$(tput bold) # Bold text
Expand Down
2 changes: 1 addition & 1 deletion .github/earthly-ci-config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
global:
cache_size_pct: 50
buildkit_max_parallelism: 5
buildkit_max_parallelism: 10
container_frontend: docker-shell
buildkit_additional_args: ["-e", "BUILDKIT_STEP_LOG_MAX_SIZE=-1"]
47 changes: 47 additions & 0 deletions .github/scripts/extract_l1_addresses.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env bash

FILE_PATH=$1

# Read the file line by line
while IFS= read -r line; do
# Extract the hexadecimal address using awk
address=$(echo "$line" | awk '{print $NF}')

# Assign the address to the respective variable based on the line content
if [[ $line == *"Rollup Address"* ]]; then
export TF_VAR_ROLLUP_CONTRACT_ADDRESS=$address
echo "TF_VAR_ROLLUP_CONTRACT_ADDRESS=$TF_VAR_ROLLUP_CONTRACT_ADDRESS"
elif [[ $line == *"Registry Address"* ]]; then
export TF_VAR_REGISTRY_CONTRACT_ADDRESS=$address
echo "TF_VAR_REGISTRY_CONTRACT_ADDRESS=$TF_VAR_REGISTRY_CONTRACT_ADDRESS"
elif [[ $line == *"Inbox Address"* ]]; then
export TF_VAR_INBOX_CONTRACT_ADDRESS=$address
echo "TF_VAR_INBOX_CONTRACT_ADDRESS=$TF_VAR_INBOX_CONTRACT_ADDRESS"
elif [[ $line == *"Outbox Address"* ]]; then
export TF_VAR_OUTBOX_CONTRACT_ADDRESS=$address
echo "TF_VAR_OUTBOX_CONTRACT_ADDRESS=$TF_VAR_OUTBOX_CONTRACT_ADDRESS"
elif [[ $line == *"Oracle Address"* ]]; then
export TF_VAR_AVAILABILITY_ORACLE_CONTRACT_ADDRESS=$address
echo "TF_VAR_AVAILABILITY_ORACLE_CONTRACT_ADDRESS=$TF_VAR_AVAILABILITY_ORACLE_CONTRACT_ADDRESS"
elif [[ $line == *"Gas Token Address"* ]]; then
export TF_VAR_GAS_TOKEN_CONTRACT_ADDRESS=$address
echo "TF_VAR_GAS_TOKEN_CONTRACT_ADDRESS=$TF_VAR_GAS_TOKEN_CONTRACT_ADDRESS"
elif [[ $line == *"Gas Portal Address"* ]]; then
export TF_VAR_GAS_PORTAL_CONTRACT_ADDRESS=$address
echo "TF_VAR_GAS_PORTAL_CONTRACT_ADDRESS=$TF_VAR_GAS_PORTAL_CONTRACT_ADDRESS"
else
echo "Unknown contract address: $line"
fi
done <"$FILE_PATH"

# echo all addresses into github env
echo "TF_VAR_ROLLUP_CONTRACT_ADDRESS=$TF_VAR_ROLLUP_CONTRACT_ADDRESS" >>$GITHUB_ENV
echo "TF_VAR_REGISTRY_CONTRACT_ADDRESS=$TF_VAR_REGISTRY_CONTRACT_ADDRESS" >>$GITHUB_ENV
echo "TF_VAR_INBOX_CONTRACT_ADDRESS=$TF_VAR_INBOX_CONTRACT_ADDRESS" >>$GITHUB_ENV
echo "TF_VAR_OUTBOX_CONTRACT_ADDRESS=$TF_VAR_OUTBOX_CONTRACT_ADDRESS" >>$GITHUB_ENV
echo "TF_VAR_AVAILABILITY_ORACLE_CONTRACT_ADDRESS=$TF_VAR_AVAILABILITY_ORACLE_CONTRACT_ADDRESS" >>$GITHUB_ENV
echo "TF_VAR_GAS_TOKEN_CONTRACT_ADDRESS=$TF_VAR_GAS_TOKEN_CONTRACT_ADDRESS" >>$GITHUB_ENV
echo "TF_VAR_GAS_PORTAL_CONTRACT_ADDRESS=$TF_VAR_GAS_PORTAL_CONTRACT_ADDRESS" >>$GITHUB_ENV

# Set global variable for redeployment of contracts
echo "CONTRACTS_DEPLOYED=1" >>$GITHUB_ENV
10 changes: 8 additions & 2 deletions .github/workflows/ci-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ jobs:
set -eux
git submodule update --init --recursive --recommend-shallow
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin
scripts/earthly-ci ./yarn-project+export-e2e-test-images
scripts/earthly-ci \
--secret AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
--secret AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
./yarn-project+export-e2e-test-images
# all the end-to-end integration tests for aztec
e2e:
Expand All @@ -54,7 +57,10 @@ jobs:
sudo shutdown -P 25 # hack until core part of the scripts
set -eux
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin
scripts/earthly-ci -P --no-output ./yarn-project/end-to-end/+uniswap-trade-on-l1-from-l2
scripts/earthly-ci \
--secret AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
--secret AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
--no-output ./yarn-project/end-to-end/+uniswap-trade-on-l1-from-l2
# not notifying failures right now
# notify:
Expand Down
47 changes: 34 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: CI
on:
push:
branches: [master]
pull_request: {}
pull_request:
branches-ignore: [devnet]
workflow_dispatch:
inputs: {}

Expand Down Expand Up @@ -35,7 +36,7 @@ jobs:

changes:
runs-on: ubuntu-20.04
# Required permissions
# Required permissions.
permissions:
pull-requests: read
# Set job outputs to values from filter step
Expand Down Expand Up @@ -97,7 +98,11 @@ jobs:
# prepare images locally, tagged by commit hash
- name: "Build E2E Image"
timeout-minutes: 40
run: earthly-ci ./yarn-project+export-e2e-test-images
run: |
earthly-ci \
--secret AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
--secret AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
./yarn-project+export-e2e-test-images
# We base our e2e list used in e2e-x86 off the targets in ./yarn-project/end-to-end
# (Note ARM uses just 2 tests as a smoketest)
- name: Create list of non-bench end-to-end jobs
Expand Down Expand Up @@ -152,7 +157,7 @@ jobs:
- uses: ./.github/ci-setup-action
- name: Setup and Test
uses: ./.github/ensure-tester-with-images
timeout-minutes: 40
timeout-minutes: 45
with:
runner_type: ${{ contains(matrix.test, 'prover') && '64core-tester-x86' || '16core-tester-x86' }}
builder_type: builder-x86
Expand All @@ -161,6 +166,7 @@ jobs:
builder_images_to_copy: aztecprotocol/aztec:${{ env.GIT_COMMIT }} aztecprotocol/end-to-end:${{ env.GIT_COMMIT }}
# command to produce the images in case they don't exist
builder_command: cd yarn-project/end-to-end/ && ../../scripts/earthly-ci +${{ matrix.test }}
tester_ttl: 40
run: |
set -eux
cd ./yarn-project/end-to-end/
Expand Down Expand Up @@ -362,7 +368,7 @@ jobs:
noir-format:
needs: [setup, changes]
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
if: ${{ needs.changes.outputs.noir == 'true' }}
if: ${{ needs.changes.outputs.noir == 'true' || needs.changes.outputs.noir-projects == 'true' }}
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
Expand All @@ -376,7 +382,11 @@ jobs:
- name: "Format noir-projects"
working-directory: ./noir-projects/
timeout-minutes: 40
run: earthly-ci --no-output ./+format
run: |
earthly-ci --no-output \
--secret AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
--secret AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
./+format
noir-test:
needs: [setup, changes]
Expand Down Expand Up @@ -418,7 +428,7 @@ jobs:
run: earthly-ci --no-output ./noir+packages-test

noir-projects:
needs: [setup, changes]
needs: [setup, changes, build]
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
if: ${{ needs.changes.outputs.barretenberg == 'true' || needs.changes.outputs.noir == 'true' || needs.changes.outputs.noir-projects == 'true' }}
steps:
Expand All @@ -429,7 +439,11 @@ jobs:
concurrency_key: noir-projects-x86
- name: "Noir Projects"
timeout-minutes: 40
run: earthly-ci --no-output ./noir-projects/+test
run: |
earthly-ci --no-output \
--secret AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
--secret AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
./noir-projects/+test
avm-format:
needs: [setup, changes]
Expand All @@ -452,7 +466,6 @@ jobs:
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
# Only allow one memory-hunger prover test to use this runner
- uses: ./.github/ci-setup-action
with:
concurrency_key: yarn-project-formatting-x86
Expand All @@ -461,13 +474,11 @@ jobs:
run: earthly-ci --no-output ./yarn-project/+format-check

yarn-project-test:
# quiet machine
needs: build
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
# Only allow one memory-hunger prover test to use this runner
- uses: ./.github/ci-setup-action
with:
concurrency_key: yarn-project-test-x86
Expand Down Expand Up @@ -514,7 +525,14 @@ jobs:
- name: "Docs Preview"
if: github.event.number
timeout-minutes: 40
run: earthly-ci --no-output ./docs/+deploy-preview --ENV=staging --PR=${{ github.event.number }} --AZTEC_BOT_COMMENTER_GITHUB_TOKEN=${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} --NETLIFY_AUTH_TOKEN=${{ secrets.NETLIFY_AUTH_TOKEN }} --NETLIFY_SITE_ID=${{ secrets.NETLIFY_SITE_ID }}
run: |
earthly-ci --no-output \
--secret AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
--secret AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
./docs/+deploy-preview --ENV=staging --PR=${{ github.event.number }} \
--AZTEC_BOT_COMMENTER_GITHUB_TOKEN=${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} \
--NETLIFY_AUTH_TOKEN=${{ secrets.NETLIFY_AUTH_TOKEN }} \
--NETLIFY_SITE_ID=${{ secrets.NETLIFY_SITE_ID }}
bb-bench:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -616,7 +634,10 @@ jobs:
working-directory: ./noir-projects/
timeout-minutes: 40
run: |
earthly-ci --artifact +gates-report/gates_report.json
earthly-ci \
--secret AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
--secret AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
--artifact +gates-report/gates_report.json
mv gates_report.json ../protocol_circuits_report.json
- name: Compare gates reports
Expand Down
Loading

0 comments on commit 2f7e8ac

Please sign in to comment.