Repository navigation
fix(l1): include the Noir compiler in the l1-contracts cache hash - #25577
Merged
Merged
Conversation
iAmMichaelConnor
marked this pull request as ready for review
October 2, 2026 12:02
iAmMichaelConnor
approved these changes
Oct 2, 2026
iAmMichaelConnor
enabled auto-merge (squash)
October 2, 2026 12:02
Collaborator
Author
Flakey Tests🤖 says: This CI run detected 2 tests that failed, but were tolerated due to a .test_patterns.yml entry. |
15 tasks done
iAmMichaelConnor
pushed a commit
that referenced
this pull request
Oct 2, 2026
…e L1 verifier (#25578) ## Problem `generate_vk` in `noir-projects/fnd/noir-protocol-circuits/bootstrap.sh` cached each circuit's VK under `BB_HASH`, the bytecode hash, the circuit name and a hand-bumped `-3`. Two inputs were missing: - **The scheme and circuit kind.** These are chosen by `circuit_kind` from `chonk_circuits.json` and `rollup_honk_circuits.json`, and mapped to `bb write_vk` flags by the script. A change to a manifest or to the flag mapping left the key unchanged, so the shared cache served the VK for the previous scheme. - **The Solidity verifier flags.** For `rollup_root`, the same cache entry also carried `rollup_root_verifier.sol`. A change to the `bb write_solidity_verifier` flags left the key unchanged, so the cache restored the previous verifier. `l1-contracts` then copied that file into `generated/HonkVerifier.sol` and compiled it. Nothing on `next` compares the compiled `HonkVerifier` with its source, so a stale L1 verifier would go unnoticed. ## Fix - **VK cache key.** The key is now `BB_HASH`, bytecode hash, name, the circuit's kind, and the content hash of `bootstrap.sh`. The kind captures what the manifests decide for that circuit. The script hash captures the kind-to-flags mapping. That hash is computed once as `script_hash` and shared with the `compile` key, which already used it; the `compile` key's value is unchanged. The manual `-3` epoch is gone. - **Solidity verifier.** It is no longer stored in the cache. `generate_vk` writes it on every build from the current VK and the current flags, so it cannot be stale. - **Freshness check.** `l1-contracts` `test_cmds` gains one test on every branch: `cmp generated/HonkVerifier.sol` against `target/keys/rollup_root_verifier.sol`. Its test-cache key includes the digest of the source verifier, so it reruns whenever that verifier changes even if the l1-contracts hash does not. ## Suggestions from the issue not taken - **Make `check_pinned_vk` bypass the cache.** With the complete key, a cache hit is a VK computed from the same bb, bytecode, kind and script. Bypassing the cache would regenerate every VK on every pinned build, which removes the benefit of the pin. - **Output-addressed `l1-contracts-verifier` key.** It does not help this path (a stale file has the same digest), and it needs `l1-contracts` hashing to be restructured. The freshness check covers the l1-side cache instead. ## Effects to expect - Every VK cache entry is regenerated once, because the key formula changed. - Any later edit to this `bootstrap.sh` regenerates all VKs. The `compile` key already recompiles all circuits in that case. - `bb write_solidity_verifier` runs once per build for `rollup_root` and `mock_rollup_root`, including on cache hits. It takes under a second. ## Tests On this branch: `bash -n` on both bootstrap scripts, and `scripts/circuit_kind.test.sh` passes (18 of 18). The full build is covered by CI. The same diff was exercised as a real build before this PR was opened, on a checkout where the touched hunks are identical, against the shared build cache with uploads disabled: 1. **Warm and cold paths agree.** `./bootstrap.sh compile rollup-root` (VK from the cache) and `NO_CACHE=1 ./bootstrap.sh generate_vk rollup_root` (VK regenerated) produced identical VK bytes and the same `rollup_root_verifier.sol` (sha256 `a7bf113d…`, 327,282 B). 2. **Verifier-flag change.** With a commit that only drops `--optimized`, the old code hit the VK cache and restored the optimized verifier (`a7bf113d…`). With this change the build wrote `c7f26a79…` (96,610 B), which equals a direct `bb write_solidity_verifier` without `--optimized` on the same VK. 3. **Manifest-only change.** With a commit that only adds `inbox_parity` to `rollup_honk_circuits.json`, the old code kept the same VK cache key and served the VK for the old kind. With this change the key moved and the VK was regenerated with different bytes. 4. **l1 freshness test.** With `generated/HonkVerifier.sol` restored from the l1 cache, the `cmp` test exited 1 (`differ: byte 1, line 1`) when the circuits-side verifier was different and 0 when it matched. Its test-cache key differed between the two cases. Not run: the pinned-build path (`pinned-build.tar.gz` is absent on `next`). ## Related #25577 fixes the separate Noir-commit omission in the `l1-contracts` hash (AztecProtocol/aztec-claude#1955). The two PRs touch different parts of `l1-contracts/bootstrap.sh` and do not depend on each other. Closes AztecProtocol/aztec-claude#2122 --- *Created by [claudebox](https://claudebox.work/v2/sessions/f45fcb875796a470/jobs/11) · group: `slackbot` · requested by Mike (@iAmMichaelConnor) · [Slack thread](https://aztecfoundation.slack.com/archives/D0B2N7W1WJD/p1790886022336469?thread_ts=1790886022.336469&cid=D0B2N7W1WJD)*
AztecBot
added a commit
that referenced
this pull request
Oct 4, 2026
…5577) ## Problem `l1-contracts/generated/HonkVerifier.sol` is copied from `noir-projects/fnd/noir-protocol-circuits/target/keys/rollup_root_verifier.sol`, which is produced by compiling the protocol circuits with `nargo`. The `l1-contracts-verifier-$hash` and `l1-contracts-ts-$hash` artifacts therefore depend on the `noir/noir-repo` commit. The l1-contracts cache hash only listed `../noir/.rebuild_patterns`, which matches `^noir/bootstrap.sh` and not the submodule gitlink. So a Noir-only bump left the hash unchanged and reused the cached verifier and TypeScript artifacts from before the bump. ## Fix `l1-contracts/bootstrap.sh` now builds its hash the same way the other Noir consumers do (`avm-transpiler/bootstrap.sh`, and `NOIR_HASH` in `noir-projects/fnd/noir-protocol-circuits/bootstrap.sh`): ```bash export hash=$(hash_str $(../noir/bootstrap.sh hash) $(cache_content_hash \ .rebuild_patterns \ ../noir-projects/fnd/noir-protocol-circuits \ ../barretenberg/cpp/.rebuild_patterns )) ``` `noir/bootstrap.sh hash` is `hash_str <noir-repo commit> <noir rebuild patterns>`, so it already covers `noir/bootstrap.sh`. The explicit `../noir/.rebuild_patterns` entry is therefore removed. `hash_str` passes a `disabled-cache` content hash through unchanged, so dirty-tree behaviour is the same. ## Trade-off l1-contracts uses one hash for `build_src`, the verifier, the TS artifacts and its tests. A Noir bump now invalidates all of them, including `l1-contracts-src`, which does not depend on the circuits. The same hash already rotates on any change under `noir-protocol-circuits`, and Noir bumps are infrequent, so the single hash is kept. ## Tests There is no unit-test harness for bootstrap hashes, so this is a reproducible check across 7d61007 ("chore: update Noir to v1.0.0-rc.3"), which changes the `noir/noir-repo` gitlink plus two files that are not l1-contracts inputs. Run from `l1-contracts`: ```bash NO_CD=1 source ../ci3/source for c in 7d61007^ 7d61007; do export AZTEC_CACHE_COMMIT=$(git rev-parse $c) old=$(cache_content_hash .rebuild_patterns ../noir/.rebuild_patterns ../noir-projects/fnd/noir-protocol-circuits ../barretenberg/cpp/.rebuild_patterns) noir=$(hash_str $(git rev-parse $c:noir/noir-repo) $(cd ../noir && cache_content_hash .rebuild_patterns)) new=$(hash_str $noir $(cache_content_hash .rebuild_patterns ../noir-projects/fnd/noir-protocol-circuits ../barretenberg/cpp/.rebuild_patterns)) echo "$c noir-repo=$(git rev-parse --short $c:noir/noir-repo) old=$old new=$new" done ``` Output on this branch's base: ``` 7d61007^ noir-repo=0ecc97a242e old=d81cb180157f7564 new=011632566d883a46 7d61007 noir-repo=5a7ee9bf5ed old=d81cb180157f7564 new=0f66c61198db6e31 ``` The old formula gives the same hash on both sides of the bump; the new one does not. The same change was also run as a real build: with a different Noir commit checked out in the submodule, `./bootstrap.sh build_verifier` under the old hash restored the previously cached `generated/HonkVerifier.sol`, and under the new hash it missed the cache, copied the current circuits-side verifier and compiled it with forge. With the Noir commit unchanged the new hash is stable and hits the cache. ## Out of scope `noir/bootstrap.sh` reads the Noir commit with `git -C noir-repo rev-parse HEAD`. With the submodule uninitialised that resolves to the superproject HEAD, which is unique per commit and so only causes cache misses. Every Noir consumer shares this behaviour and it is left unchanged. Closes AztecProtocol/aztec-claude#1955 --- *Created by [claudebox](https://claudebox.work/v2/sessions/f45fcb875796a470/jobs/11) · group: `slackbot` · requested by Mike (@iAmMichaelConnor) · [Slack thread](https://aztecfoundation.slack.com/archives/D0B2N7W1WJD/p1790886022336469?thread_ts=1790886022.336469&cid=D0B2N7W1WJD)* (cherry picked from commit f7ee597)
AztecBot
added a commit
that referenced
this pull request
Oct 4, 2026
…e L1 verifier (#25578) ## Problem `generate_vk` in `noir-projects/fnd/noir-protocol-circuits/bootstrap.sh` cached each circuit's VK under `BB_HASH`, the bytecode hash, the circuit name and a hand-bumped `-3`. Two inputs were missing: - **The scheme and circuit kind.** These are chosen by `circuit_kind` from `chonk_circuits.json` and `rollup_honk_circuits.json`, and mapped to `bb write_vk` flags by the script. A change to a manifest or to the flag mapping left the key unchanged, so the shared cache served the VK for the previous scheme. - **The Solidity verifier flags.** For `rollup_root`, the same cache entry also carried `rollup_root_verifier.sol`. A change to the `bb write_solidity_verifier` flags left the key unchanged, so the cache restored the previous verifier. `l1-contracts` then copied that file into `generated/HonkVerifier.sol` and compiled it. Nothing on `next` compares the compiled `HonkVerifier` with its source, so a stale L1 verifier would go unnoticed. ## Fix - **VK cache key.** The key is now `BB_HASH`, bytecode hash, name, the circuit's kind, and the content hash of `bootstrap.sh`. The kind captures what the manifests decide for that circuit. The script hash captures the kind-to-flags mapping. That hash is computed once as `script_hash` and shared with the `compile` key, which already used it; the `compile` key's value is unchanged. The manual `-3` epoch is gone. - **Solidity verifier.** It is no longer stored in the cache. `generate_vk` writes it on every build from the current VK and the current flags, so it cannot be stale. - **Freshness check.** `l1-contracts` `test_cmds` gains one test on every branch: `cmp generated/HonkVerifier.sol` against `target/keys/rollup_root_verifier.sol`. Its test-cache key includes the digest of the source verifier, so it reruns whenever that verifier changes even if the l1-contracts hash does not. ## Suggestions from the issue not taken - **Make `check_pinned_vk` bypass the cache.** With the complete key, a cache hit is a VK computed from the same bb, bytecode, kind and script. Bypassing the cache would regenerate every VK on every pinned build, which removes the benefit of the pin. - **Output-addressed `l1-contracts-verifier` key.** It does not help this path (a stale file has the same digest), and it needs `l1-contracts` hashing to be restructured. The freshness check covers the l1-side cache instead. ## Effects to expect - Every VK cache entry is regenerated once, because the key formula changed. - Any later edit to this `bootstrap.sh` regenerates all VKs. The `compile` key already recompiles all circuits in that case. - `bb write_solidity_verifier` runs once per build for `rollup_root` and `mock_rollup_root`, including on cache hits. It takes under a second. ## Tests On this branch: `bash -n` on both bootstrap scripts, and `scripts/circuit_kind.test.sh` passes (18 of 18). The full build is covered by CI. The same diff was exercised as a real build before this PR was opened, on a checkout where the touched hunks are identical, against the shared build cache with uploads disabled: 1. **Warm and cold paths agree.** `./bootstrap.sh compile rollup-root` (VK from the cache) and `NO_CACHE=1 ./bootstrap.sh generate_vk rollup_root` (VK regenerated) produced identical VK bytes and the same `rollup_root_verifier.sol` (sha256 `a7bf113d…`, 327,282 B). 2. **Verifier-flag change.** With a commit that only drops `--optimized`, the old code hit the VK cache and restored the optimized verifier (`a7bf113d…`). With this change the build wrote `c7f26a79…` (96,610 B), which equals a direct `bb write_solidity_verifier` without `--optimized` on the same VK. 3. **Manifest-only change.** With a commit that only adds `inbox_parity` to `rollup_honk_circuits.json`, the old code kept the same VK cache key and served the VK for the old kind. With this change the key moved and the VK was regenerated with different bytes. 4. **l1 freshness test.** With `generated/HonkVerifier.sol` restored from the l1 cache, the `cmp` test exited 1 (`differ: byte 1, line 1`) when the circuits-side verifier was different and 0 when it matched. Its test-cache key differed between the two cases. Not run: the pinned-build path (`pinned-build.tar.gz` is absent on `next`). ## Related #25577 fixes the separate Noir-commit omission in the `l1-contracts` hash (AztecProtocol/aztec-claude#1955). The two PRs touch different parts of `l1-contracts/bootstrap.sh` and do not depend on each other. Closes AztecProtocol/aztec-claude#2122 --- *Created by [claudebox](https://claudebox.work/v2/sessions/f45fcb875796a470/jobs/11) · group: `slackbot` · requested by Mike (@iAmMichaelConnor) · [Slack thread](https://aztecfoundation.slack.com/archives/D0B2N7W1WJD/p1790886022336469?thread_ts=1790886022.336469&cid=D0B2N7W1WJD)* (cherry picked from commit b0a7559)
IlyasRidhuan
added a commit
that referenced
this pull request
Oct 4, 2026
Rolling integration PR for changes labelled `port-to-v6` on `next`. Each merged source PR is cherry-picked onto `cb/port-to-v6` as its own commit, keeping `(#N)` in the title. ## Ported - [x] [#25536](#25536) fix(kernels): charge the teardown call's AVM startup gas (pick applied without conflicts, plus two `fix(port)` commits) - `fix(port)` 1 drops `labs-patches/0001-fix-pxe-charge-the-teardown-call-s-AVM-startup-gas-i.patch`, which the pick brings along. The labs pin on `v6` (`a0d73c0aed`) already carries that PXE change upstream as aztec-labs-eng/aztec-node#364, so the patch has nothing to apply to. The Noir side is `gas_meter.nr` and `validate_gas_used_tests.nr`, both identical to `next`. - `fix(port)` 2 adds labs patch `0001-test-pin-testnet-compatibility-to-the-v6-kernel-VK-t.patch`, which re-pins the VK tree root in `labs/yarn-project/aztec/src/testnet_compatibility.test.ts`. - [x] [#25576](#25576) fix(p2p): require exact contract class log length in DataTxValidator (labs patch) (clean pick) - Adds labs patch `0010-fix-p2p-require-exact-contract-class-log-length-in-D.patch`. Both files it touches (`data_validator.ts`, `data_validator.test.ts`) have the same pre-image blobs on the `v6` labs pin as on `next`'s. - [x] [#25577](#25577) fix(l1): include the Noir compiler in the l1-contracts cache hash (clean pick) - `noir/bootstrap.sh hash` is what the other Noir consumers on `v6` already use (`avm-transpiler`, `noir-protocol-circuits`, `acir_tests`). - [x] [#25578](#25578) fix(circuits): key the VK cache on its real inputs and never cache the L1 verifier (clean pick) - With #25577 and this one applied, `noir-protocol-circuits/bootstrap.sh` and `scripts/circuit_kind.test.sh` are identical to `next` at b0a7559. - [x] [#25579](#25579) fix(private-kernel): a surviving nullifier link may only resolve to a non-revertible note hash (pick applied without conflicts, plus one `fix(port)` commit) - It changes the `private-kernel-reset-tail-to-public` circuits, so the VK tree root moves again. The `fix(port)` commit updates labs patch 0001 to the new root. - [x] [#23587](#23587) fix: anchor Grumpkin SRS to pinned chunk hashes on load (clean pick) - All eight files end up identical to `next` at 08f90e6, as does the rest of `barretenberg/cpp/src/barretenberg/srs`. No later commit on `next` touches them. - [x] [#25580](#25580) test(private-kernel): reject a duplicate nullifier index hidden behind an inactive squashing hint (clean pick) - Test-only: one test and its import in `validate_transient_data_squashing_hints.nr`. - With #25536, #25579 and this one applied, the `private-kernel-lib` crate is identical to `next` at b1b6871. - [x] [#25530](#25530) chore: move away from auto-close-issues.yml (clean pick) - Deletes `.github/workflows/auto-close-issues.yml` and `scripts/auto_close_issues.py`. Nothing else on `v6` invokes either. - [x] [#25566](#25566) docs(types): document that poseidon2_hash_bytes does not commit the byte length (clean pick) - A doc comment and three unit tests in `types/src/hash.nr`, which ends up identical to `next` at 4f4bef8. - [x] [#25582](#25582) fix: Avoid early proof submission prover griefing (clean pick) - [x] [#25585](#25585) test: cover prover registration upgrade paths (clean pick) - Review follow-up to #25582: forge tests, a test wrapper simplification, and one corrected comment in `RewardLib.sol`. No contract logic changes. - [x] [#25570](#25570) refactor(l1): remove the built-in checkpoint reward overrides (clean pick) - `v6` carries the override stack this removes (#25312, #25426, #25461) and the proof-submission optimizations it keeps (#25404, #25406, #25419). - Nothing outside `l1-contracts` references what it removes (`registryRewardOverrides`, `AZTEC_REGISTRY_REWARD_OVERRIDE_*`, `getRegistryRewardOverrides`, the four `RewardLib__*` errors): no hits in this repo or in the `v6` labs pin `a0d73c0aed`. - [x] [#25571](#25571) feat(l1): pluggable sequencer reward calculator (AZIP-28) (clean pick) - Adds `ISequencerRewardCalculator`, `SequencerRewardCalculatorLib`, the `sequencerRewardCalculator` rollup config field, `setSequencerRewardCalculator` / `getSequencerRewardCalculator`, and the optional `AZTEC_SEQUENCER_REWARD_CALCULATOR` deploy variable (zero address by default). - Nothing in the `v6` labs pin references the calculator. Labs imports `network-defaults.json` directly, where the new key is an added default. - [x] [#25572](#25572) test(l1): reference registry reduction sequencer reward calculator (clean pick) - Test-tree only (`l1-contracts/test/reward-calculators`, a fork test and its fixture), plus the `foundry.toml` read permission for the fixture and regenerated gas reports. - [x] [#25573](#25573) test(l1): reference premium sequencer reward calculator with provenance-tracking ATPs (clean pick) - Test-tree only (`l1-contracts/test/reward-calculators/premium`), plus regenerated gas reports. - With #25577, #25578, #25582, #25585, #25570, #25571, #25572 and this one applied, the whole `l1-contracts` directory is identical to `next` at 551aa41. ## Protocol impact - #25536 and #25579 both change private kernel circuits, so the VK tree root that `v6` builds moves: - from `0x2d89003cc2dc62b06f07d83d3635c66c63fc43668369d30e7ee516f908ee10e3` (the testnet deployed from `v6`) - to `0x05b95d9ef57c61d1c6626545101db55ae2d1f98ecb618d1c220610c049ee522b` (taken from this PR's failing CI run on `34e0b24f`), which is what labs patch 0001 pins - the intermediate root with #25536 alone was `0x21f06c3b82320ea5f80646751cdd9fa023dfd61400a42b8c952aa32e8f155793` (from the failing CI run on `bed8264`) - After this merges, `v6` no longer matches the currently deployed testnet until it is redeployed. The re-pin follows the decision recorded on #25549 (a breaking kernel change ported to `v6` re-pins testnet in the same PR). - The protocol contracts hash and the genesis root are unchanged; those two assertions passed on `34e0b24f`. - #25570 and #25571 change how the L1 rollup pays sequencers: - the per-registry checkpoint reward overrides built into the rollup are gone, along with `RollupConfigInput.registryRewardOverrides`, `getRegistryRewardOverrides` and the `AZTEC_REGISTRY_REWARD_OVERRIDE_*` deploy variables - sequencer reward policy is delegated to an optional governance-set calculator contract; with none configured every proposer gets the default sequencer share - #25572 and #25573 add reference calculators under `l1-contracts/test` only; no calculator ships in `src` or is configured by default - #25582 changes the L1 rollup contracts: `RewardLib` reward handling for early proof submissions, and a new `getHasSubmittedFullEpoch` view on `IRollup` / `Rollup`. - Per #25585, the prover node (`prover-node-publisher.ts` in `aztec-labs-eng/aztec-node`) still skips submission when `getHasSubmitted` is true. It has to use `getHasSubmittedFullEpoch` for full-epoch proofs before the fix helps honest provers; that change is not in this PR or in the `v6` labs pin's patch series. - The L1 changes take effect only on a rollup deployed from this code. - #25536 is a repricing: a public tx with a teardown call is charged 20_000 more L2 gas. The PXE on `v6` already estimates that amount. - #25579 rejects, in tail-to-public only, a nullifier whose note hash link resolves to a revertible note hash. No honest client produces that witness; the private-only tail circuit is unchanged. - #25576 tightens p2p tx validation: a contract class log whose `length` exceeds its trimmed length is now rejected. Honest producers already emit the trimmed length. - #23587 makes bb check a loaded Grumpkin SRS against pinned chunk hashes. It changes the bb binary, not any circuit. - #25580 and #25566 add unit tests (and a doc comment) and change no circuit. - #25530 removes a GitHub workflow: issues referenced by commits pushed to `v6` are no longer closed by the script. - #25577 and #25578 are build-cache only and change no circuit: - the l1-contracts cache key now follows the Noir commit - the VK cache key now covers the circuit kind and the bootstrap script, so every VK is regenerated once - the Solidity verifier is written on every build instead of restored from the cache - l1-contracts gains a test that `generated/HonkVerifier.sol` equals the circuits-side verifier ## Testing - CI3 passed on `fb097a89` (the first eleven ports, through #25585), including the testnet compatibility test against the re-pinned root and the l1-contracts forge tests. - CI3 on `34e0b24f` (the first nine ports, before the second re-pin) ran about 10,400 tests; the only failure was the VK tree root assertion that the second re-pin fixes. - `./labs-patches/bootstrap.sh check`: the series (0001, 0010) applies cleanly to `a0d73c0aed`. Patch 0001 was produced with `bootstrap.sh apply` / `export`. - #25577 / #25578: `bash -n` passes on both bootstrap scripts and `scripts/circuit_kind.test.sh` passes locally. `v6` has no `pinned-build.tar.gz`, so the pinned-build path is not exercised. - No circuits, bb or L1 contracts were built locally (no `nargo`, no bb build and no pinned `solc` in the port environment). The four AZIP-28 ports (#25570 to #25573) have no CI result yet: the forge suite, the labs build against the changed rollup ABI and the deploy-script tests run on this PR's CI. - The branch is based on `v6` at cf7ea33; `v6` has since gained #25551 (a notify workflow change), which merges without conflicts. --- *Created by [claudebox](https://claudebox.work/v2/sessions/134efca9a11ee14f/jobs/7) · group: `slackbot` · [Slack thread](https://aztecprotocol.slack.com/archives/C0AGN2WT3CP/p1790609320989739?thread_ts=1790609320.989739&cid=C0AGN2WT3CP)*
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
l1-contracts/generated/HonkVerifier.solis copied fromnoir-projects/fnd/noir-protocol-circuits/target/keys/rollup_root_verifier.sol, which is produced by compiling the protocol circuits withnargo. Thel1-contracts-verifier-$hashandl1-contracts-ts-$hashartifacts therefore depend on thenoir/noir-repocommit. The l1-contracts cache hash only listed../noir/.rebuild_patterns, which matches^noir/bootstrap.shand not the submodule gitlink. So a Noir-only bump left the hash unchanged and reused the cached verifier and TypeScript artifacts from before the bump.Fix
l1-contracts/bootstrap.shnow builds its hash the same way the other Noir consumers do (avm-transpiler/bootstrap.sh, andNOIR_HASHinnoir-projects/fnd/noir-protocol-circuits/bootstrap.sh):noir/bootstrap.sh hashishash_str <noir-repo commit> <noir rebuild patterns>, so it already coversnoir/bootstrap.sh. The explicit../noir/.rebuild_patternsentry is therefore removed.hash_strpasses adisabled-cachecontent hash through unchanged, so dirty-tree behaviour is the same.Trade-off
l1-contracts uses one hash for
build_src, the verifier, the TS artifacts and its tests. A Noir bump now invalidates all of them, includingl1-contracts-src, which does not depend on the circuits. The same hash already rotates on any change undernoir-protocol-circuits, and Noir bumps are infrequent, so the single hash is kept.Tests
There is no unit-test harness for bootstrap hashes, so this is a reproducible check across 7d61007 ("chore: update Noir to v1.0.0-rc.3"), which changes the
noir/noir-repogitlink plus two files that are not l1-contracts inputs.Run from
l1-contracts:Output on this branch's base:
The old formula gives the same hash on both sides of the bump; the new one does not.
The same change was also run as a real build: with a different Noir commit checked out in the submodule,
./bootstrap.sh build_verifierunder the old hash restored the previously cachedgenerated/HonkVerifier.sol, and under the new hash it missed the cache, copied the current circuits-side verifier and compiled it with forge. With the Noir commit unchanged the new hash is stable and hits the cache.Out of scope
noir/bootstrap.shreads the Noir commit withgit -C noir-repo rev-parse HEAD. With the submodule uninitialised that resolves to the superproject HEAD, which is unique per commit and so only causes cache misses. Every Noir consumer shares this behaviour and it is left unchanged.Closes AztecProtocol/aztec-claude#1955
Created by claudebox · group:
slackbot· requested by Mike (@iAmMichaelConnor) · Slack thread