Skip to content

Commit a62f782

Browse files
committed
Merge branch 'merge-train/barretenberg' into lde/origin-tags-0
2 parents f1a813b + 7e26486 commit a62f782

File tree

1,589 files changed

+46691
-25512
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,589 files changed

+46691
-25512
lines changed

.claude/scripts/check-ci-url.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env python3
2+
import json
3+
import re
4+
import sys
5+
6+
data = json.load(sys.stdin)
7+
url = data.get('tool_input', {}).get('url', '')
8+
9+
if 'ci.aztec-labs.com' in url:
10+
# Allow if basic auth is present (user:pass@)
11+
if re.search(r'://[^/:]+:[^/@]+@ci\.aztec-labs\.com', url):
12+
sys.exit(0)
13+
print(f'BLOCKED: Cannot WebFetch ci.aztec-labs.com (requires auth). Use /ci-logs skill instead: /ci-logs {url}', file=sys.stderr)
14+
sys.exit(2)
15+
16+
sys.exit(0)

.claude/settings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"hooks": {
3+
"PreToolUse": [
4+
{
5+
"matcher": "WebFetch",
6+
"hooks": [
7+
{
8+
"type": "command",
9+
"command": "python3 .claude/scripts/check-ci-url.py"
10+
}
11+
]
12+
}
13+
]
14+
}
15+
}

.claude/skills/adding-benchmarks/SKILL.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,16 @@ function bench_cmds {
139139

140140
**Options:** `:ISOLATE=1`, `:CPUS=8`, `:MEM=16g`, `:TIMEOUT=7200`
141141

142+
**CPUS Suggestion:** For long running or compute-heavy benchmarks allocate CPUs (`:CPUS=N`). Benchmarks have strict scheduling, so if you request X CPUs, you'll have them available for consistent results.
143+
144+
**ISOLATE Suggestion:** Use `:ISOLATE=1` when your benchmark needs a clean, isolated environment with no network access and pinned resources. This runs the test in a Docker container, ensuring reproducible results without interference from other processes.
145+
146+
**MEM Suggestion:** Use `:MEM=Xg` (e.g., `:MEM=16g`) for memory-intensive benchmarks that may exceed the default allocation (CPUS × 4GB). Pair with `:ISOLATE=1` since memory limits are enforced via Docker.
147+
148+
**TIMEOUT Suggestion:** Use `:TIMEOUT=N` (in seconds) for benchmarks that take longer than the default timeout. For example, `:TIMEOUT=1800` for 30 minutes, `:TIMEOUT=7200` for 2 hours.
149+
150+
**Important naming gotcha:** Benchmark test files must use `.bench.test.ts` (with a dot before `bench`), NOT `_bench.test.ts`. The test discovery pattern `[[ "$test" =~ \.bench\.test\.ts$ ]]` specifically looks for `.bench.test.ts`.
151+
142152
### Step 3: Verify
143153

144154
```bash

.claude/skills/ci-log-reader/SKILL.md

Lines changed: 0 additions & 45 deletions
This file was deleted.

.claude/skills/ci-logs/ci-logs.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: ci-logs
3+
description: Analyze CI logs from ci.aztec-labs.com. Use this instead of WebFetch for CI URLs.
4+
user-invocable: true
5+
arguments: <url-or-hash>
6+
---
7+
8+
# CI Log Analysis
9+
10+
When you need to analyze logs from ci.aztec-labs.com, use the Task tool to spawn the analyze-logs agent.
11+
12+
## Usage
13+
14+
1. **Extract the hash** from the URL (e.g., `http://ci.aztec-labs.com/e93bcfdc738dc2e0``e93bcfdc738dc2e0`)
15+
16+
2. **Spawn the analyze-logs agent** using the Task tool:
17+
18+
```
19+
Task(
20+
subagent_type: "analyze-logs",
21+
prompt: "Analyze CI log hash: <hash>. Focus: errors",
22+
description: "Analyze CI logs"
23+
)
24+
```
25+
26+
## Examples
27+
28+
**User asks:** "What failed in http://ci.aztec-labs.com/343c52b17688d2cd"
29+
30+
**You do:**
31+
```
32+
Task(
33+
subagent_type: "analyze-logs",
34+
prompt: "Analyze CI log hash: 343c52b17688d2cd. Focus: errors. Download with: yarn ci dlog 343c52b17688d2cd > /tmp/343c52b17688d2cd.log",
35+
description: "Analyze CI failure"
36+
)
37+
```
38+
39+
**For specific test analysis:**
40+
```
41+
Task(
42+
subagent_type: "analyze-logs",
43+
prompt: "Analyze CI log hash: 343c52b17688d2cd. Focus: test 'my test name'",
44+
description: "Analyze test failure"
45+
)
46+
```
47+
48+
## Do NOT
49+
50+
- Do NOT use WebFetch to access ci.aztec-labs.com (requires auth)
51+
- Do NOT try to curl the URL directly
52+
- Always use the analyze-logs agent which knows how to use `yarn ci dlog`

.github/workflows/ci3.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ jobs:
7373
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
7474
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
7575
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
76+
# For automatic documentation updates via Claude Code
77+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
7678
# Nightly test env vars.
7779
EXTERNAL_ETHEREUM_HOSTS: "https://json-rpc.${{ secrets.GCP_SEPOLIA_URL }}?key=${{ secrets.GCP_SEPOLIA_API_KEY }},${{ secrets.INFURA_SEPOLIA_URL }}"
7880
EXTERNAL_ETHEREUM_CONSENSUS_HOST: "https://beacon.${{ secrets.GCP_SEPOLIA_URL }}"
@@ -120,6 +122,7 @@ jobs:
120122
# End-to-end tests that target a network deployment.
121123
# We run this every release (at minimum, nightly), or when explicitly requested.
122124
# This task runs against a real testnet deployment. This uses resources on GCP (not AWS, thank free credit incentives).
125+
# Runs two test sets in parallel.
123126
ci-network-scenario:
124127
runs-on: ubuntu-latest
125128
# We either run after a release (tag starting with v), or when the ci-network-scenario label is present in a PR.
@@ -132,7 +135,8 @@ jobs:
132135
with:
133136
ref: ${{ github.event.pull_request.head.sha || github.sha }}
134137

135-
- name: Run Network Deploy
138+
- name: Run Network Scenarios
139+
timeout-minutes: 350
136140
env:
137141
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
138142
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -145,7 +149,7 @@ jobs:
145149
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
146150
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
147151
RUN_ID: ${{ github.run_id }}
148-
AWS_SHUTDOWN_TIME: 540 # temporarily increased to 9 hours, todo(revert to 360)
152+
AWS_SHUTDOWN_TIME: 360
149153
NO_SPOT: 1
150154
run: |
151155
# For release tags, use the release image; for PRs, omit to build and push to aztecdev
@@ -162,7 +166,7 @@ jobs:
162166
docker_image=""
163167
fi
164168
set -x # print next line
165-
./.github/ci3.sh network-deploy next-scenario "$namespace" "$docker_image"
169+
./.github/ci3.sh network-scenarios next-scenario "$namespace" "$docker_image"
166170
167171
- name: Cleanup network resources
168172
# Clean up if this is a CI label or nightly.
@@ -175,7 +179,9 @@ jobs:
175179
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
176180
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
177181
NO_SPOT: 1
178-
run: ./.github/ci3.sh network-teardown next-scenario "$NAMESPACE"
182+
run: |
183+
./.github/ci3.sh network-teardown next-scenario "${NAMESPACE}-1" || true
184+
./.github/ci3.sh network-teardown next-scenario "${NAMESPACE}-2" || true
179185
180186
#############
181187
# Benchmarks

.github/workflows/nightly-docs-release.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,64 @@ jobs:
127127
./scripts/aztec_nr_docs_generation/generate_aztec_nr_docs.sh ${{ env.NIGHTLY_TAG }}
128128
echo "Generated Aztec.nr API docs for: ${{ env.NIGHTLY_TAG }}"
129129
130+
- name: Download bb from GitHub release
131+
env:
132+
GH_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
133+
run: |
134+
mkdir -p /tmp/bb-bin
135+
gh release download ${{ env.NIGHTLY_TAG }} \
136+
--pattern "barretenberg-amd64-linux.tar.gz" \
137+
--dir /tmp/bb-bin
138+
tar -xzf /tmp/bb-bin/barretenberg-amd64-linux.tar.gz -C /tmp/bb-bin
139+
chmod +x /tmp/bb-bin/bb
140+
echo "BB_PATH=/tmp/bb-bin" >> $GITHUB_ENV
141+
142+
- name: Build noir packages
143+
run: |
144+
# Initialize noir submodule (required for yarn-project portal dependencies)
145+
git submodule update --init --recursive noir/noir-repo
146+
# Build noir JS packages (creates noir/packages/ directory needed by yarn-project)
147+
cd noir
148+
./bootstrap.sh install_deps
149+
./bootstrap.sh build_packages
150+
151+
- name: Build aztec CLI
152+
working-directory: ./yarn-project
153+
run: |
154+
./bootstrap.sh
155+
echo "AZTEC_CLI_PATH=$(pwd)/aztec/dest/bin" >> $GITHUB_ENV
156+
157+
- name: Generate CLI documentation
158+
working-directory: ./docs
159+
continue-on-error: true
160+
run: |
161+
# Add bb from release to PATH
162+
export PATH="${BB_PATH}:${PATH}"
163+
164+
# Create wrapper for aztec CLI that runs the local build
165+
mkdir -p /tmp/cli-bin
166+
cat > /tmp/cli-bin/aztec << 'EOF'
167+
#!/bin/bash
168+
node "$AZTEC_CLI_PATH/index.js" "$@"
169+
EOF
170+
chmod +x /tmp/cli-bin/aztec
171+
export PATH="/tmp/cli-bin:${PATH}"
172+
173+
# Generate Aztec CLI docs using binaries (continue-on-error handles failures)
174+
./scripts/cli_reference_generation/generate_all_cli_docs.sh --force current
175+
echo "Aztec CLI documentation generation attempted for: ${{ env.NIGHTLY_TAG }}"
176+
177+
- name: Generate BB CLI documentation
178+
working-directory: ./barretenberg/docs
179+
continue-on-error: true
180+
run: |
181+
# Add bb from release to PATH
182+
export PATH="${BB_PATH}:${PATH}"
183+
184+
# Generate BB CLI docs
185+
./scripts/generate_bb_cli_docs.sh --force current
186+
echo "BB CLI documentation generation attempted for: ${{ env.NIGHTLY_TAG }}"
187+
130188
- name: Create Aztec nightly docs version (Developer docs only)
131189
working-directory: ./docs
132190
run: |
@@ -180,6 +238,9 @@ jobs:
180238
181239
- name: Commit new Aztec and Barretenberg Docs version
182240
run: |
241+
# Reset non-versioned CLI docs (only versioned copies should be committed)
242+
git checkout -- docs/docs-developers/docs/cli/*_cli_reference.md || true
243+
183244
# Stash the docs changes
184245
git add .
185246
git stash push --staged -m "nightly docs for ${{ env.NIGHTLY_TAG }}"
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Alpha Team Canary
2+
3+
on:
4+
push:
5+
branches:
6+
- next
7+
paths:
8+
# Match any file named bootstrap.sh
9+
- '**/bootstrap.sh'
10+
# Anything in ci3 folder
11+
- 'ci3/**'
12+
13+
env:
14+
CANARY_BRANCH: ad/chore/ci-release-pr-canary
15+
PR_TITLE: "no-merge: alpha canary PR"
16+
PR_LABEL: ci-release-pr
17+
18+
jobs:
19+
update-canary-pr:
20+
name: Update alpha team canary PR
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
25+
with:
26+
fetch-depth: 0
27+
token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
28+
29+
- name: Configure Git
30+
run: |
31+
git config --global user.name AztecBot
32+
git config --global user.email [email protected]
33+
34+
- name: Ensure canary branch and PR exist
35+
id: ensure-pr
36+
env:
37+
GH_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
38+
run: |
39+
# Check if branch exists
40+
if ! git ls-remote --exit-code --heads origin "$CANARY_BRANCH" >/dev/null 2>&1; then
41+
echo "Creating canary branch from next"
42+
git checkout -b "$CANARY_BRANCH" origin/next
43+
git push -u origin "$CANARY_BRANCH"
44+
fi
45+
46+
# Check if PR exists
47+
pr_number=$(gh pr list --state open --head "$CANARY_BRANCH" --json number --jq '.[0].number')
48+
49+
if [[ -z "$pr_number" ]]; then
50+
echo "Creating canary PR"
51+
pr_url=$(gh pr create \
52+
--head "$CANARY_BRANCH" \
53+
--base next \
54+
--title "$PR_TITLE" \
55+
--label "$PR_LABEL" \
56+
--body "This PR tests certain CI labels periodically. Any failures in this branch log to alpha-team channel with slack.
57+
58+
This PR is automatically updated when \`**/bootstrap.sh\` or \`ci3/**\` files are pushed to \`next\`.
59+
60+
**Important:** This PR should never be merged. It exists solely to test the \`ci-release-pr\` label.")
61+
62+
pr_number=$(gh pr list --state open --head "$CANARY_BRANCH" --json number --jq '.[0].number')
63+
echo "Created canary PR #$pr_number"
64+
fi
65+
66+
echo "pr_number=$pr_number" >> $GITHUB_OUTPUT
67+
68+
- name: Check if CI is already running
69+
id: check-ci
70+
env:
71+
GH_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
72+
run: |
73+
pr_number="${{ steps.ensure-pr.outputs.pr_number }}"
74+
75+
# Check if CI is currently running on this PR
76+
running_ci=$(gh run list --branch "$CANARY_BRANCH" --workflow ci3.yml --status in_progress --json databaseId --jq 'length')
77+
78+
if [[ "$running_ci" -gt 0 ]]; then
79+
echo "CI is already running on canary PR #$pr_number, skipping update"
80+
echo "skip=true" >> $GITHUB_OUTPUT
81+
else
82+
echo "No CI running, proceeding with update"
83+
echo "skip=false" >> $GITHUB_OUTPUT
84+
fi
85+
86+
- name: Merge next into canary branch
87+
if: steps.check-ci.outputs.skip != 'true'
88+
env:
89+
GH_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
90+
run: |
91+
pr_number="${{ steps.ensure-pr.outputs.pr_number }}"
92+
93+
# Fetch both branches
94+
git fetch origin "$CANARY_BRANCH" next
95+
96+
# Checkout the canary branch
97+
git checkout "$CANARY_BRANCH"
98+
99+
# Merge next into canary branch
100+
if git merge origin/next --no-edit -m "Merge branch 'next' into $CANARY_BRANCH"; then
101+
echo "Successfully merged next into $CANARY_BRANCH"
102+
git push origin "$CANARY_BRANCH"
103+
echo "Pushed update to $CANARY_BRANCH"
104+
105+
# Re-add the ci-release-pr label (it gets removed after each CI run)
106+
gh pr edit "$pr_number" --add-label "$PR_LABEL"
107+
echo "Re-added $PR_LABEL label to PR #$pr_number"
108+
else
109+
echo "Merge conflict detected, aborting"
110+
git merge --abort
111+
exit 1
112+
fi

0 commit comments

Comments
 (0)