Releases: noir-lang/noir
Releases · noir-lang/noir
v0.36.0
0.36.0 (2024-10-22)
⚠ BREAKING CHANGES
- remove pedersen commitment (AztecProtocol/aztec-packages#9107)
- remove pedersen hash opcode (AztecProtocol/aztec-packages#9245)
- Brillig and AVM default all uninitialized memory cells to Field 0 (AztecProtocol/aztec-packages#9057)
- remove keccak256 opcode from ACIR/Brillig (AztecProtocol/aztec-packages#9104)
- Brillig with a stack and conditional inlining (AztecProtocol/aztec-packages#8989)
- avm: remove CMOV opcode (AztecProtocol/aztec-packages#9030)
- Integer division is not the inverse of integer multiplication (#6243)
- kind size checks (#6137)
- Change tag attributes to require a ' prefix (#6235)
Features
- Add
checked_transmute
(#6262) (2618061) - Add more
Type
andUnresolvedType
methods (#5994) (8236cbd) - Allow
unconstrained
after visibility (#6246) (f6dfbcf) - Brillig and AVM default all uninitialized memory cells to Field 0 (AztecProtocol/aztec-packages#9057) (70dcf4a)
- Brillig with a stack and conditional inlining (AztecProtocol/aztec-packages#8989) (70dcf4a)
- Don't crash LSP when there are errors resolving the workspace (#6257) (7cc7197)
- Don't suggest private struct fields in LSP (#6256) (2a727b3)
- Handwritten parser (#6180) (c4273a0)
- improve: Remove scan through globals (#6282) (fd91913)
- Inclusive for loop (#6200) (bd861f2)
- Integrate databus in the private kernels (AztecProtocol/aztec-packages#9028) (70dcf4a)
- interpreter: Comptime derive generators (#6303) (d8767b3)
- Kind size checks (#6137) (6e40f62)
- New formatter (#6300) (62404d7)
- Optimize
Quoted::as_expr
by parsing just once (#6237) (a4fcd00) - Optimize reading a workspace's files (#6281) (b54ed26)
- perf: Flamegraphs for test program execution benchmarks (#6253) (c186791)
- perf: Follow array sets backwards in array set from get optimization (#6208) (999071b)
- Recover from '=' instead of ':' in struct constructor/pattern (#6236) (9a12f31)
- Remove byte decomposition in
compute_decomposition
(#6159) (a8bcae2) - Show LSP diagnostic related information (#6277) (c8a91a5)
- Slightly improve "unexpected token" error message (#6279) (8232bfa)
- Sync from noir (AztecProtocol/aztec-packages#8934) (70dcf4a)
- Sync from noir (AztecProtocol/aztec-packages#9034) (70dcf4a)
- Sync from noir (AztecProtocol/aztec-packages#9099) (70dcf4a)
- Sync from noir (AztecProtocol/aztec-packages#9275) (70dcf4a)
- test: Fuzz poseidon hases against an external library (#6273) (8d8ea89)
- test: Fuzz test poseidon2 hash equivalence (#6265) (f61ba03)
- test: Fuzz test stdlib hash functions (#6233) (1a2ca46)
- test: Include the PoseidonHasher in the fuzzing (#6280) (afb8a7c)
- Trait inheritance (#6252) (d3301a4)
- Visibility for impl functions (#6179) (1b26440)
- Visibility for struct fields (#6221) (fc1c7ab)
- Warn about private types leaking in public functions and struct fields (#6296) (67ac0d6)
Bug Fixes
- Add missing visibility for auto-import names (#6205) (c3cb38a)
- Address inactive public key check in
verify_signature_noir
(#6270) (e4325aa) - Allow array map on empty arrays (#6305) (51ae1b3)
- Change tag attributes to require a ' prefix (#6235) (b43dcb2)
- Check for Schnorr null signature (#6226) (2430920)
- Display function name and body when inlining recursion limit hit (#6291) (33a1e7d)
- Do not warn on unused self in traits (#6298) (4d524bf)
- Don't warn on unuse global if it has an abi annotation (#6258) (e13f617)
- Don't warn on unused struct that has an abi annotation (#6254) (8a31632)
- Don't warn twice when referring to private item (#6216) (619c545)
- Enforce correctness of decompositions performed at compile time (#6278) (53252fd)
- frontend: Do not warn when a nes...
nightly-2024-10-24: feat: merge and sort imports (#6322)
# Description ## Problem Manually arranging imports is time consuming. ## Summary Added two new configurations, `reorder_imports` (true by default) and `imports_granularity` (`Preserve` by default), similar to the ones found in rustfmt. With the default configuration imports are reorganized alphabetically but not merged. While implementing this I bumped into one code in the test programs like this: ```noir use foo; use foo::bar; ``` Merging those in Rust ends up like this: ```noir use foo::{bar, self}; ``` We don't have `self` in imports, so I had two choices: 1. Try to leave the above unmodified. 2. Implement `self` in imports. It turned out that implement `self` in imports is very easy: when we desugar imports, if the last segment is "self" we just remove it. Then `use foo::self` is desugared into `use foo`. ## Additional Context None. ## Documentation Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist - [x] I have tested the changes locally. - [x] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings. --------- Co-authored-by: Tom French <[email protected]>
nightly-2024-10-23: chore: remove usage of slices in pedersen hash (#6295)
# Description ## Problem\* Resolves <!-- Link to GitHub Issue --> ## Summary\* This PR reworks the pedersen hash implementation to work on arrays as this removes some brillig overhead. ## Additional Context ## Documentation\* Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [x] I have tested the changes locally. - [x] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
nightly-2024-10-22: fix: Allow array map on empty arrays (#6305)
# Description ## Problem\* Resolves a private issue sent to me on slack ## Summary\* Array map is a fairly old method written before we had `std::mem::zeroed`. Now that we have zeroed, we can allow mapping empty arrays since we can use `zeroed` to get the filler `U` value for the starting elements. ## Additional Context While I was at it I included a small clarification to `reduce`'s docs that it requires a non-empty array ## Documentation\* Check one: - [ ] No documentation needed. - [x] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [x] I have tested the changes locally. - [x] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
nightly-2024-10-21
feat: Warn about private types leaking in public functions and struct…
nightly-2024-10-20
feat: Warn about private types leaking in public functions and struct…
nightly-2024-10-19: fix: Do not warn on unused self in traits (#6298)
# Description ## Problem\* Resolves #6297 ## Summary\* Sets `warn_if_unused` to `false` for the `self` parameter of a function if it's for a trait implementation. ## Additional Context ## Documentation\* Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [x] I have tested the changes locally. - [ ] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
nightly-2024-10-18: fix: Reject invalid expression with in CLI parser (#6287)
Pre-release
# Description ## Problem\* Resolves #5560 ## Summary\* Rejects an invalid `--expression-value` in the CLI, which would later cause a panic in `acvm::compiler::transformers::csat`. An example error message looks like: ```text error: invalid value '1' for '--expression-width <EXPRESSION_WIDTH>': minimum value is 3 ``` ## Additional Context The issue suggests that [CSatTransformer::new](https://github.com/noir-lang/noir/blob/ae87d287ab1fae0f999dfd0d1166fbddb927ba97/acvm-repo/acvm/src/compiler/transformers/csat.rs#L24-L27) should return a `Result` explaining the problem it has with `width`, rather than doing an `assert!` (without any message) and crashing the program. I agree, however looking at the chain of calls, none of the half-dozen functions we go through to reach this use `Result`, and the `CSatTransformer` is the only option we have. This suggests to me that this limitation is perhaps supposed to be well-known to the user, ie. it's not the case that one transformer has X limit and another has Y limit. For this reason I added a `pub const MIN_EXPRESSION_WIDTH: usize = 3;` to the `acvm::compiler` module and using that as a common value for the assertion as well as the validation in the CLI. Should the assumption of a single global value change, removing that will force us to update the validation logic as well. That said if you prefer going the `Result` route I'm not against it, it just seemed like an overkill for this single use case. ## Documentation\* Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [x] I have tested the changes locally. - [ ] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
nightly-2024-10-17: chore: regression test for #5462 (#6286)
# Description ## Problem\* Regression test for github.com/noir-lang/noir/issues/5462 ## Summary\* - Added the test from [5462](github.com/noir-lang/noir/issues/5462) - Updated the issue needed to re-enable the `array_regex` execution test ## Additional Context ## Documentation\* Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [x] I have tested the changes locally. - [x] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
nightly-2024-10-16: chore: regression test for #5462 (#6286)
# Description ## Problem\* Regression test for github.com/noir-lang/noir/issues/5462 ## Summary\* - Added the test from [5462](github.com/noir-lang/noir/issues/5462) - Updated the issue needed to re-enable the `array_regex` execution test ## Additional Context ## Documentation\* Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [x] I have tested the changes locally. - [x] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.