Skip to content

refactor: unify contract compilation pipeline via bb aztec_process (backport #22590)#22634

Merged
benesjan merged 4 commits intobackport-to-v4-next-stagingfrom
claudebox/backport-22590-v4-next
Apr 17, 2026
Merged

refactor: unify contract compilation pipeline via bb aztec_process (backport #22590)#22634
benesjan merged 4 commits intobackport-to-v4-next-stagingfrom
claudebox/backport-22590-v4-next

Conversation

@AztecBot
Copy link
Copy Markdown
Collaborator

Backport of #22590 to v4-next.

Original PR summary

Moves __aztec_nr_internals__ prefix stripping into bb aztec_process (C++), so contract compilation collapses from four steps (nargo compiletranspilestrip prefixeswrite_vk) to two (nargo compilebb aztec_process). This removes the duplicated pipeline between noir-projects/noir-contracts/bootstrap.sh and aztec compile (CLI), deletes strip_aztec_nr_prefix.sh, and removes the TypeScript stripInternalPrefixes() helper.

Backport structure (3 commits)

  1. chore: cherry-pick PR #22590 (conflicts unresolved) — raw git cherry-pick output with conflict markers, preserved for review.
  2. fix: resolve cherry-pick conflicts for PR #22590 — resolves only the conflict markers.
  3. No build-fix commit was needed — bash syntax, grep for dangling references, and the already-present prefix-stripping logic in aztec_process.cpp all check out.

Conflicts resolved

  • noir-projects/noir-contracts/bootstrap.sh — content conflict. v4-next still had the legacy process_function block plus tmp_dir / jq / parallel plumbing for VK generation. Accepted the incoming PR's removal since bb aztec_process now handles VK generation directly.
  • noir-projects/protocol-fuzzer/SANDBOX_INSTRUCTIONS.md and noir-projects/protocol-fuzzer/setup-nightly-sandbox.sh — modify/delete. These files were introduced on next after v4-next diverged (commit 5b0c0e166e, "feat(fuzz): protocol fuzzer with bridge server and parallel batching") and never existed on v4-next. PR refactor: unify contract compilation pipeline via bb aztec_process #22590 only touched them to stay consistent with that later work, so they're dropped here.

Diff vs. original PR

Original PR This backport
Files 10 8
Insertions 42 38
Deletions 160 142

The size delta is entirely from the two protocol-fuzzer files that don't exist on v4-next.

Verification

  • bash -n on all modified shell scripts: OK
  • No dangling references to strip_aztec_nr_prefix, STRIP_AZTEC_NR_PREFIX, stripInternalPrefixes, or the removed protocol-fuzzer files anywhere in the tree
  • __aztec_nr_internals__ prefix-stripping logic is present in barretenberg/cpp/src/barretenberg/api/aztec_process.cpp (applied cleanly from the PR)

ClaudeBox log: https://claudebox.work/s/0347afb057f4542d?run=1

benesjan and others added 2 commits April 17, 2026 10:19
This commit records the raw output of git cherry-pick 9c8bb7b for PR #22590
(refactor: unify contract compilation pipeline via bb aztec_process).

Conflicts left intact in this commit:
- noir-projects/noir-contracts/bootstrap.sh — content conflict
- noir-projects/protocol-fuzzer/SANDBOX_INSTRUCTIONS.md — modify/delete (deleted in HEAD)
- noir-projects/protocol-fuzzer/setup-nightly-sandbox.sh — modify/delete (deleted in HEAD)

Subsequent commits resolve the conflicts and fix the build.
- noir-contracts/bootstrap.sh: accept incoming removal of the legacy
  process_function VK-generation block. 'bb aztec_process' now handles
  VK generation directly, so the tmp_dir / jq / parallel plumbing that
  was still present on v4-next is no longer needed.
- protocol-fuzzer/SANDBOX_INSTRUCTIONS.md and
  protocol-fuzzer/setup-nightly-sandbox.sh: drop. These files were
  introduced in a commit that landed on next after v4-next diverged,
  so they never existed on v4-next. PR #22590 only touched them to
  stay consistent with that later work; since v4-next doesn't have
  them, keep them absent.
@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels Apr 17, 2026
@benesjan benesjan added the ci-full Run all master checks. label Apr 17, 2026
@benesjan benesjan marked this pull request as ready for review April 17, 2026 11:04
@benesjan benesjan requested a review from a team as a code owner April 17, 2026 11:04
PR #22590 removed 'mkdir -p $tmp_dir' from bootstrap.sh's build function.
On next that's fine because next's bootstrap.sh has no pinned-contracts
logic. v4-next however still extracts pinned-protocol-contracts.tar.gz
right after 'rm -rf target', so without the implicit target/ creation
the tar step fails with:

  tar: target: Cannot open: No such file or directory

Add an explicit 'mkdir -p target' after the rm -rf to restore the
v4-next build.
@benesjan benesjan merged commit bb75dd9 into backport-to-v4-next-staging Apr 17, 2026
9 checks passed
@benesjan benesjan deleted the claudebox/backport-22590-v4-next branch April 17, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. ci-full Run all master checks. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants