You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: merge next into merge-train/spartan (resolve networks.md conflict) (#24695)
Merges `next` into `merge-train/spartan` to unblock the daily auto-sync.
The `merge-train-next-to-branches` workflow runs `merge-next.sh
merge-train/spartan || true`, so when the merge hits a conflict it
aborts but the workflow still reports success — which is why the train
has been stuck a day behind `next`.
The only conflict is in `docs/docs/networks.md`: the train carried a
stale testnet **Slash Factory** address (from #24648, the v5
rollup-upgrade docs update), while `next` has since set it to `N/A`.
Resolved in favour of `next` (the newer state); this file now matches
`origin/next` exactly. No other files conflicted.
Per the merge-train conflict procedure, this should be force-merged with
`ci-skip` using the **merge commit** method (not squash) to preserve the
resolution.
Copy file name to clipboardExpand all lines: .claude/skills/chonk-inputs/SKILL.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,58 @@ Pinned Chonk IVC inputs live in an S3 tarball keyed by `barretenberg/cpp/scripts
14
14
15
15
Use the scripts instead of open-coding URLs, hashes, temp paths, or bucket listings.
16
16
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"):
`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:
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):
(`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.
0 commit comments