Skip to content

chore: replace u1 type with bool across noir-projects#22377

Draft
AztecBot wants to merge 1 commit intonextfrom
claudebox/u1-to-bool-migration
Draft

chore: replace u1 type with bool across noir-projects#22377
AztecBot wants to merge 1 commit intonextfrom
claudebox/u1-to-bool-migration

Conversation

@AztecBot
Copy link
Copy Markdown
Collaborator

@AztecBot AztecBot commented Apr 7, 2026

Summary

Replaces all uses of the u1 type with bool across noir-projects, in preparation for noir-lang/noir#11753 which removes u1 from user-facing Noir.

Changes

Type replacements

  • [u1; N][bool; N] (bit arrays from to_le_bits/to_be_bits)
  • -> u1-> bool (function return types, especially AVM oracles)
  • (x as u1) != 0x != 0 (field-to-boolean extraction)

Removed duplicate trait impls

Since bool already had FromField, ToField, Empty, Serialize, and Deserialize impls, the former u1 impls (now duplicates after renaming) were removed entirely:

  • traits/from_field.nr — removed duplicate impl FromField for bool
  • traits/to_field.nr — removed duplicate impl ToField for bool
  • traits/empty.nr — removed duplicate impl Empty for bool
  • serde/type_impls.nr — removed duplicate impl Serialize for bool and impl Deserialize for bool, plus unused U1_SERIALIZED_LEN constant

Files changed (17)

  • aztec-nr/aztec/src/oracle/avm.nr — oracle return types
  • aztec-nr/aztec/src/state_vars/mod.nr — doc comments
  • noir-contracts/.../card_game_contract/src/game.nr — field extraction
  • noir-contracts/.../orderbook_contract/src/order.nr — field extraction
  • noir-contracts/.../aztec_sublib/src/oracle/avm.nr — oracle return types
  • noir-contracts/.../avm_test_contract/src/main.nr — bit array types
  • noir-protocol-circuits/crates/blob/... — bit arrays
  • noir-protocol-circuits/crates/serde/... — removed u1 trait impls
  • noir-protocol-circuits/crates/types/... — bit arrays, trait impls, field utils

ClaudeBox log: https://claudebox.work/s/d72e1449fb744a16?run=9

@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels Apr 7, 2026
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.

1 participant