Skip to content

Commit

Permalink
chore: add rollup_root and rollup_block_merge to tracked protocol…
Browse files Browse the repository at this point in the history
… circuits (noir-lang/noir#6903)

fix: consistent file_id across installation paths (noir-lang/noir#6912)
fix: bigint builtins are foreigns (noir-lang/noir#6892)
fix: remove unnecessary cast in bit-shift (noir-lang/noir#6890)
chore: Release Noir(1.0.0-beta.1) (noir-lang/noir#6622)
chore: Add `Instruction::Noop` (noir-lang/noir#6899)
  • Loading branch information
AztecBot committed Dec 24, 2024
2 parents ac58df9 + 2ec3c4a commit cf8b9ad
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .noir-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
03b58fa2dfcc8acc8cf5198b1b23b55676fbdb02
c8a25b52a484115663cccf614bbebe3ca11778f3
3 changes: 3 additions & 0 deletions noir/noir-repo/.github/workflows/reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ jobs:
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-inner, take_average: true }
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-tail, take_average: true }
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-reset, take_average: true }
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-root }
#- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-block-root }
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-block-merge }
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-private }
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-public }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,7 @@ impl Context<'_> {
let bit_size_var = self.numeric_constant(FieldElement::from(bit_size as u128), u8_type);
let overflow = self.insert_binary(rhs, BinaryOp::Lt, bit_size_var);
let predicate = self.insert_cast(overflow, typ);
// we can safely cast to unsigned because overflow_checks prevent bit-shift with a negative value
let rhs_unsigned = self.insert_cast(rhs, NumericType::unsigned(bit_size));
let pow = self.pow(base, rhs_unsigned);
let pow = self.pow(base, rhs);
let pow = self.insert_cast(pow, typ);
(FieldElement::max_num_bits(), self.insert_binary(predicate, BinaryOp::Mul, pow))
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::rc::Rc;

use acvm::{acir::BlackBoxFunc, AcirField, FieldElement};
use acvm::{AcirField, FieldElement};
use builtin_helpers::{
block_expression_to_value, byte_array_type, check_argument_count,
check_function_not_yet_resolved, check_one_argument, check_three_arguments,
Expand Down Expand Up @@ -236,9 +236,6 @@ impl<'local, 'context> Interpreter<'local, 'context> {
"unresolved_type_is_field" => unresolved_type_is_field(interner, arguments, location),
"unresolved_type_is_unit" => unresolved_type_is_unit(interner, arguments, location),
"zeroed" => zeroed(return_type, location.span),
blackbox if BlackBoxFunc::is_valid_black_box_func_name(blackbox) => {
self.call_foreign(blackbox, arguments, return_type, location)
}
_ => {
let item = format!("Comptime evaluation for builtin function '{name}'");
Err(InterpreterError::Unimplemented { item, location })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ let vec: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 0], 3);
assert_eq(vec.len(), 3);

// Any elements past the given length are zeroed out, so these
// two BoundedVecs will be completely equal
// two vectors will be completely equal
let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 1], 3);
let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 2], 3);
assert_eq(vec1, vec2);
Expand Down Expand Up @@ -433,7 +433,7 @@ let vec: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 0], 3);
let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 1], 3);
let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 2], 3);

// both vecs have length 3 so we'd expect them to be equal, but this
// both vectors have length 3 so we'd expect them to be equal, but this
// fails because elements past the length are still checked in eq
assert(vec1 != vec2);
```
Expand Down
12 changes: 6 additions & 6 deletions noir/noir-repo/noir_stdlib/src/bigint.nr
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ pub struct BigInt {
// docs:end:big_int_definition

impl BigInt {
#[builtin(bigint_add)]
#[foreign(bigint_add)]
fn bigint_add(self, other: BigInt) -> BigInt {}
#[builtin(bigint_sub)]
#[foreign(bigint_sub)]
fn bigint_sub(self, other: BigInt) -> BigInt {}
#[builtin(bigint_mul)]
#[foreign(bigint_mul)]
fn bigint_mul(self, other: BigInt) -> BigInt {}
#[builtin(bigint_div)]
#[foreign(bigint_div)]
fn bigint_div(self, other: BigInt) -> BigInt {}
#[builtin(bigint_from_le_bytes)]
#[foreign(bigint_from_le_bytes)]
fn from_le_bytes(bytes: [u8], modulus: [u8]) -> BigInt {}
#[builtin(bigint_to_le_bytes)]
#[foreign(bigint_to_le_bytes)]
fn to_le_bytes(self) -> [u8; 32] {}

fn check_32_bytes(self: Self, other: BigInt) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion noir/noir-repo/tooling/nargo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ fn insert_all_files_for_package_into_file_manager(
.parent()
.unwrap_or_else(|| panic!("The entry path is expected to be a single file within a directory and so should have a parent {:?}", package.entry_path));

for entry in WalkDir::new(entry_path_parent) {
for entry in WalkDir::new(entry_path_parent).sort_by_file_name() {
let Ok(entry) = entry else {
continue;
};
Expand Down

0 comments on commit cf8b9ad

Please sign in to comment.