Skip to content

chore(deps): bump @types/node from 22.5.1 to 24.10.0 #175

chore(deps): bump @types/node from 22.5.1 to 24.10.0

chore(deps): bump @types/node from 22.5.1 to 24.10.0 #175

Workflow file for this run

name: Aztec Benchmark
on:
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
issues: write
env:
BENCH_DIR: ./benchmarks
jobs:
check-changes:
name: Check for relevant changes
runs-on: ubuntu-latest
outputs:
should-benchmark: ${{ steps.changes.outputs.should-benchmark }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Check for relevant changes
id: changes
uses: actions/github-script@v8
with:
script: |
console.log('Checking for changes that would affect benchmarks...');
const { data: files } = await github.rest.pulls.listFiles({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
});
console.log('Changed files:');
files.forEach(file => console.log(`- ${file.filename}`));
// Check for Noir contracts, config, or benchmark changes
const relevantPatterns = /^(src\/nr\/|Nargo\.toml|benchmarks\/)/;
const hasRelevantChanges = files.some(file => relevantPatterns.test(file.filename));
// Check for AZTEC_VERSION change in package.json
const hasAztecVersionChange = files.some(file =>
file.filename === 'package.json' && file.patch?.includes('aztecVersion')
);
const shouldBenchmark = hasRelevantChanges || hasAztecVersionChange;
if (hasRelevantChanges) {
console.log('πŸ“ Noir contracts, config, or benchmark files changed');
} else if (hasAztecVersionChange) {
console.log('πŸ”„ AZTEC_VERSION changed in package.json');
} else {
console.log('⏭️ No benchmark-relevant changes detected, skipping benchmarks');
}
core.setOutput('should-benchmark', shouldBenchmark);
benchmark:
name: Run comparison
needs: check-changes
if: needs.check-changes.outputs.should-benchmark == 'true'
runs-on: ubuntu-latest
steps:
# ──────────────────────────────────────────────────────────────
# 0️⃣ SHARED TOOLING – Buildx + Aztec CLI skeleton
# ──────────────────────────────────────────────────────────────
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: '22.17.0'
- 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@v5
with:
ref: ${{ github.event.pull_request.base.sha }}
- 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: Manually tag the aztec version as `latest`
run: |
docker tag aztecprotocol/aztec:${{ steps.basever.outputs.ver }} aztecprotocol/aztec:latest
- 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@v5
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: Manually tag the aztec version as `latest`
run: |
docker tag aztecprotocol/aztec:${{ steps.prver.outputs.ver }} aztecprotocol/aztec:latest
- 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: Clean project from BASE stage
# run: rm -rf node_modules yarn.lock
- name: Install deps (PR)
run: yarn --frozen-lockfile
- name: Compile contracts (PR)
run: yarn compile
- name: Codegen wrappers (PR)
run: yarn codegen
# ──────────────────────────────────────────────────────────────
# 3️⃣ DIFF & UPLOAD ARTIFACTS
# ──────────────────────────────────────────────────────────────
- name: Generate benchmark comparison
uses: defi-wonderland/aztec-benchmark/action@main
with:
base_suffix: '_base'
current_suffix: '_pr'
# SECURITY: Upload results for secure comment workflow
- name: Upload benchmark results and metadata
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: |
benchmark-comparison.md
retention-days: 1
- name: Save PR number for comment workflow
run: |
echo "${{ github.event.number }}" > pr-number.txt
- name: Upload PR metadata
uses: actions/upload-artifact@v4
with:
name: pr-metadata
path: pr-number.txt
retention-days: 1