Skip to content

[SC test]: Implement the SC test of the Dripper contract + Upgrade the aztec-nargo version to the v1.0.0-beta.11 + [SC test]: Modify the syntax / imported modules because of change the aztec package version from the v1.2.1 to v2.0.3 #6

[SC test]: Implement the SC test of the Dripper contract + Upgrade the aztec-nargo version to the v1.0.0-beta.11 + [SC test]: Modify the syntax / imported modules because of change the aztec package version from the v1.2.1 to v2.0.3

[SC test]: Implement the SC test of the Dripper contract + Upgrade the aztec-nargo version to the v1.0.0-beta.11 + [SC test]: Modify the syntax / imported modules because of change the aztec package version from the v1.2.1 to v2.0.3 #6

name: Aztec Benchmark Diff
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
env:
BENCH_DIR: ./benchmarks
jobs:
benchmark:
strategy:
matrix:
os: [ubuntu-latest-m]
threads: [12]
runs-on:
labels: ${{ matrix.os }}
timeout-minutes: 30
steps:
# ──────────────────────────────────────────────────────────────
# 0️⃣ SHARED TOOLING – Buildx + Aztec CLI skeleton
# ──────────────────────────────────────────────────────────────
- name: Checkout repo (full history)
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Docker Buildx (Aztec sandbox needs BuildKit)
uses: docker/setup-buildx-action@v2
- name: Install Aztec CLI
run: |
curl -s https://install.aztec.network > tmp.sh
bash tmp.sh <<< yes "yes"
- name: Update path
run: echo "/home/runner/.aztec/bin" >> $GITHUB_PATH
# ──────────────────────────────────────────────────────────────
# 1️⃣ BENCHMARK BASE COMMIT
# ──────────────────────────────────────────────────────────────
- name: Checkout BASE branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.sha }}
- uses: actions/setup-node@v4
with:
node-version: "22.17.0"
- name: Detect Aztec version (BASE)
id: basever
run: |
VER=$(node -p "require('./package.json').config.aztecVersion")
echo "ver=$VER" >> "$GITHUB_OUTPUT"
echo "Base Aztec version is $VER"
- name: Switch CLI to BASE version
run: |
VERSION=${{ steps.basever.outputs.ver }} aztec-up
- name: Start sandbox (BASE, background)
run: aztec start --sandbox &
- name: Start PXE node (BASE, background)
run: |
VERSION=${{ steps.basever.outputs.ver }} aztec \
start --port 8081 --pxe --pxe.nodeUrl=http://localhost:8080/ \
--pxe.proverEnabled false &
- name: Install deps (BASE)
run: yarn --frozen-lockfile
- name: Compile contracts (BASE)
run: yarn compile
- name: Codegen wrappers (BASE)
run: yarn codegen
- name: Benchmark (BASE)
run: |
npx aztec-benchmark --suffix _base --output-dir ${{ env.BENCH_DIR }}
# This is required to avoid the benchmark results being removed by the Checkout PR step
- name: Store base benchmark results
run: |
mkdir -p ../benchmarks_base && mv ${{ env.BENCH_DIR }}/*.json ../benchmarks_base/
# ──────────────────────────────────────────────────────────────
# 2️⃣ BENCHMARK PR HEAD (github.event.pull_request.head.sha)
# ──────────────────────────────────────────────────────────────
# clean does not work correctly and is removing the benchmark results anyways
# https://github.com/actions/checkout/issues/1201
- name: Checkout PR branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
clean: false
# Restore the base benchmark results to avoid the benchmark results being removed by the Checkout PR step
- name: Restore base benchmark results
run: mv ../benchmarks_base/* ${{ env.BENCH_DIR }}/
- name: Detect Aztec version (PR)
id: prver
run: |
VER=$(node -p "require('./package.json').config.aztecVersion")
echo "PR Aztec version is $VER"
if [ "${{ steps.basever.outputs.ver }}" != "$VER" ]; then
echo "ver_diff=true" >> "$GITHUB_OUTPUT"
else
echo "ver_diff=false" >> "$GITHUB_OUTPUT"
fi
echo "ver=$VER" >> "$GITHUB_OUTPUT"
- name: Kill BASE services
if: steps.prver.outputs.ver_diff == 'true'
run: |
pkill -f "aztec.*--sandbox" || true
pkill -f "aztec.*--pxe.*8081" || true
sleep 5
- name: Switch CLI to PR version
if: steps.prver.outputs.ver_diff == 'true'
run: |
VERSION=${{ steps.prver.outputs.ver }} aztec-up
- name: Start sandbox (PR, background)
if: steps.prver.outputs.ver_diff == 'true'
run: aztec start --sandbox &
- name: Start PXE node (PR, background)
if: steps.prver.outputs.ver_diff == 'true'
run: |
VERSION=${{ steps.prver.outputs.ver }} aztec \
start --port 8081 --pxe --pxe.nodeUrl=http://localhost:8080/ \
--pxe.proverEnabled false &
- name: Install deps (PR)
run: yarn --frozen-lockfile
- name: Compile contracts (PR)
run: yarn compile
- name: Codegen wrappers (PR)
run: yarn codegen
# ──────────────────────────────────────────────────────────────
# 3️⃣ DIFF & COMMENT
# ──────────────────────────────────────────────────────────────
- name: Generate Markdown diff
uses: defi-wonderland/aztec-benchmark/action@main
with:
base_suffix: '_base'
current_suffix: '_pr'
- name: Comment diff
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body-file: benchmark-comparison.md