Skip to content
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
be5ce23
[1 changes] chore!: bump rust edition to 2024 (https://github.com/noi…
Feb 26, 2025
74c6f0b
chore: apply sync fixes
Feb 26, 2025
e8b08d9
Merge branch 'master' into sync-noir
TomAFrench Feb 26, 2025
b7e7293
.
TomAFrench Feb 26, 2025
1841921
Merge branch 'master' into sync-noir
TomAFrench Feb 26, 2025
707ef49
.
TomAFrench Feb 26, 2025
1160adf
.
TomAFrench Feb 26, 2025
ba9f572
.
TomAFrench Feb 26, 2025
a341795
.
TomAFrench Feb 26, 2025
0306855
Merge branch 'master' into sync-noir
TomAFrench Feb 27, 2025
779ad67
.
TomAFrench Feb 27, 2025
91d89f5
.
TomAFrench Feb 27, 2025
2755348
chore: handle renaming of `wasm32-wasi` target
TomAFrench Feb 27, 2025
4a82243
Merge branch 'master' into sync-noir
guipublic Feb 27, 2025
21cbaf5
Revert "chore: handle renaming of `wasm32-wasi` target"
TomAFrench Feb 28, 2025
0a5e9b9
Revert "."
TomAFrench Feb 28, 2025
b3d4c03
Merge branch 'master' into sync-noir
TomAFrench Feb 28, 2025
9513d07
Revert "."
TomAFrench Feb 28, 2025
9ec3fe4
Merge branch 'master' into sync-noir
TomAFrench Feb 28, 2025
f409670
Merge branch 'master' into sync-noir
TomAFrench Feb 28, 2025
58032a6
Merge branch 'master' into sync-noir
TomAFrench Feb 28, 2025
694e792
Merge branch 'master' into sync-noir
TomAFrench Feb 28, 2025
5cce09e
Merge branch 'master' into sync-noir
TomAFrench Mar 3, 2025
d5dc69c
Merge branch 'master' into sync-noir
TomAFrench Mar 3, 2025
feba8b1
Merge branch 'master' into sync-noir
guipublic Mar 3, 2025
9052fa4
Merge branch 'master' into sync-noir
TomAFrench Mar 3, 2025
26b3c1f
Merge branch 'master' into sync-noir
guipublic Mar 4, 2025
4f7fcd8
temp - debug ci
guipublic Mar 4, 2025
4d51c50
.
TomAFrench Mar 4, 2025
0f23ad0
update to noir master 826b18a
guipublic Mar 4, 2025
7435720
revert debug info
guipublic Mar 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .noir-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
42b4ba3fa2f1dfdb92f197bfbe25884078256ae2
826b18a10630471c19c25ab745f9bfe045813e69
2 changes: 1 addition & 1 deletion avm-transpiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "avm-transpiler"
version = "0.1.0"
authors = ["The Aztec Team <hello@aztecprotocol.com>"]
edition = "2021"
edition = "2024"
license = "MIT OR Apache-2.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
8 changes: 2 additions & 6 deletions avm-transpiler/src/bit_traits.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
use acvm::{acir::brillig::MemoryAddress, AcirField, FieldElement};
use acvm::{AcirField, FieldElement, acir::brillig::MemoryAddress};

fn get_msb(n: u128) -> usize {
if n == 0 {
0
} else {
128 - n.leading_zeros() as usize
}
if n == 0 { 0 } else { 128 - n.leading_zeros() as usize }
}

pub trait BitsQueryable {
Expand Down
2 changes: 1 addition & 1 deletion avm-transpiler/src/procedures/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{
bit_traits::bits_needed_for,
instructions::{AvmInstruction, AvmOperand},
opcodes::AvmOpcode,
utils::{make_operand, make_unresolved_pc, UnresolvedPCLocation},
utils::{UnresolvedPCLocation, make_operand, make_unresolved_pc},
};
use fxhash::FxHashMap as HashMap;
use operand_collector::OperandCollector;
Expand Down
2 changes: 1 addition & 1 deletion avm-transpiler/src/procedures/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use compiler::{compile, CompiledProcedure};
use compiler::{CompiledProcedure, compile};
use msm::MSM_ASSEMBLY;
use parser::parse;

Expand Down
41 changes: 26 additions & 15 deletions avm-transpiler/src/transpile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ use acvm::acir::brillig::{BitSize, IntegerBitSize, Opcode as BrilligOpcode};
use fxhash::{FxHashMap as HashMap, FxHashSet as HashSet};
use std::collections::BTreeMap;

use acvm::FieldElement;
use acvm::acir::circuit::BrilligOpcodeLocation;
use acvm::brillig_vm::brillig::{
BinaryFieldOp, BinaryIntOp, BlackBoxOp, HeapArray, HeapVector, MemoryAddress, ValueOrArray,
};
use acvm::FieldElement;
use noirc_errors::debug_info::DebugInfo;

use crate::bit_traits::{bits_needed_for, BitsQueryable};
use crate::bit_traits::{BitsQueryable, bits_needed_for};
use crate::instructions::{AddressingModeBuilder, AvmInstruction, AvmOperand, AvmTypeTag};
use crate::opcodes::AvmOpcode;
use crate::procedures::{
compile_procedure, Label as ProcedureLocalLabel, Procedure, SCRATCH_SPACE_START,
Label as ProcedureLocalLabel, Procedure, SCRATCH_SPACE_START, compile_procedure,
};
use crate::utils::{
dbg_print_avm_program, dbg_print_brillig_program, make_operand, make_unresolved_pc,
UnresolvedPCLocation, UNRESOLVED_PC,
UNRESOLVED_PC, UnresolvedPCLocation, dbg_print_avm_program, dbg_print_brillig_program,
make_operand, make_unresolved_pc,
};

enum Label {
Expand Down Expand Up @@ -639,18 +639,19 @@ fn handle_note_hash_exists(
inputs: &[ValueOrArray],
) {
let (note_hash_offset_operand, leaf_index_offset_operand) = match inputs {
[
ValueOrArray::MemoryAddress(nh_offset),
ValueOrArray::MemoryAddress(li_offset)
] => (nh_offset, li_offset),
[ValueOrArray::MemoryAddress(nh_offset), ValueOrArray::MemoryAddress(li_offset)] => {
(nh_offset, li_offset)
}
_ => panic!(
"Transpiler expects ForeignCall::NOTEHASHEXISTS to have 2 inputs of type MemoryAddress, got {:?}", inputs
"Transpiler expects ForeignCall::NOTEHASHEXISTS to have 2 inputs of type MemoryAddress, got {:?}",
inputs
),
};
let exists_offset_operand = match destinations {
[ValueOrArray::MemoryAddress(offset)] => offset,
_ => panic!(
"Transpiler expects ForeignCall::NOTEHASHEXISTS to have 1 output of type MemoryAddress, got {:?}", destinations
"Transpiler expects ForeignCall::NOTEHASHEXISTS to have 1 output of type MemoryAddress, got {:?}",
destinations
),
};
avm_instrs.push(AvmInstruction {
Expand Down Expand Up @@ -750,19 +751,29 @@ fn handle_nullifier_exists(
inputs: &[ValueOrArray],
) {
if destinations.len() != 1 || inputs.len() != 2 {
panic!("Transpiler expects ForeignCall::CHECKNULLIFIEREXISTS to have 1 destinations and 2 inputs, got {} and {}", destinations.len(), inputs.len());
panic!(
"Transpiler expects ForeignCall::CHECKNULLIFIEREXISTS to have 1 destinations and 2 inputs, got {} and {}",
destinations.len(),
inputs.len()
);
}
let nullifier_offset_operand = match &inputs[0] {
ValueOrArray::MemoryAddress(offset) => offset,
_ => panic!("Transpiler does not know how to handle ForeignCall::EMITNOTEHASH with HeapArray/Vector inputs"),
_ => panic!(
"Transpiler does not know how to handle ForeignCall::EMITNOTEHASH with HeapArray/Vector inputs"
),
};
let address_offset_operand = match &inputs[1] {
ValueOrArray::MemoryAddress(offset) => offset,
_ => panic!("Transpiler does not know how to handle ForeignCall::EMITNOTEHASH with HeapArray/Vector inputs"),
_ => panic!(
"Transpiler does not know how to handle ForeignCall::EMITNOTEHASH with HeapArray/Vector inputs"
),
};
let exists_offset_operand = match &destinations[0] {
ValueOrArray::MemoryAddress(offset) => offset,
_ => panic!("Transpiler does not know how to handle ForeignCall::EMITNOTEHASH with HeapArray/Vector inputs"),
_ => panic!(
"Transpiler does not know how to handle ForeignCall::EMITNOTEHASH with HeapArray/Vector inputs"
),
};
avm_instrs.push(AvmInstruction {
opcode: AvmOpcode::NULLIFIEREXISTS,
Expand Down
10 changes: 8 additions & 2 deletions avm-transpiler/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,14 @@ pub fn extract_brillig_from_acir_program(
let opcodes = &main_function.opcodes;
assert_eq!(opcodes.len(), 1, "An AVM program should only have a single `BrilligCall`");
match opcodes[0] {
Opcode::BrilligCall { id, .. } => assert_eq!(id, BrilligFunctionId(0), "The ID of the `BrilligCall` must be 0 as we have a single `Brillig` function"),
_ => panic!("Tried to extract a Brillig program from its ACIR wrapper opcode, but the opcode doesn't contain Brillig!"),
Opcode::BrilligCall { id, .. } => assert_eq!(
id,
BrilligFunctionId(0),
"The ID of the `BrilligCall` must be 0 as we have a single `Brillig` function"
),
_ => panic!(
"Tried to extract a Brillig program from its ACIR wrapper opcode, but the opcode doesn't contain Brillig!"
),
}
assert_eq!(
program.unconstrained_functions.len(),
Expand Down
2 changes: 1 addition & 1 deletion noir/noir-repo/.github/benchmark_projects.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define: &AZ_COMMIT 17e79f42c0a1895dc87a74e4155591e38c45f09b
define: &AZ_COMMIT a90f08e245add379fa0257c81f8e2819beb190cb
projects:
private-kernel-inner:
repo: AztecProtocol/aztec-packages
Expand Down
4 changes: 2 additions & 2 deletions noir/noir-repo/.github/scripts/wasm-bindgen-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ cd $(dirname "$0")
./cargo-binstall-install.sh

# Install wasm-bindgen-cli.
if [ "$(wasm-bindgen --version &> /dev/null | cut -d' ' -f2)" != "0.2.86" ]; then
if [ "$(wasm-bindgen --version &> /dev/null | cut -d' ' -f2)" != "0.2.100" ]; then
echo "Building wasm-bindgen..."
cargo binstall wasm-bindgen-cli@0.2.86 --force --no-confirm
cargo binstall wasm-bindgen-cli@0.2.100 --force --no-confirm
fi

2 changes: 1 addition & 1 deletion noir/noir-repo/.github/workflows/docs-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Install wasm-bindgen-cli
uses: taiki-e/install-action@v2
with:
tool: wasm-bindgen-cli@0.2.86
tool: wasm-bindgen-cli@0.2.100

- name: Install wasm-opt
run: |
Expand Down
4 changes: 2 additions & 2 deletions noir/noir-repo/.github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
- name: Install wasm-bindgen-cli
uses: taiki-e/install-action@v2
with:
tool: wasm-bindgen-cli@0.2.86
tool: wasm-bindgen-cli@0.2.100

- name: Install wasm-opt
run: |
npm i wasm-opt -g

- name: Query active docs versions
run: yarn workspace docs version::stables

Expand Down
16 changes: 8 additions & 8 deletions noir/noir-repo/.github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ jobs:
node-version: 18.19.0
cache: 'yarn'
cache-dependency-path: 'yarn.lock'

- name: Update yarn.lock
run: yarn

- name: Configure git
run: |
git config user.name noirwhal
Expand All @@ -61,13 +61,13 @@ jobs:
git add .
git commit -m 'chore: Update root workspace acvm versions and lockfile'
git push

update-docs:
name: Update docs
needs: [release-please, update-acvm-workspace-package-versions]
if: ${{ needs.release-please.outputs.release-pr }}
runs-on: ubuntu-22.04

steps:
- name: Checkout release branch
uses: actions/checkout@v4
Expand All @@ -81,7 +81,7 @@ jobs:
- name: Install wasm-bindgen-cli
uses: taiki-e/install-action@v2
with:
tool: wasm-bindgen-cli@0.2.86
tool: wasm-bindgen-cli@0.2.100

- name: Install wasm-opt
run: |
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
runs-on: ubuntu-22.04
# We want this job to always run (even if the dependant jobs fail) as we need apply changes to the sticky comment.
if: ${{ always() }}

needs:
- release-please
- update-acvm-workspace-package-versions
Expand All @@ -123,7 +123,7 @@ jobs:
# We treat any skipped or failing jobs as a failure for the workflow as a whole.
FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}

steps:
steps:
- name: Add warning to sticky comment
uses: marocchino/sticky-pull-request-comment@v2
with:
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
needs: [release-please]
if: ${{ needs.release-please.outputs.tag-name }}
runs-on: ubuntu-22.04

steps:
- name: Dispatch to publish-acvm
uses: benc-uk/workflow-dispatch@v1
Expand Down
Loading
Loading