Skip to content

Commit f0b4319

Browse files
committed
Merge branch 'next' into merge-train/spartan
# Conflicts: # docs/docs/networks.md
2 parents bfef302 + 3f999a4 commit f0b4319

4,408 files changed

Lines changed: 288239 additions & 131191 deletions

File tree

Some content is hidden

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

.claude/agents/aztec-wallet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fi
4848

4949
# Query node version
5050
RESPONSE=$(curl -sf -X POST -H 'Content-type: application/json' \
51-
--data '{"jsonrpc":"2.0","id":1,"method":"node_getNodeInfo"}' \
51+
--data '{"jsonrpc":"2.0","id":1,"method":"aztec_getNodeInfo"}' \
5252
"$RPC_URL" 2>&1) || {
5353
echo "ERROR: Could not reach node at $RPC_URL" >&2
5454
echo "Response: $RESPONSE" >&2

.claude/skills/capture-app-flow/SKILL.md

Lines changed: 171 additions & 0 deletions
Large diffs are not rendered by default.

.claude/skills/chonk-inputs/SKILL.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,58 @@ Pinned Chonk IVC inputs live in an S3 tarball keyed by `barretenberg/cpp/scripts
1414

1515
Use the scripts instead of open-coding URLs, hashes, temp paths, or bucket listings.
1616

17+
## Pins to keep in sync
18+
19+
A bb/proof-system change that rotates VKs touches THREE tracked pins, and all of them feed the captured Chonk flows:
20+
21+
- The mock artifact pin `noir-projects/mock-protocol-circuits/pinned-build.tar.gz` freezes mock protocol circuit bytecode and VKs used by Chonk fixture capture.
22+
- The standard-contracts pin `noir-projects/noir-contracts/pinned-standard-contracts.tar.gz` freezes the `contracts/standard/` artifacts with their precomputed VKs and deterministic addresses. `noir-contracts/bootstrap.sh build` extracts it and excludes `standard/` from recompilation, so these VKs only refresh via `pin-standard-build` (step 5).
23+
- The Chonk flow pin `barretenberg/cpp/scripts/chonk-inputs.hash` points to the S3 tarball of captured `ivc-inputs.msgpack` flows. Those msgpacks embed bytecode, witnesses, circuit kinds, and precomputed VKs — including the standard-contract VKs above, so the standard-contracts pin must be correct *before* recapturing flows.
24+
25+
`noir-projects/noir-protocol-circuits/pinned-build.tar.gz` is not a current tracked pin on the `next` line. `noir-projects/bootstrap.sh pin-build` may generate it as untracked local build output; do not commit it unless intentionally reintroducing that large artifact pin.
26+
27+
If a bb/proof-system change can affect VKs, refresh in this order:
28+
29+
1. Rebuild the AVM-enabled bb binary so the regenerated VKs reflect the change. `cmake --build build --target bb` is not enough: `noir-projects/noir-protocol-circuits/bootstrap.sh` resolves the bb binary via `barretenberg/cpp/scripts/find-bb`, which returns `bb-avm` (not `bb`) unless `AVM=0`. From `barretenberg/cpp/`:
30+
```bash
31+
cmake --preset default -DAVM=ON
32+
cmake --build build --target bb-avm
33+
```
34+
2. Repin Noir artifacts with the AVM-enabled binary: `./bootstrap.sh pin-build` from `noir-projects/`. Do not set `AVM=0` — the `*-tx-base-public` circuits verify an AVM proof, so non-AVM `bb` fails their VK generation with "AVM recursion is not supported in this build". Because pin-build runs under `set +e`, that failure does not abort the run; it silently archives an incomplete `pinned-build.tar.gz` with stale/missing VKs.
35+
3. Keep the tracked `noir-projects/mock-protocol-circuits/pinned-build.tar.gz` diff.
36+
4. Remove the generated untracked `noir-projects/noir-protocol-circuits/pinned-build.tar.gz` unless intentionally reintroducing that large pin.
37+
5. Repin the standard contracts **iteratively, and regenerate their address stamps**. A stale standard-contracts pin surfaces as a "Computed VK differs from precomputed VK" mismatch on a `standard/` contract function during chonk capture verification. Repinning is not a single command: `pin-standard-build` compiles the standard contracts against the *current* `standard_addresses.nr` and tarballs them — it does NOT regenerate the stamps, and standard contracts can reference each other's deterministic addresses. Because a contract's address depends on its bytecode, which depends on the addresses it embeds, you must repeat the re-pin + stamp-regeneration until a round changes nothing (the addresses stop moving):
38+
```bash
39+
cd noir-projects/noir-contracts
40+
# repeat this pair until `generate` makes no change (exits 0, no "Changed values"):
41+
BB=$(realpath ../../barretenberg/cpp/build/bin/bb-avm) ./bootstrap.sh pin-standard-build
42+
(cd ../../yarn-project && yarn workspace @aztec/standard-contracts generate) # rewrites stamps; exits non-zero on drift
43+
```
44+
`BB` defaults to non-AVM `bb`; set it to `bb-avm` explicitly. Once converged, run `noir-projects/bootstrap.sh` once to recompile dependents against the final addresses, then commit the pin **together with** the three regenerated stamp files:
45+
- `yarn-project/standard-contracts/src/standard_contract_data.ts`
46+
- `noir-projects/aztec-nr/aztec/src/standard_addresses.nr`
47+
- `noir-projects/noir-contracts/contracts/protocol/aztec_sublib/src/standard_addresses.nr`
48+
49+
Two failure modes if you cut corners: skipping the stamp regen rotates the contract addresses out from under the committed stamps → a cascade of contract-class / "address not updated" failures; stopping before the addresses stabilize leaves a pinned contract calling another standard contract's *previous* address → e2e capture aborts with `Function artifact not found for contract 0x…` during flow execution.
50+
6. Recapture and upload Chonk flows with `barretenberg/cpp/scripts/chonk_inputs.sh update` (only after step 5 is committed, since the capture embeds the standard-contract VKs).
51+
52+
After pin-build, sanity-check that the tracked tarball is a full pin, not the empty/incomplete shell a silent failure leaves behind: `tar tzf noir-projects/mock-protocol-circuits/pinned-build.tar.gz | grep -c '\.json$'` should list every circuit (a 400-byte tarball containing only `./` and `./keys/` means the build produced nothing).
53+
54+
A refreshed Chonk flow pin alone can still contain stale VKs if the capture used stale Noir artifacts. `ChonkPinnedIvcInputsTest.AllPinnedFlows` uses the embedded VKs with the default policy, so stale VKs may surface later as generated-proof verification failure rather than the explicit `chonk_inputs.sh check` VK-mismatch message.
55+
56+
## Diagnosing an `AllPinnedFlows` failure
57+
58+
Decide whether you have a pin problem or something upstream **before** repinning or re-uploading:
59+
60+
- **Download / hash failure** (`failed to download … may be stale`, `InvalidAccessKeyId`) → a pin/upload problem. Refresh the flow pin; for `InvalidAccessKeyId`, the build+capture is fine but your AWS creds are expired — the canonical fix is the `ci-refresh-chonk` label so CI uploads with its own creds.
61+
- **Prove / verify failure** (e.g. `ChonkVerifier: verification failed at PI pairing points check`, `Failed to verify the generated proof`) → does NOT by itself mean the flow pin is stale, and re-capturing the flow pin will not fix it. Factor out the pin by re-running the test against a freshly-captured local flow set (the test honors `CHONK_PINNED_IVC_INPUTS_DIR`, with no hash/marker check):
62+
```bash
63+
CHONK_PINNED_IVC_INPUTS_DIR=$(pwd)/yarn-project/end-to-end/chonk-pinned-flows \
64+
CHONK_PINNED_IVC_FLOW=<flow> AZTEC_REPO_ROOT=$(pwd) \
65+
./barretenberg/cpp/build/bin/bbapi_tests --gtest_filter='ChonkPinnedIvcInputsTest.AllPinnedFlows'
66+
```
67+
(`CHONK_PINNED_IVC_FLOW` filters to one flow dir for a fast loop; omit it to run all.) If a freshly-captured flow fails identically, the flow pin is not the cause — an embedded *precomputed* VK is stale. Run `bb check --scheme chonk` over the flows to name the function (`VK mismatch detected for function <contract>:<fn>`); if it's a `standard/` contract, the cause is the standard-contracts pin (step 5), not the flow pin.
68+
1769
## Common Commands
1870

1971
Download or repair the local fixture directory:

.claude/skills/release-docs/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Fetch node info from the provided RPC URL:
2929

3030
```bash
3131
curl -s -X POST -H 'Content-Type: application/json' \
32-
-d '{"method":"node_getNodeInfo"}' <RPC_URL> | jq .result
32+
-d '{"method":"aztec_getNodeInfo"}' <RPC_URL> | jq .result
3333
```
3434

3535
Parse the response to extract:
@@ -220,7 +220,7 @@ These files are auto-generated — do not hand-edit them.
220220

221221
Regenerate the Node JSON-RPC API reference documentation. This script parses the
222222
TypeScript interface definitions and Zod schemas in `yarn-project/stdlib/src/interfaces/`
223-
to produce a complete markdown reference for the `node_` and `nodeAdmin_` RPC methods.
223+
to produce a complete markdown reference for the `aztec_` and `aztecAdmin_` RPC methods.
224224

225225
**Prerequisite:** `yarn-project` must be built (already done in Step 6 prerequisites).
226226

@@ -267,7 +267,7 @@ docs (Step 11), the generated content is included in the snapshot automatically.
267267
### Step 9: Resolve Missing Contract Addresses & Update Network Info
268268

269269
The `networks.md` L1 table includes contracts that are **not** returned by
270-
`node_getNodeInfo`. Before updating the tables, resolve these in three tiers.
270+
`aztec_getNodeInfo`. Before updating the tables, resolve these in three tiers.
271271

272272
Determine the L1 RPC URL from the `l1ChainId`: `1` → Ethereum mainnet,
273273
`11155111` → Sepolia. The Rollup and Registry addresses are already known from

.claude/skills/release-network-docs/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Fetch node info from the provided RPC URL:
4545

4646
```bash
4747
curl -s -X POST -H 'Content-Type: application/json' \
48-
-d '{"method":"node_getNodeInfo"}' <RPC_URL> | jq .result
48+
-d '{"method":"aztec_getNodeInfo"}' <RPC_URL> | jq .result
4949
```
5050

5151
Parse the response to extract:
@@ -87,7 +87,7 @@ git tag -l "v<nodeVersion>"
8787
### Step 3: Identify and Resolve Missing Contract Addresses
8888

8989
The `networks.md` L1 table includes contracts that are **not** returned by
90-
`node_getNodeInfo`. Resolve these addresses in three tiers:
90+
`aztec_getNodeInfo`. Resolve these addresses in three tiers:
9191

9292
#### Tier 1: Query on-chain from known contracts
9393

.github/ci3_labels_to_env.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ function main {
127127
echo "WARNING: Skipping main CI because Chonk input refresh was requested; the update step will run after this step succeeds." >&2
128128
ci_mode="skip"
129129
elif has_label "ci-release-pr"; then
130+
# Release-PR mode creates and pushes a release tag for this PR's head (ci3.sh::handle_release_pr).
131+
# In the private repo that tag triggers a private release via the safety gate below — this is the
132+
# manual way to cut a private release from a PR, alongside the nightly tag cron.
130133
ci_mode="release-pr"
131134
elif has_label "ci-full"; then
132135
ci_mode="full"
@@ -141,6 +144,9 @@ function main {
141144
elif has_label "ci-barretenberg" || [ "$target_branch" == "merge-train/barretenberg" ]; then
142145
ci_mode="barretenberg"
143146
elif [[ "${GITHUB_REF:-}" == refs/tags/v* ]]; then
147+
# A pushed semver tag is a release; REF_NAME is the tag (see ci3/source_refname). In the private
148+
# repo this is the nightly path (nightly-release-tag*.yml push v<ver>-nightly.<date> tags on next and
149+
# v5-next); the private-repo safety gate below routes it to the internal Artifact Registry.
144150
ci_mode="release"
145151
else
146152
ci_mode="fast"
@@ -149,6 +155,17 @@ function main {
149155
echo "CI_MODE=$ci_mode" >> $GITHUB_ENV
150156
echo "CI mode: $ci_mode"
151157

158+
# Private-repo safety gate. The release flow can publish to DockerHub/npmjs/crates.io/github; that
159+
# MUST NEVER run in the private fork. So whenever this repo would release — for ANY trigger (a pushed
160+
# nightly tag, a ci-release-pr tag, anything future) — force the private path: publish only the docker
161+
# image and npm packages to our internal Artifact Registry (bootstrap.sh::private_release). Keyed on
162+
# the repo name (case-insensitive) so it can't be reached in the public repo.
163+
if [ "$ci_mode" = "release" ] &&
164+
[ "$(printf '%s' "${GITHUB_REPOSITORY:-}" | tr 'A-Z' 'a-z')" = "aztecprotocol/aztec-packages-private" ]; then
165+
echo "PRIVATE_RELEASE=1" >> $GITHUB_ENV
166+
echo "SKIP_COMPAT_E2E=1" >> $GITHUB_ENV
167+
fi
168+
152169
# Benching modes run their benches on a dedicated, fixed-hardware box (stable numbers)
153170
# and publish the result; ci-fast never benches. For grind runs (merge-queue-heavy fires
154171
# ~10 instances) only the first instance keeps BENCH_UPLOAD=1 — multi_job_run forces the

.github/ci3_success.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,23 @@ function handle_squash_merge {
2525
return
2626
fi
2727
# If we have passed CI and labelled with ci-squash-and-merge, squash the PR.
28-
# This will rerun CI on the squash commit - but is intended to be a no-op due to caching.
2928
echo "Processing squash and merge..."
3029
# Reauth the git repo with our GITHUB_TOKEN
3130
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${github_repository}
3231
git config --unset-all http.https://github.com/.extraheader || true
33-
# Get the base commit (merge-base) for the PR
32+
# Drop the trigger label BEFORE squashing. squash-pr.sh force-pushes, which fires a fresh
33+
# `synchronize` event; if the label were still set, that event would re-enter this path and loop.
34+
# Use the REST endpoint (needs only the `repo` scope AZTEC_BOT_GITHUB_TOKEN has) rather than
35+
# `gh pr edit --remove-label`, which runs an org/team GraphQL query requiring `read:org` — a scope
36+
# the token lacks, so it errored here and the label was never cleared. `|| true` stops a transient
37+
# failure from aborting the merge; squash-pr.sh's single-commit guard prevents looping regardless.
38+
gh api -X DELETE "repos/${github_repository}/issues/${PR_NUMBER}/labels/ci-squash-and-merge" || true
39+
# Squash the PR commits into one (no-op when the branch is already a single commit).
3440
./scripts/merge-train/squash-pr.sh \
3541
"${PR_NUMBER}" \
3642
"${PR_HEAD_REF}" \
3743
"${PR_BASE_REF}" \
3844
"${PR_BASE_SHA}"
39-
gh pr edit "${PR_NUMBER}" --remove-label "ci-squash-and-merge"
4045
gh pr merge "${PR_NUMBER}" --auto -m || true
4146
echo "Squash and merge completed"
4247
}

.github/workflows/avm-circuit-inputs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ concurrency:
1515

1616
jobs:
1717
collect-avm-circuit-inputs:
18-
if: ${{ github.event_name != 'schedule' || github.repository == 'AztecProtocol/aztec-packages' }}
18+
if: ${{ github.repository != 'AztecProtocol/aztec-packages-private' && (github.event_name != 'schedule' || github.repository == 'AztecProtocol/aztec-packages') }}
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout
@@ -67,7 +67,7 @@ jobs:
6767

6868
avm-check-circuit:
6969
needs: collect-avm-circuit-inputs
70-
if: ${{ github.event_name != 'schedule' || github.repository == 'AztecProtocol/aztec-packages' }}
70+
if: ${{ github.repository != 'AztecProtocol/aztec-packages-private' && (github.event_name != 'schedule' || github.repository == 'AztecProtocol/aztec-packages') }}
7171
runs-on: ubuntu-latest
7272
steps:
7373
- name: Checkout

.github/workflows/aztec-cli-acceptance-test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@ jobs:
2323
matrix:
2424
os: [ubuntu-latest, macos-latest]
2525
runs-on: ${{ matrix.os }}
26+
# The auto acceptance test validates published releases, which are only cut from the
27+
# public aztec-packages repo. Don't let the workflow_run trigger fire in the private
28+
# mirror, where it runs against non-release branches (e.g. v5-next) and always fails.
2629
if: >-
2730
github.event_name == 'workflow_dispatch' ||
2831
(github.event_name == 'workflow_run'
2932
&& github.event.workflow_run.conclusion == 'success'
30-
&& !contains(github.event.workflow_run.head_branch, '-commit.'))
33+
&& !contains(github.event.workflow_run.head_branch, '-commit.')
34+
&& github.repository != 'AztecProtocol/aztec-packages-private')
3135
env:
3236
VERSION: ${{ github.event.inputs.version || github.event.workflow_run.head_branch }}
3337
steps:
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Bench Inclusion Point
2+
3+
# Reusable: runs ONE inclusion-sweep TPS point against an ALREADY-DEPLOYED
4+
# network (SKIP_NETWORK_DEPLOY=1). The caller (nightly-bench-inclusion-sweep.yml)
5+
# deploys the network once and calls this for each point (1/5/10 TPS), chaining
6+
# the calls so the points run sequentially on the same network. Deploy / wait /
7+
# teardown are done once by the caller, not here.
8+
9+
on:
10+
workflow_call:
11+
inputs:
12+
tps:
13+
description: "Target TPS for this point"
14+
required: true
15+
type: string
16+
namespace:
17+
description: "k8s namespace of the already-deployed network"
18+
required: true
19+
type: string
20+
network:
21+
description: "Network env name (environments/<network>.env)"
22+
required: false
23+
type: string
24+
default: bench-inclusion-sweep
25+
docker_image:
26+
description: "Full aztec docker image (already deployed)"
27+
required: true
28+
type: string
29+
source_ref:
30+
description: "Git ref to checkout for the bench scripts"
31+
required: true
32+
type: string
33+
sweep_id:
34+
description: "Shared sweep id so the dashboard groups the points"
35+
required: true
36+
type: string
37+
38+
jobs:
39+
bench:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
43+
with:
44+
ref: ${{ inputs.source_ref }}
45+
- name: Run ${{ inputs.tps }} TPS inclusion point
46+
timeout-minutes: 120
47+
env:
48+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
49+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
50+
GITHUB_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
51+
BUILD_INSTANCE_SSH_KEY: ${{ secrets.BUILD_INSTANCE_SSH_KEY }}
52+
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
53+
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
54+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
55+
RUN_ID: ${{ github.run_id }}
56+
AWS_SHUTDOWN_TIME: 180
57+
NO_SPOT: 1
58+
SKIP_NETWORK_DEPLOY: "1"
59+
TARGET_TPS: ${{ inputs.tps }}
60+
BENCH_SWEEP_ID: ${{ inputs.sweep_id }}
61+
BENCH_SWEEP_LABEL: inclusion-sweep
62+
run: ./.github/ci3.sh network-inclusion-sweep ${{ inputs.network }} ${{ inputs.namespace }} "${{ inputs.docker_image }}"

0 commit comments

Comments
 (0)