Skip to content

chore: backport noirfmt.toml + nargo fmt (#22971) to v4-next#22977

Merged
benesjan merged 3 commits into
backport-to-v4-next-stagingfrom
claudebox/backport-22971-noirfmt
May 6, 2026
Merged

chore: backport noirfmt.toml + nargo fmt (#22971) to v4-next#22977
benesjan merged 3 commits into
backport-to-v4-next-stagingfrom
claudebox/backport-22971-noirfmt

Conversation

@AztecBot
Copy link
Copy Markdown
Collaborator

@AztecBot AztecBot commented May 6, 2026

Backport of #22971 to backport-to-v4-next-staging.

Auto cherry-pick failed on 5 files due to v4-next semantic drift from merge-train/fairies. Resolved manually using the 3-commit backport pattern.

Conflicts resolved

File Resolution
nft_contract/src/types/nft_note.nr keep v4-next (no compute_note_hash direct usage)
protocol/auth_registry_contract/src/main.nr keep v4-next (expanded-macro form)
protocol/contract_class_registry_contract/src/validate_bytecode.nr keep v4-next (PR base has additional tests not yet here)
test/note_hash_and_nullifier/.../test_note.nr keep v4-next (uses poseidon2_hash_with_separator directly)
test/test_log_contract/src/test/tx_effects.nr keep deleted (already removed on v4-next)

The PR is fmt-only, so wherever v4-next has different content, that content is preserved and nargo fmt is re-run with the new noirfmt.toml so the result is internally consistent.

Commits (preserved per backport rules)

  1. chore: add noirfmt.toml to noir-contracts and run nargo fmt (cherry-pick #22971) — cherry-pick AS-IS with conflict markers (does not compile by design)
  2. fix: resolve cherry-pick conflicts by keeping v4-next-staging content
  3. chore: re-run nargo fmt with new noirfmt.toml config

Verification

  • nargo fmt --check clean in noir-projects/noir-contracts/
  • 117 files changed (matches PR scope: noirfmt.toml + 116 .nr files)
  • No conflict markers, .rej, or .orig files remain

Detailed analysis: https://gist.github.com/AztecBot/dabe6018f40af2369cec56de821510f3

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

AztecBot and others added 3 commits May 6, 2026 06:51
…ick #22971)

Cherry-pick of PR #22971 onto v4-next-staging. This commit preserves
conflict markers on 4 files where v4-next has drifted from the PR base:
- nft_contract/src/types/nft_note.nr
- protocol/auth_registry_contract/src/main.nr
- protocol/contract_class_registry_contract/src/validate_bytecode.nr
- note_hash_and_nullifier/.../test_note.nr

Resolution and any necessary fmt re-runs follow in subsequent commits.
The 4 conflicted files have semantically different code on v4-next-staging
than the PR base (merge-train/fairies):
- nft_note.nr: v4-next does not yet use compute_note_hash directly
- auth_registry/main.nr: v4-next has expanded macros (oracle/avm/...)
- validate_bytecode.nr: v4-next is missing later test additions
- note_hash_and_nullifier test_note.nr: same compute_note_hash difference

Drops PR fmt changes for these 4 files; nargo fmt will be re-run in the
next commit to produce consistent formatting against v4-next content.
Apply nargo fmt to the 4 files that retained v4-next-staging content
during conflict resolution, plus auth_registry_interface/main.nr which
benefits from the new max_width=120 setting.
@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels May 6, 2026
@benesjan benesjan marked this pull request as ready for review May 6, 2026 07:19
@benesjan benesjan merged commit 713ada3 into backport-to-v4-next-staging May 6, 2026
27 of 32 checks passed
@benesjan benesjan deleted the claudebox/backport-22971-noirfmt branch May 6, 2026 07:29
benesjan added a commit that referenced this pull request May 7, 2026
This PR accumulates backport commits and will be auto-merged overnight.

Backports included:
- #22977 - chore: backport noirfmt.toml + nargo fmt (#22971) to v4-next
- #22958 - chore: backport pxe db schema compatibility test (#22872) to
v4-next

> Created manually because the auto-cherry-pick step failed for both
source PRs (#22971, #22872) due to conflicts; the manual fix-up PRs
bypassed the script that normally opens this PR.

🤖 This PR is normally managed automatically by the backport workflow.
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. 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