Skip to content

feat(ci): Snapshots for aztec-nr contract compilation failures and nargo expand#23061

Merged
vezenovm merged 7 commits into
merge-train/fairiesfrom
mv/cargo-insta-snaps
May 8, 2026
Merged

feat(ci): Snapshots for aztec-nr contract compilation failures and nargo expand#23061
vezenovm merged 7 commits into
merge-train/fairiesfrom
mv/cargo-insta-snaps

Conversation

@vezenovm
Copy link
Copy Markdown
Contributor

@vezenovm vezenovm commented May 7, 2026

Resolves F-607

Don't be scared by the diff size, the majority of the diff are new snapshots.

  • Deleted noir-projects/noir-contracts-comp-failures/ crate. We now have noir-projects/contract-snapshots/
  • nargo expand tests cover Token, AMM, StorageProofTest, AvmTest, AvmGadgetsTest to match the CI benchmarks
  • compile_failure snapshots are now full stderr (not just error: headlines)

Asserting the full stderr and expand output provide us a strong test invariant on the current compiler behavior. Some of the expanded snapshots are quite large, and that is why I ultimately chose to only have snapshots for the benchmark contracts. For compilation failures, I felt it would be better to have the full snapshot in all cases. We then assert against the actual compiler behavior rather than some stripped version of the stderr.

A great example of how these snapshots are useful can be seen in the child PR #23062.

Copy link
Copy Markdown
Contributor

@nchamo nchamo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

Just one small question

Comment thread noir-projects/contract-snapshots/.gitignore Outdated
@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcargo/​insta@​1.47.29310093100100

View full report

@vezenovm vezenovm enabled auto-merge (squash) May 8, 2026 14:39
@vezenovm vezenovm merged commit f3911a8 into merge-train/fairies May 8, 2026
14 checks passed
@vezenovm vezenovm deleted the mv/cargo-insta-snaps branch May 8, 2026 14:56
@AztecBot
Copy link
Copy Markdown
Collaborator

AztecBot commented May 8, 2026

❌ Failed to cherry-pick to v4-next due to conflicts. (🤖) View backport run.

vezenovm added a commit that referenced this pull request May 8, 2026
…failures and nargo expand (#23061) (#23104)

Backport of #23061 to v4-next.

## Conflicts

The automatic cherry-pick failed with 3 rename/delete conflicts (no text
markers):

-
`noir-projects/contract-snapshots/test_programs/compile_failure/invalid_event/src/invalid_event.nr`
— renamed by #23061, deleted on v4-next-staging. Kept the renamed copy.
- `noir-projects/noir-contracts-comp-failures/bootstrap.sh` — deleted by
#23061, modified on v4-next-staging. Took #23061's deletion (the entire
`noir-contracts-comp-failures/` crate is gone).
-
`noir-projects/noir-contracts-comp-failures/contracts/authorization_selector_collision/expected_error`
— same as above.

## Commits

1. `feat(ci): cherry-pick #23061 (with conflicts)` — raw cherry-pick
result with the two stray files (`bootstrap.sh`, `expected_error`)
preserved as-is so reviewers can see what conflicted.
2. `fix: resolve cherry-pick conflicts` — removes those two stray files
in line with #23061's intent (the whole old crate is dropped).

## Verification

`cargo build --tests`, `cargo fmt --check`, and `cargo clippy
--all-targets` all pass for the new `noir-projects/contract-snapshots/`
crate. The compile_failure snapshots and `nargo expand` outputs are
exercised against the live Noir compiler in CI; any drift will surface
there.

ClaudeBox log: https://claudebox.work/s/9ae41fb6fbae7191?run=2
AztecBot added a commit that referenced this pull request May 9, 2026
BEGIN_COMMIT_OVERRIDE
fix(aztec-up): Aztec installer does not shadow user installed binaries
on PATH (#22902)
fix: include sqlite binary in its npm package (#23039)
chore: backport #23041 (add sendMessagesAs to wallet api schemas) to
v4-next (#23081)
chore: backport DeployMethod refactor (#22985) to v4-next (#23029)
refactor(pxe): deduplicate tx hash lookups in MessageContextService
(#23075)
refactor(pxe): batch tagged private log queries across all secrets
(#23048)
refactor(pxe): batch log RPC calls in LogService.fetchLogsByTag (#23088)
feat(aztec-nr): Initial handshake registry contract with non interactive
handshake function (#22854)
fix: add Tag.random() helper required by backported #23088 tests
(#23094)
chore: backport: fix(aztec-up): installer does not shadow user binaries
on PATH (#22902) (#23060)
chore: backport handshake registry contract (#22854) to v4-next (#23063)
feat: deploy method refactor 2 (#23033)
refactor(pxe): skip redundant getBlock RPC when querying at anchor block
(#23100)
port(v4-next): feat(docs): autogenerate node JSON-RPC API reference
(#22543) (#23046)
chore: backport feat: deploy method refactor 2 (#23033) to v4-next
(#23103)
port(v4-next): feat(ci): Snapshots for aztec-nr contract compilation
failures and nargo expand (#23061) (#23104)
feat(txe): allow authorizing cross-contract utility calls in nr tests
(#23064)
END_COMMIT_OVERRIDE
github-merge-queue Bot pushed a commit that referenced this pull request May 10, 2026
BEGIN_COMMIT_OVERRIDE
fix: include sqlite binary in its npm package (#23039)
fix: add sendMessagesAs to wallet api schemas (#23041)
refactor(pxe): deduplicate tx hash lookups in MessageContextService
(#23075)
refactor(pxe): batch tagged private log queries across all secrets
(#23048)
refactor(pxe): batch log RPC calls in LogService.fetchLogsByTag (#23088)
feat(pxe,nr): flesh out account stubs and don't exclude syncing for
overrides (#23054)
feat: deploy method refactor 2 (#23033)
feat: fastForwardContractUpdate cheatcode for simulating contract
updates (#22905)
refactor(stdlib): consolidate find-function-by-selector helpers (#23008)
feat(ci): Snapshots for aztec-nr contract compilation failures and nargo
expand (#23061)
chore: kv store test fully on vitest (#23096)
refactor(pxe): skip redundant getBlock RPC when querying at anchor block
(#23100)
chore(playground): bump main chunk size limit 1750 → 1800 KB (#23107)
feat(txe): allow authorizing cross-contract utility calls in nr tests
(#23064)
chore: bench public fns with emit repro (#23105)
END_COMMIT_OVERRIDE
vezenovm added a commit that referenced this pull request May 11, 2026
…yte code size blow up (#23062)

Resolves
[F-637](https://linear.app/aztec-labs/issue/F-637/aztec-nr-macros-contain-self-construction-to-a-function-to-prevent)

Stacks on #23061

- New `generate_public_self_creator` emits a per-contract
`__aztec_nr_internals__create_public_self<let N: u32>()` helper
- `generate_public_external` now emits a single call to it instead of
inlining the preamble. This can be seen in the snapshots.
- Helper is emitted from `process_functions` and gated on
`public_functions.len() > 0`

~~Improvements tested locally:~~

I need to test further. Either way this is cleaner macro code.
vezenovm added a commit that referenced this pull request May 11, 2026
…yte code size blow up (#23062)

Resolves
[F-637](https://linear.app/aztec-labs/issue/F-637/aztec-nr-macros-contain-self-construction-to-a-function-to-prevent)

Stacks on #23061

- New `generate_public_self_creator` emits a per-contract
`__aztec_nr_internals__create_public_self<let N: u32>()` helper
- `generate_public_external` now emits a single call to it instead of
inlining the preamble. This can be seen in the snapshots.
- Helper is emitted from `process_functions` and gated on
`public_functions.len() > 0`

~~Improvements tested locally:~~

I need to test further. Either way this is cleaner macro code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants