Skip to content

chore: Update Noir to nightly-2026-04-09#22393

Open
AztecBot wants to merge 31 commits intonextfrom
bump-noir
Open

chore: Update Noir to nightly-2026-04-09#22393
AztecBot wants to merge 31 commits intonextfrom
bump-noir

Conversation

@AztecBot
Copy link
Copy Markdown
Collaborator

@AztecBot AztecBot commented Apr 8, 2026

Automated update of Noir submodule to latest nightly.

Current: unknown
New: nightly-2026-04-09

View changes in noir-lang/noir

AztecBot and others added 2 commits April 8, 2026 08:24
- Update deps: poseidon 0.3.0, bignum 0.10.0, bigcurve 0.14.0
- Remove `is_infinite` field from Point struct literals, use `is_infinite()` method
- Replace `u1` with `bool` (type removed in new Noir)
- Use `(tmp as u8) % 2 != 0` for lowest-bit extraction (replacing `as u1` truncation)
- Fix `poseidon2_permutation` call sites (now takes 1 arg)
- Fix `== 1` comparisons on AVM oracle fns that now return bool
AztecBot and others added 2 commits April 8, 2026 14:54
## Summary

Fixes the ACIR test build failure introduced by the Noir nightly update
in #22393.

The external `poseidon` library v0.2.4
(`https://github.com/noir-lang/poseidon`) calls
`poseidon2_permutation(self.state, 4)` with 2 arguments, but the current
Noir nightly changed the stdlib signature to accept only 1 argument
(`poseidon2_permutation(input)`). This causes 7 tests to fail
compilation:

- `bench_2_to_17`
- `no_predicates_numeric_generic_poseidon`
- `poseidon_bn254_hash_width_3`
- `poseidonsponge_x5_254`
- `regression_5252`
- `regression_5615`
- `uhashmap`

These tests are already excluded in Noir's own CI
(`POSEIDON_COMPILE_FAILURE_EXECUTION_TESTS` in
`tooling/nargo_cli/build.rs`). This PR mirrors that exclusion in BB's
`acir_tests/bootstrap.sh`.

The exclusions should be removed once the external poseidon library is
updated to be compatible with the new API.

ClaudeBox log: https://claudebox.work/s/0ef46c61b9801d30?run=1
- Bump schnorr library from v0.1.3 to v0.2.0 (v0.1.3 uses the removed
  EmbeddedCurvePoint.is_infinite field)
- Remove is_infinite field from Point struct literal in
  schnorr_hardcoded_account_contract
- Remove is_infinite field from Point struct literals in
  avm_test_contract
…eld usages (#22414)

## Summary

Fixes remaining noir-contracts compilation failures on PR #22393 (Noir
nightly 2026-04-08).

The Noir nightly removed the `is_infinite` field from
`EmbeddedCurvePoint`, making it a 2-field struct `{ x, y }` with
`is_infinite()` as a computed method.

Changes:
- Bump `schnorr` library from v0.1.3 to v0.2.0 in both schnorr account
contracts. v0.1.3 constructs `EmbeddedCurvePoint { x, y, is_infinite }`
which no longer compiles. v0.2.0 (released today) uses the new 2-field
struct.
- Remove `is_infinite: false` from `Point` struct literal in
`schnorr_hardcoded_account_contract`
- Remove `is_infinite: false` from `Point` struct literals in
`avm_test_contract`

ClaudeBox log: https://claudebox.work/s/0ef46c61b9801d30?run=2
@TomAFrench TomAFrench added the claudebox Owned by claudebox. it can push to this PR. label Apr 8, 2026
AztecBot added 4 commits April 8, 2026 14:12
to_le_bits now returns bool elements, so first_bit != 0 is a
Field/bool type mismatch. Use assert(first_bit) instead.
The Noir nightly can emit AssertZero opcodes with only a constant term
(no multiplication or linear terms). Previously, split_into_mul_quad_gates
would assert-fail on these expressions.

Now we handle them by:
- Skipping trivially satisfied constraints (constant == 0)
- Encoding unsatisfiable constraints (constant != 0) as a quad gate
  with witness 0 having zero scaling, so the circuit can be processed
  for VK generation even though it will never verify.
Point::deserialize([1, 2, 3]) now fails because the new Noir nightly
validates the is_infinite flag: Point{x:1, y:2} is not infinite so
is_infinite()=false(0), but the flag was 3, making 0 == 3 an
unconditional failure. Changed to [1, 2, 0] (is_infinite=0).
TomAFrench and others added 3 commits April 8, 2026 15:21
The Noir EmbeddedCurvePoint struct no longer has an is_infinite field;
it is now derived from x == 0 && y == 0.
…removal

EmbeddedCurvePoint is now {x, y} (2 fields) with is_infinite() as a
computed method. The return_data mechanism uses the native struct layout
for field count, so all serialization must use 2 fields per Point.

Changes:
- Point Serialize/Deserialize/Packable impls: 3 fields -> 2 fields
- POINT_LENGTH/POINT_SIZE: 3 -> 2
- KEY_VALIDATION_REQUEST_LENGTH: 4 -> 3
- CONTRACT_INSTANCE_LENGTH: 16 -> 12
- PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH: 870 -> 854
- TS Point.toFields()/fromFields(): 3 fields -> 2 fields
- Removed is_infinite from all Prover.toml files
- Regenerated constants (TS, Solidity, C++, PIL)
@TomAFrench
Copy link
Copy Markdown
Member

Ahhhh, claudebot why are you touching the pil?

@vezenovm vezenovm added claudebox Owned by claudebox. it can push to this PR. and removed claudebox Owned by claudebox. it can push to this PR. labels Apr 8, 2026
@vezenovm
Copy link
Copy Markdown
Contributor

vezenovm commented Apr 8, 2026

Ahhhh, claudebot why are you touching the pil?

It looks like all constants changed are generated by yarn-project/constants/src/scripts/constants.in.ts. 1ed192f changed the POINT_LENGTH from 3 to 2. This then changed derived constants. It looks like all pil/cpp changes are autogenerated. Can someone confirm? cc @dbanks12 @fcarreiro

vezenovm and others added 9 commits April 8, 2026 15:29
EmbeddedCurvePoint changed from (x, y, is_infinite) to (x, y).
PublicKeys now serializes to 8 fields instead of 12.
Updated array sizes, loop bounds, and function signature accordingly.
PublicKeys hash changed because EmbeddedCurvePoint now serializes as
(x, y) instead of (x, y, is_infinite). Updated:
- Contract address fixtures in contracts.nr (regenerated from TS)
- Public keys hash expected values in public_keys.nr and aztec_address.nr
- TS test snapshots for public_keys, derivation, and noir_test_gen
- Fixed Point.fromFields missing isInfinite arg
- Fixed noir_test_gen.test.ts fixture file paths
private-kernel-init and private-kernel-inner Prover.toml files contain
contract addresses computed with the old 3-field EmbeddedCurvePoint hash.
These can only be regenerated via the e2e test (full.test.ts).
Removed them and skipped their nargo execute in bootstrap until regenerated.
Comments were accidentally written outside of comment delimiters,
causing SWC compilation to fail with 'with statement not supported'.
The get_public_keys_and_partial_address oracle returned 13 fields
(4 Points × 3 + 1 partial_address) but now needs 9 fields
(4 Points × 2 + 1 partial_address) after EmbeddedCurvePoint lost
is_infinite.

- Noir oracle declaration: [Field; 13] → [Field; 9]
- Noir oracle parsing: updated indices to be consecutive (no gaps)
- TS PXE oracle handler: padding Array(13) → Array(9)
- TS TXE oracle handler: padding Array(13) → Array(9)
- Noir test mock: removed is_infinite slots, updated indices
@ludamad ludamad changed the title chore: Update Noir to nightly-2026-04-08 chore: Update Noir to nightly-2026-04-09 Apr 9, 2026
AztecBot added 3 commits April 9, 2026 09:03
…issues

- Regenerate private-kernel-init and private-kernel-inner Prover.toml files
  and re-add them to circuits_to_execute in bootstrap.sh
- Fix Point.toBuffer() to serialize infinite points as (0,0) instead of throwing
- Fix getSharedSecret oracle handlers (PXE + TXE) for 2-field points (was 3)
- Fix C++ AVM address derivation to not include is_infinity in public_keys_hash
  (both gadgets/address_derivation.cpp and lib/contract_crypto.cpp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants