From 876603e9e397b336e2895b56399f68fcd9636632 Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Mon, 15 Jan 2024 15:49:20 +0000 Subject: [PATCH] chore: sync Noir repo (#4020) subrepo: subdir: "noir" merged: "e7da1ab13" upstream: origin: "https://github.com/noir-lang/noir" branch: "aztec-packages" commit: "e7da1ab13" git-subrepo: version: "0.4.6" origin: "https://github.com/ingydotnet/git-subrepo" commit: "110b9eb" --- noir/.github/workflows/publish-nargo.yml | 20 -- noir/.github/workflows/test-js-packages.yml | 5 + noir/.gitrepo | 4 +- noir/Dockerfile.ci | 1 - noir/acvm-repo/acvm/tests/solver.rs | 74 +--- .../src/curve_specific_solver.rs | 104 ++++++ noir/acvm-repo/blackbox_solver/src/lib.rs | 47 +-- noir/aztec_macros/src/lib.rs | 37 ++ .../src/ssa/acir_gen/acir_ir/acir_variable.rs | 79 +--- .../noirc_frontend/src/hir/def_map/mod.rs | 9 +- .../noirc_frontend/src/node_interner.rs | 10 +- .../compiler/noirc_frontend/src/parser/mod.rs | 3 +- noir/compiler/noirc_frontend/src/tests.rs | 44 +++ noir/docs/package.json | 2 +- noir/noir_stdlib/src/uint128.nr | 16 +- noir/package.json | 1 - noir/release-tests/package.json | 14 - noir/release-tests/test/6_array.test.js | 49 --- noir/release-tests/test/utils/nargo.js | 3 - noir/release-tests/test/utils/zx.js | 11 - noir/release-tests/test/version.test.js | 35 -- noir/tooling/debugger/src/context.rs | 68 +--- .../lsp/src/requests/goto_definition.rs | 6 +- noir/tooling/lsp/src/requests/mod.rs | 8 +- noir/tooling/lsp/src/solver.rs | 60 ---- .../tooling/noir_js/src/witness_generation.ts | 25 +- noir/yarn.lock | 336 +----------------- 27 files changed, 285 insertions(+), 786 deletions(-) create mode 100644 noir/acvm-repo/blackbox_solver/src/curve_specific_solver.rs delete mode 100644 noir/release-tests/package.json delete mode 100644 noir/release-tests/test/6_array.test.js delete mode 100644 noir/release-tests/test/utils/nargo.js delete mode 100644 noir/release-tests/test/utils/zx.js delete mode 100644 noir/release-tests/test/version.test.js diff --git a/noir/.github/workflows/publish-nargo.yml b/noir/.github/workflows/publish-nargo.yml index 3bcc9a13570..fc089008657 100644 --- a/noir/.github/workflows/publish-nargo.yml +++ b/noir/.github/workflows/publish-nargo.yml @@ -73,16 +73,6 @@ jobs: path: ./dist/* retention-days: 3 - - name: Install Yarn dependencies - if: matrix.target == 'x86_64-apple-darwin' - uses: ./.github/actions/setup - - - name: Test built artifact - if: matrix.target == 'x86_64-apple-darwin' - run: | - cp ./target/${{ matrix.target }}/release/nargo ~/.cargo/bin/ - yarn workspace release-tests test - - name: Upload binaries to release tag uses: svenstaro/upload-release-action@v2 if: ${{ inputs.publish || github.event_name == 'schedule' }} @@ -161,16 +151,6 @@ jobs: path: ./dist/* retention-days: 3 - - name: Install Yarn dependencies - if: startsWith(matrix.target, 'x86_64-unknown-linux') - uses: ./.github/actions/setup - - - name: Test built artifact - if: startsWith(matrix.target, 'x86_64-unknown-linux') - run: | - cp ./target/${{ matrix.target }}/release/nargo ~/.cargo/bin/ - yarn workspace release-tests test - - name: Upload binaries to release tag uses: svenstaro/upload-release-action@v2 if: ${{ inputs.publish }} diff --git a/noir/.github/workflows/test-js-packages.yml b/noir/.github/workflows/test-js-packages.yml index addc9ce3d83..7f8c5df3139 100644 --- a/noir/.github/workflows/test-js-packages.yml +++ b/noir/.github/workflows/test-js-packages.yml @@ -70,6 +70,11 @@ jobs: name: noirc_abi_wasm path: ./tooling/noirc_abi_wasm + - name: Install wasm-pack + uses: taiki-e/install-action@v2 + with: + tool: wasm-pack@0.12.1 + - name: Install Yarn dependencies uses: ./.github/actions/setup diff --git a/noir/.gitrepo b/noir/.gitrepo index 5a0dfe602ea..a58b1731901 100644 --- a/noir/.gitrepo +++ b/noir/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/noir-lang/noir branch = aztec-packages - commit = 563c7041fd95f22fe76dc4dee75188fc4b3d8381 - parent = 605e3e82a6adb4aeffe8b35cb27c7018f3c9bbac + commit = 7f22446f3940f8ef7ccae785a4b29835f2e869fe + parent = 468998824f1b1e2f4f8a929ba970f3599bf34ab0 method = merge cmdver = 0.4.6 diff --git a/noir/Dockerfile.ci b/noir/Dockerfile.ci index 57dcbe9cfee..a73ce4ab969 100644 --- a/noir/Dockerfile.ci +++ b/noir/Dockerfile.ci @@ -25,7 +25,6 @@ COPY ./tooling/noir_js_backend_barretenberg/package.json ./tooling/noir_js_backe COPY ./tooling/noir_js/package.json ./tooling/noir_js/ COPY ./tooling/noir_codegen/package.json ./tooling/noir_codegen/ COPY ./compiler/integration-tests/package.json ./compiler/integration-tests/ -COPY ./release-tests/package.json ./release-tests/ COPY ./docs/package.json ./docs/ RUN yarn --immutable COPY . . diff --git a/noir/acvm-repo/acvm/tests/solver.rs b/noir/acvm-repo/acvm/tests/solver.rs index a592aaad14f..4a4b75df146 100644 --- a/noir/acvm-repo/acvm/tests/solver.rs +++ b/noir/acvm-repo/acvm/tests/solver.rs @@ -11,64 +11,8 @@ use acir::{ FieldElement, }; -use acvm::{ - pwg::{ACVMStatus, ErrorLocation, ForeignCallWaitInfo, OpcodeResolutionError, ACVM}, - BlackBoxFunctionSolver, -}; -use acvm_blackbox_solver::BlackBoxResolutionError; - -pub(crate) struct StubbedBackend; - -impl BlackBoxFunctionSolver for StubbedBackend { - fn schnorr_verify( - &self, - _public_key_x: &FieldElement, - _public_key_y: &FieldElement, - _signature: &[u8], - _message: &[u8], - ) -> Result { - panic!("Path not trodden by this test") - } - fn pedersen_commitment( - &self, - _inputs: &[FieldElement], - _domain_separator: u32, - ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { - panic!("Path not trodden by this test") - } - fn pedersen_hash( - &self, - _inputs: &[FieldElement], - _domain_separator: u32, - ) -> Result { - panic!("Path not trodden by this test") - } - fn fixed_base_scalar_mul( - &self, - _low: &FieldElement, - _high: &FieldElement, - ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { - panic!("Path not trodden by this test") - } - - fn ec_add( - &self, - _input1_x: &FieldElement, - _input1_y: &FieldElement, - _input2_x: &FieldElement, - _input2_y: &FieldElement, - ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { - panic!("Path not trodden by this test") - } - - fn ec_double( - &self, - _input_x: &FieldElement, - _input_y: &FieldElement, - ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { - panic!("Path not trodden by this test") - } -} +use acvm::pwg::{ACVMStatus, ErrorLocation, ForeignCallWaitInfo, OpcodeResolutionError, ACVM}; +use acvm_blackbox_solver::StubbedBlackBoxSolver; // Reenable these test cases once we move the brillig implementation of inversion down into the acvm stdlib. @@ -153,7 +97,7 @@ fn inversion_brillig_oracle_equivalence() { ]) .into(); - let mut acvm = ACVM::new(&StubbedBackend, &opcodes, witness_assignments); + let mut acvm = ACVM::new(&StubbedBlackBoxSolver, &opcodes, witness_assignments); // use the partial witness generation solver with our acir program let solver_status = acvm.solve(); @@ -282,7 +226,7 @@ fn double_inversion_brillig_oracle() { ]) .into(); - let mut acvm = ACVM::new(&StubbedBackend, &opcodes, witness_assignments); + let mut acvm = ACVM::new(&StubbedBlackBoxSolver, &opcodes, witness_assignments); // use the partial witness generation solver with our acir program let solver_status = acvm.solve(); @@ -403,7 +347,7 @@ fn oracle_dependent_execution() { let witness_assignments = BTreeMap::from([(w_x, FieldElement::from(2u128)), (w_y, FieldElement::from(2u128))]).into(); - let mut acvm = ACVM::new(&StubbedBackend, &opcodes, witness_assignments); + let mut acvm = ACVM::new(&StubbedBlackBoxSolver, &opcodes, witness_assignments); // use the partial witness generation solver with our acir program let solver_status = acvm.solve(); @@ -502,7 +446,7 @@ fn brillig_oracle_predicate() { ]) .into(); - let mut acvm = ACVM::new(&StubbedBackend, &opcodes, witness_assignments); + let mut acvm = ACVM::new(&StubbedBlackBoxSolver, &opcodes, witness_assignments); let solver_status = acvm.solve(); assert_eq!(solver_status, ACVMStatus::Solved, "should be fully solved"); @@ -535,7 +479,7 @@ fn unsatisfied_opcode_resolved() { values.insert(d, FieldElement::from(2_i128)); let opcodes = vec![Opcode::AssertZero(opcode_a)]; - let mut acvm = ACVM::new(&StubbedBackend, &opcodes, values); + let mut acvm = ACVM::new(&StubbedBlackBoxSolver, &opcodes, values); let solver_status = acvm.solve(); assert_eq!( solver_status, @@ -615,7 +559,7 @@ fn unsatisfied_opcode_resolved_brillig() { let opcodes = vec![brillig_opcode, Opcode::AssertZero(opcode_a)]; - let mut acvm = ACVM::new(&StubbedBackend, &opcodes, values); + let mut acvm = ACVM::new(&StubbedBlackBoxSolver, &opcodes, values); let solver_status = acvm.solve(); assert_eq!( solver_status, @@ -659,7 +603,7 @@ fn memory_operations() { let opcodes = vec![init, read_op, expression]; - let mut acvm = ACVM::new(&StubbedBackend, &opcodes, initial_witness); + let mut acvm = ACVM::new(&StubbedBlackBoxSolver, &opcodes, initial_witness); let solver_status = acvm.solve(); assert_eq!(solver_status, ACVMStatus::Solved); let witness_map = acvm.finalize(); diff --git a/noir/acvm-repo/blackbox_solver/src/curve_specific_solver.rs b/noir/acvm-repo/blackbox_solver/src/curve_specific_solver.rs new file mode 100644 index 00000000000..82941e91d61 --- /dev/null +++ b/noir/acvm-repo/blackbox_solver/src/curve_specific_solver.rs @@ -0,0 +1,104 @@ +use acir::{BlackBoxFunc, FieldElement}; + +use crate::BlackBoxResolutionError; + +/// This component will generate outputs for Blackbox function calls where the underlying [`acir::BlackBoxFunc`] +/// doesn't have a canonical Rust implementation. +/// +/// Returns an [`BlackBoxResolutionError`] if the backend does not support the given [`acir::BlackBoxFunc`]. +pub trait BlackBoxFunctionSolver { + fn schnorr_verify( + &self, + public_key_x: &FieldElement, + public_key_y: &FieldElement, + signature: &[u8], + message: &[u8], + ) -> Result; + fn pedersen_commitment( + &self, + inputs: &[FieldElement], + domain_separator: u32, + ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError>; + fn pedersen_hash( + &self, + inputs: &[FieldElement], + domain_separator: u32, + ) -> Result; + fn fixed_base_scalar_mul( + &self, + low: &FieldElement, + high: &FieldElement, + ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError>; + fn ec_add( + &self, + input1_x: &FieldElement, + input1_y: &FieldElement, + input2_x: &FieldElement, + input2_y: &FieldElement, + ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError>; + fn ec_double( + &self, + input_x: &FieldElement, + input_x: &FieldElement, + ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError>; +} + +pub struct StubbedBlackBoxSolver; + +impl StubbedBlackBoxSolver { + fn fail(black_box_function: BlackBoxFunc) -> BlackBoxResolutionError { + BlackBoxResolutionError::Failed( + black_box_function, + format!("{} is not supported", black_box_function.name()), + ) + } +} + +impl BlackBoxFunctionSolver for StubbedBlackBoxSolver { + fn schnorr_verify( + &self, + _public_key_x: &FieldElement, + _public_key_y: &FieldElement, + _signature: &[u8], + _message: &[u8], + ) -> Result { + Err(Self::fail(BlackBoxFunc::SchnorrVerify)) + } + fn pedersen_commitment( + &self, + _inputs: &[FieldElement], + _domain_separator: u32, + ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { + Err(Self::fail(BlackBoxFunc::PedersenCommitment)) + } + fn pedersen_hash( + &self, + _inputs: &[FieldElement], + _domain_separator: u32, + ) -> Result { + Err(Self::fail(BlackBoxFunc::PedersenHash)) + } + fn fixed_base_scalar_mul( + &self, + _low: &FieldElement, + _high: &FieldElement, + ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { + Err(Self::fail(BlackBoxFunc::FixedBaseScalarMul)) + } + fn ec_add( + &self, + _input1_x: &FieldElement, + _input1_y: &FieldElement, + _input2_x: &FieldElement, + _input2_y: &FieldElement, + ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { + Err(Self::fail(BlackBoxFunc::EmbeddedCurveAdd)) + } + fn ec_double( + &self, + _input_x: &FieldElement, + _input_y: &FieldElement, + ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { + Err(Self::fail(BlackBoxFunc::EmbeddedCurveDouble)) + } +} diff --git a/noir/acvm-repo/blackbox_solver/src/lib.rs b/noir/acvm-repo/blackbox_solver/src/lib.rs index e11b9316fdd..afba4eff17c 100644 --- a/noir/acvm-repo/blackbox_solver/src/lib.rs +++ b/noir/acvm-repo/blackbox_solver/src/lib.rs @@ -7,60 +7,23 @@ //! For functions that are backend-dependent, it provides a Trait [BlackBoxFunctionSolver] that must be implemented by the backend. //! For functions that have a reference implementation, such as [keccak256], this crate exports the reference implementation directly. -use acir::{BlackBoxFunc, FieldElement}; +use acir::BlackBoxFunc; use blake2::digest::generic_array::GenericArray; use blake2::{Blake2s256, Digest}; use sha2::Sha256; use sha3::Keccak256; use thiserror::Error; +mod curve_specific_solver; + +pub use curve_specific_solver::{BlackBoxFunctionSolver, StubbedBlackBoxSolver}; + #[derive(Clone, PartialEq, Eq, Debug, Error)] pub enum BlackBoxResolutionError { #[error("failed to solve blackbox function: {0}, reason: {1}")] Failed(BlackBoxFunc, String), } -/// This component will generate outputs for Blackbox function calls where the underlying [`acir::BlackBoxFunc`] -/// doesn't have a canonical Rust implementation. -/// -/// Returns an [`BlackBoxResolutionError`] if the backend does not support the given [`acir::BlackBoxFunc`]. -pub trait BlackBoxFunctionSolver { - fn schnorr_verify( - &self, - public_key_x: &FieldElement, - public_key_y: &FieldElement, - signature: &[u8], - message: &[u8], - ) -> Result; - fn pedersen_commitment( - &self, - inputs: &[FieldElement], - domain_separator: u32, - ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError>; - fn pedersen_hash( - &self, - inputs: &[FieldElement], - domain_separator: u32, - ) -> Result; - fn fixed_base_scalar_mul( - &self, - low: &FieldElement, - high: &FieldElement, - ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError>; - fn ec_add( - &self, - input1_x: &FieldElement, - input1_y: &FieldElement, - input2_x: &FieldElement, - input2_y: &FieldElement, - ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError>; - fn ec_double( - &self, - input_x: &FieldElement, - input_x: &FieldElement, - ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError>; -} - pub fn sha256(inputs: &[u8]) -> Result<[u8; 32], BlackBoxResolutionError> { generic_hash_256::(inputs) .map_err(|err| BlackBoxResolutionError::Failed(BlackBoxFunc::SHA256, err)) diff --git a/noir/aztec_macros/src/lib.rs b/noir/aztec_macros/src/lib.rs index 5ac48a8e8e4..c985bbc367a 100644 --- a/noir/aztec_macros/src/lib.rs +++ b/noir/aztec_macros/src/lib.rs @@ -31,10 +31,15 @@ impl MacroProcessor for AztecMacro { } } +const FUNCTION_TREE_HEIGHT: u32 = 5; +const MAX_CONTRACT_FUNCTIONS: usize = 2_usize.pow(FUNCTION_TREE_HEIGHT); + #[derive(Debug, Clone)] pub enum AztecMacroError { AztecNotFound, AztecComputeNoteHashAndNullifierNotFound { span: Span }, + AztecContractHasTooManyFunctions { span: Span }, + AztecContractConstructorMissing { span: Span }, } impl From for MacroError { @@ -50,6 +55,16 @@ impl From for MacroError { secondary_message: None, span: Some(span), }, + AztecMacroError::AztecContractHasTooManyFunctions { span } => MacroError { + primary_message: format!("Contract can only have a maximum of {} functions", MAX_CONTRACT_FUNCTIONS), + secondary_message: None, + span: Some(span), + }, + AztecMacroError::AztecContractConstructorMissing { span } => MacroError { + primary_message: "Contract must have a constructor function".to_owned(), + secondary_message: None, + span: Some(span), + }, } } } @@ -340,6 +355,28 @@ fn transform_module( has_transformed_module = true; } } + + if has_transformed_module { + // We only want to run these checks if the macro processor has found the module to be an Aztec contract. + + if module.functions.len() > MAX_CONTRACT_FUNCTIONS { + let crate_graph = &context.crate_graph[crate_id]; + return Err(( + AztecMacroError::AztecContractHasTooManyFunctions { span: Span::default() }.into(), + crate_graph.root_file_id, + )); + } + + let constructor_defined = module.functions.iter().any(|func| func.name() == "constructor"); + if !constructor_defined { + let crate_graph = &context.crate_graph[crate_id]; + return Err(( + AztecMacroError::AztecContractConstructorMissing { span: Span::default() }.into(), + crate_graph.root_file_id, + )); + } + } + Ok(has_transformed_module) } diff --git a/noir/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/acir_variable.rs b/noir/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/acir_variable.rs index ceca49cd749..cf7c6151110 100644 --- a/noir/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/acir_variable.rs +++ b/noir/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/acir_variable.rs @@ -9,6 +9,7 @@ use crate::ssa::ir::{instruction::Endian, types::NumericType}; use acvm::acir::circuit::brillig::{BrilligInputs, BrilligOutputs}; use acvm::acir::circuit::opcodes::{BlockId, MemOp}; use acvm::acir::circuit::Opcode; +use acvm::blackbox_solver; use acvm::brillig_vm::{brillig::Value, Registers, VMStatus, VM}; use acvm::{ acir::{ @@ -19,7 +20,6 @@ use acvm::{ }, FieldElement, }; -use acvm::{BlackBoxFunctionSolver, BlackBoxResolutionError}; use fxhash::FxHashMap as HashMap; use iter_extended::{try_vecmap, vecmap}; use num_bigint::BigUint; @@ -1711,75 +1711,6 @@ fn execute_brillig( code: &[BrilligOpcode], inputs: &[BrilligInputs], ) -> Option<(Registers, Vec)> { - struct NullBbSolver; - - impl BlackBoxFunctionSolver for NullBbSolver { - fn schnorr_verify( - &self, - _public_key_x: &FieldElement, - _public_key_y: &FieldElement, - _signature: &[u8], - _message: &[u8], - ) -> Result { - Err(BlackBoxResolutionError::Failed( - BlackBoxFunc::SchnorrVerify, - "SchnorrVerify is not supported".to_string(), - )) - } - fn pedersen_commitment( - &self, - _inputs: &[FieldElement], - _domain_separator: u32, - ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { - Err(BlackBoxResolutionError::Failed( - BlackBoxFunc::PedersenCommitment, - "PedersenCommitment is not supported".to_string(), - )) - } - fn pedersen_hash( - &self, - _inputs: &[FieldElement], - _domain_separator: u32, - ) -> Result { - Err(BlackBoxResolutionError::Failed( - BlackBoxFunc::PedersenHash, - "PedersenHash is not supported".to_string(), - )) - } - fn fixed_base_scalar_mul( - &self, - _low: &FieldElement, - _high: &FieldElement, - ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { - Err(BlackBoxResolutionError::Failed( - BlackBoxFunc::FixedBaseScalarMul, - "FixedBaseScalarMul is not supported".to_string(), - )) - } - fn ec_add( - &self, - _input1_x: &FieldElement, - _input1_y: &FieldElement, - _input2_x: &FieldElement, - _input2_y: &FieldElement, - ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { - Err(BlackBoxResolutionError::Failed( - BlackBoxFunc::EmbeddedCurveAdd, - "EcAdd is not supported".to_string(), - )) - } - fn ec_double( - &self, - _input_x: &FieldElement, - _input_y: &FieldElement, - ) -> Result<(FieldElement, FieldElement), BlackBoxResolutionError> { - Err(BlackBoxResolutionError::Failed( - BlackBoxFunc::EmbeddedCurveDouble, - "EcDouble is not supported".to_string(), - )) - } - } - // Set input values let mut input_register_values: Vec = Vec::with_capacity(inputs.len()); let mut input_memory: Vec = Vec::new(); @@ -1805,7 +1736,13 @@ fn execute_brillig( // Instantiate a Brillig VM given the solved input registers and memory, along with the Brillig bytecode. let input_registers = Registers::load(input_register_values); - let mut vm = VM::new(input_registers, input_memory, code, Vec::new(), &NullBbSolver); + let mut vm = VM::new( + input_registers, + input_memory, + code, + Vec::new(), + &blackbox_solver::StubbedBlackBoxSolver, + ); // Run the Brillig VM on these inputs, bytecode, etc! let vm_status = vm.process_opcodes(); diff --git a/noir/compiler/noirc_frontend/src/hir/def_map/mod.rs b/noir/compiler/noirc_frontend/src/hir/def_map/mod.rs index fbf94468c4b..e86d4efede7 100644 --- a/noir/compiler/noirc_frontend/src/hir/def_map/mod.rs +++ b/noir/compiler/noirc_frontend/src/hir/def_map/mod.rs @@ -91,14 +91,15 @@ impl CrateDefMap { let mut ast = ast.into_sorted(); for macro_processor in ¯o_processors { - ast = match macro_processor.process_untyped_ast(ast, &crate_id, context) { - Ok(ast) => ast, + match macro_processor.process_untyped_ast(ast.clone(), &crate_id, context) { + Ok(processed_ast) => { + ast = processed_ast; + } Err((error, file_id)) => { let def_error = DefCollectorErrorKind::MacroError(error); errors.push((def_error.into(), file_id)); - return errors; } - }; + } } // Allocate a default Module for the root, giving it a ModuleId diff --git a/noir/compiler/noirc_frontend/src/node_interner.rs b/noir/compiler/noirc_frontend/src/node_interner.rs index 6ad9a82dbf6..4c4bb6804bc 100644 --- a/noir/compiler/noirc_frontend/src/node_interner.rs +++ b/noir/compiler/noirc_frontend/src/node_interner.rs @@ -1179,12 +1179,12 @@ impl NodeInterner { method_name: &str, force_type_check: bool, ) -> Option { - let methods = self.struct_methods.get(&(id, method_name.to_owned()))?; + let methods = self.struct_methods.get(&(id, method_name.to_owned())); // If there is only one method, just return it immediately. // It will still be typechecked later. if !force_type_check { - if let Some(method) = methods.get_unambiguous() { + if let Some(method) = methods.and_then(|m| m.get_unambiguous()) { return Some(method); } } @@ -1196,10 +1196,10 @@ impl NodeInterner { fn find_matching_method( &self, typ: &Type, - methods: &Methods, + methods: Option<&Methods>, method_name: &str, ) -> Option { - if let Some(method) = methods.find_matching_method(typ, self) { + if let Some(method) = methods.and_then(|m| m.find_matching_method(typ, self)) { Some(method) } else { // Failed to find a match for the type in question, switch to looking at impls @@ -1214,7 +1214,7 @@ impl NodeInterner { pub fn lookup_primitive_method(&self, typ: &Type, method_name: &str) -> Option { let key = get_type_method_key(typ)?; let methods = self.primitive_methods.get(&(key, method_name.to_owned()))?; - self.find_matching_method(typ, methods, method_name) + self.find_matching_method(typ, Some(methods), method_name) } pub fn lookup_primitive_trait_method_mut( diff --git a/noir/compiler/noirc_frontend/src/parser/mod.rs b/noir/compiler/noirc_frontend/src/parser/mod.rs index a6c631895cd..0ff7819c00f 100644 --- a/noir/compiler/noirc_frontend/src/parser/mod.rs +++ b/noir/compiler/noirc_frontend/src/parser/mod.rs @@ -208,7 +208,7 @@ fn force<'a, T: 'a>(parser: impl NoirParser + 'a) -> impl NoirParser, pub functions: Vec, @@ -344,6 +344,7 @@ impl std::fmt::Display for SortedSubModule { } } +#[derive(Clone)] pub struct SortedSubModule { pub name: Ident, pub contents: SortedModule, diff --git a/noir/compiler/noirc_frontend/src/tests.rs b/noir/compiler/noirc_frontend/src/tests.rs index 063e0215a30..10684f76169 100644 --- a/noir/compiler/noirc_frontend/src/tests.rs +++ b/noir/compiler/noirc_frontend/src/tests.rs @@ -89,6 +89,50 @@ mod test { get_program(src).2 } + #[test] + fn check_trait_implemented_for_all_t() { + let src = " + trait Default { + fn default() -> Self; + } + + trait Eq { + fn eq(self, other: Self) -> bool; + } + + trait IsDefault { + fn is_default(self) -> bool; + } + + impl IsDefault for T where T: Default + Eq { + fn is_default(self) -> bool { + self.eq(T::default()) + } + } + + struct Foo { + a: u64, + } + + impl Eq for Foo { + fn eq(self, other: Foo) -> bool { self.a == other.a } + } + + impl Default for Foo { + fn default() -> Self { + Foo { a: Default::default() } + } + } + + fn main(a: Foo) -> pub bool { + a.is_default() + }"; + + let errors = get_program_errors(src); + errors.iter().for_each(|err| println!("{:?}", err)); + assert!(errors.is_empty()); + } + #[test] fn check_trait_implementation_duplicate_method() { let src = " diff --git a/noir/docs/package.json b/noir/docs/package.json index 1fa4ab79b85..c53ce58f727 100644 --- a/noir/docs/package.json +++ b/noir/docs/package.json @@ -16,7 +16,7 @@ "@noir-lang/noir_js": "workspace:*", "@noir-lang/noirc_abi": "workspace:*", "@noir-lang/types": "workspace:*", - "@signorecello/noir_playground": "^0.6.0", + "@signorecello/noir_playground": "^0.7.0", "axios": "^1.4.0", "clsx": "^1.2.1", "hast-util-is-element": "^1.1.0", diff --git a/noir/noir_stdlib/src/uint128.nr b/noir/noir_stdlib/src/uint128.nr index 4a58b3868be..03f3e9ab074 100644 --- a/noir/noir_stdlib/src/uint128.nr +++ b/noir/noir_stdlib/src/uint128.nr @@ -116,6 +116,8 @@ impl U128 { pub fn from_integer(i: T) -> U128 { let f = crate::as_field(i); + // Reject values which would overflow a u128 + f.assert_max_bit_size(128); let lo = f as u64 as Field; let hi = (f-lo) / pow64; U128 { @@ -146,7 +148,7 @@ impl U128 { } impl Add for U128 { - pub fn add(self: Self, b: U128) -> U128 { + fn add(self: Self, b: U128) -> U128 { let low = self.lo + b.lo; let lo = low as u64 as Field; let carry = (low - lo) / pow64; @@ -161,7 +163,7 @@ impl Add for U128 { } impl Sub for U128 { - pub fn sub(self: Self, b: U128) -> U128 { + fn sub(self: Self, b: U128) -> U128 { let low = pow64 + self.lo - b.lo; let lo = low as u64 as Field; let borrow = (low == lo) as Field; @@ -176,7 +178,7 @@ impl Sub for U128 { } impl Mul for U128 { - pub fn mul(self: Self, b: U128) -> U128 { + fn mul(self: Self, b: U128) -> U128 { assert(self.hi*b.hi == 0, "attempt to multiply with overflow"); let low = self.lo*b.lo; let lo = low as u64 as Field; @@ -196,7 +198,7 @@ impl Mul for U128 { } impl Div for U128 { - pub fn div(self: Self, b: U128) -> U128 { + fn div(self: Self, b: U128) -> U128 { let (q,r) = self.unconstrained_div(b); let a = b * q + r; assert_eq(self, a); @@ -206,7 +208,7 @@ impl Div for U128 { } impl Rem for U128 { - pub fn rem(self: Self, b: U128) -> U128 { + fn rem(self: Self, b: U128) -> U128 { let (q,r) = self.unconstrained_div(b); let a = b * q + r; assert_eq(self, a); @@ -216,7 +218,7 @@ impl Rem for U128 { } impl Eq for U128 { - pub fn eq(self: Self, b: U128) -> bool { + fn eq(self: Self, b: U128) -> bool { (self.lo == b.lo) & (self.hi == b.hi) } } @@ -289,4 +291,4 @@ impl Shr for U128 { } self / U128::from_integer(y) } -} \ No newline at end of file +} diff --git a/noir/package.json b/noir/package.json index 789ba9dec55..e70189b5522 100644 --- a/noir/package.json +++ b/noir/package.json @@ -10,7 +10,6 @@ "tooling/noir_codegen", "tooling/noir_js_backend_barretenberg", "acvm-repo/acvm_js", - "release-tests", "docs" ], "scripts": { diff --git a/noir/release-tests/package.json b/noir/release-tests/package.json deleted file mode 100644 index 3b73ad18574..00000000000 --- a/noir/release-tests/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "release-tests", - "main": "index.js", - "license": "(MIT OR Apache-2.0)", - "private": true, - "type": "module", - "scripts": { - "test": "uvu test" - }, - "devDependencies": { - "uvu": "0.5.6", - "zx": "7.1.1" - } -} diff --git a/noir/release-tests/test/6_array.test.js b/noir/release-tests/test/6_array.test.js deleted file mode 100644 index 43d4a389264..00000000000 --- a/noir/release-tests/test/6_array.test.js +++ /dev/null @@ -1,49 +0,0 @@ -import { suite } from "uvu"; -import { cd } from "zx"; -import { NARGO_BIN } from "./utils/nargo.js"; -import "./utils/zx.js"; - -const test = suite("nargo"); - -// Helps detect unresolved ProcessPromise. -let promiseResolved = false; -process.on("exit", () => { - if (!promiseResolved) { - console.error("Error: ProcessPromise never resolved."); - process.exitCode = 1; - } -}); - -test("promise resolved", async () => { - await $`echo PromiseHelper`; - promiseResolved = true; -}); - -test("nargo builds ../test_programs/execution_success/6_array sucessfully", async () => { - await within(async () => { - cd("../test_programs/execution_success/6_array"); - const command = `${NARGO_BIN} check`; - - await $`${command}`.nothrow(); - }); -}); - -test("nargo creates proof ../test_programs/execution_success/6_array sucessfully", async () => { - await within(async () => { - cd("../test_programs/execution_success/6_array"); - const command = `${NARGO_BIN} prove 6_array`; - - await $`${command}`.nothrow(); - }); -}); - -test("nargo verifies proof ../test_programs/execution_success/6_array sucessfully", async () => { - await within(async () => { - cd("../test_programs/execution_success/6_array"); - const command = `${NARGO_BIN} verify 6_array`; - - await $`${command}`.nothrow(); - }); -}); - -test.run(); diff --git a/noir/release-tests/test/utils/nargo.js b/noir/release-tests/test/utils/nargo.js deleted file mode 100644 index 6fcaccbcde7..00000000000 --- a/noir/release-tests/test/utils/nargo.js +++ /dev/null @@ -1,3 +0,0 @@ -import { default as path } from "path"; - -export const NARGO_BIN = process.env.NARGO_BIN ? path.resolve(process.env.NARGO_BIN) : "nargo"; diff --git a/noir/release-tests/test/utils/zx.js b/noir/release-tests/test/utils/zx.js deleted file mode 100644 index a8ab500aec0..00000000000 --- a/noir/release-tests/test/utils/zx.js +++ /dev/null @@ -1,11 +0,0 @@ -import "zx/globals"; - -// We perform any common setup for zx here to avoid repetition across test files. - -if (process.platform == "win32") { - $.shell = "powershell"; -} - -$.quote = (arg) => arg; - -$.verbose = true; diff --git a/noir/release-tests/test/version.test.js b/noir/release-tests/test/version.test.js deleted file mode 100644 index 7a70639d83e..00000000000 --- a/noir/release-tests/test/version.test.js +++ /dev/null @@ -1,35 +0,0 @@ -import { suite } from "uvu"; -import * as assert from "uvu/assert"; -import { NARGO_BIN } from "./utils/nargo.js"; -import "./utils/zx.js"; - -const test = suite("nargo"); - -// Helps detect unresolved ProcessPromise. -let promiseResolved = false; -process.on("exit", () => { - if (!promiseResolved) { - console.error("Error: ProcessPromise never resolved."); - process.exitCode = 1; - } -}); - -test("promise resolved", async () => { - await $`echo PromiseHelper`; - promiseResolved = true; -}); - -test("prints version", async () => { - const processOutput = (await $`${NARGO_BIN} --version`).toString(); - - // Regex to match the "nargo version" part of the output - assert.match(processOutput, /nargo version = \d{1,2}\.\d{1,2}\.\d{1,2}/); -}); - - -test("reports a clean commit", async () => { - const processOutput = (await $`${NARGO_BIN} --version`).toString(); - assert.not.match(processOutput, /is dirty: true/) -}); - -test.run(); diff --git a/noir/tooling/debugger/src/context.rs b/noir/tooling/debugger/src/context.rs index 8f6520864db..12b55708b15 100644 --- a/noir/tooling/debugger/src/context.rs +++ b/noir/tooling/debugger/src/context.rs @@ -440,6 +440,7 @@ mod tests { }, native_types::Expression, }, + blackbox_solver::StubbedBlackBoxSolver, brillig_vm::brillig::{ BinaryFieldOp, Opcode as BrilligOpcode, RegisterIndex, RegisterOrMemory, }, @@ -447,70 +448,12 @@ mod tests { use nargo::{artifacts::debug::DebugArtifact, ops::DefaultForeignCallExecutor}; use std::collections::BTreeMap; - struct StubbedSolver; - - impl BlackBoxFunctionSolver for StubbedSolver { - fn schnorr_verify( - &self, - _public_key_x: &FieldElement, - _public_key_y: &FieldElement, - _signature: &[u8], - _message: &[u8], - ) -> Result { - unimplemented!(); - } - - fn pedersen_commitment( - &self, - _inputs: &[FieldElement], - _domain_separator: u32, - ) -> Result<(FieldElement, FieldElement), acvm::BlackBoxResolutionError> { - unimplemented!(); - } - - fn pedersen_hash( - &self, - _inputs: &[FieldElement], - _domain_separator: u32, - ) -> Result { - unimplemented!(); - } - - fn fixed_base_scalar_mul( - &self, - _low: &FieldElement, - _high: &FieldElement, - ) -> Result<(FieldElement, FieldElement), acvm::BlackBoxResolutionError> { - unimplemented!(); - } - - fn ec_add( - &self, - _input1_x: &FieldElement, - _input1_y: &FieldElement, - _input2_x: &FieldElement, - _input2_y: &FieldElement, - ) -> Result<(FieldElement, FieldElement), acvm::BlackBoxResolutionError> { - unimplemented!(); - } - - fn ec_double( - &self, - _input_x: &FieldElement, - _input_y: &FieldElement, - ) -> Result<(FieldElement, FieldElement), acvm::BlackBoxResolutionError> { - unimplemented!(); - } - } - #[test] fn test_resolve_foreign_calls_stepping_into_brillig() { let fe_0 = FieldElement::zero(); let fe_1 = FieldElement::one(); let w_x = Witness(1); - let blackbox_solver = &StubbedSolver; - let brillig_opcodes = Brillig { inputs: vec![BrilligInputs::Single(Expression { linear_combinations: vec![(fe_1, w_x)], @@ -543,7 +486,7 @@ mod tests { let initial_witness = BTreeMap::from([(Witness(1), fe_1)]).into(); let mut context = DebugContext::new( - blackbox_solver, + &StubbedBlackBoxSolver, circuit, debug_artifact, initial_witness, @@ -590,8 +533,6 @@ mod tests { let w_y = Witness(2); let w_z = Witness(3); - let blackbox_solver = &StubbedSolver; - // This Brillig block is equivalent to: z = x + y let brillig_opcodes = Brillig { inputs: vec![ @@ -637,7 +578,7 @@ mod tests { let initial_witness = BTreeMap::from([(Witness(1), fe_1), (Witness(2), fe_1)]).into(); let mut context = DebugContext::new( - blackbox_solver, + &StubbedBlackBoxSolver, circuit, debug_artifact, initial_witness, @@ -666,7 +607,6 @@ mod tests { #[test] fn test_offset_opcode_location() { - let blackbox_solver = &StubbedSolver; let opcodes = vec![ Opcode::Brillig(Brillig { inputs: vec![], @@ -687,7 +627,7 @@ mod tests { let debug_artifact = DebugArtifact { debug_symbols: vec![], file_map: BTreeMap::new(), warnings: vec![] }; let context = DebugContext::new( - blackbox_solver, + &StubbedBlackBoxSolver, &circuit, &debug_artifact, WitnessMap::new(), diff --git a/noir/tooling/lsp/src/requests/goto_definition.rs b/noir/tooling/lsp/src/requests/goto_definition.rs index 6d44761de94..277bbf013f9 100644 --- a/noir/tooling/lsp/src/requests/goto_definition.rs +++ b/noir/tooling/lsp/src/requests/goto_definition.rs @@ -80,19 +80,17 @@ fn on_goto_definition_inner( #[cfg(test)] mod goto_definition_tests { + use acvm::blackbox_solver::StubbedBlackBoxSolver; use async_lsp::ClientSocket; use lsp_types::{Position, Url}; use tokio::test; - use crate::solver::MockBackend; - use super::*; #[test] async fn test_on_goto_definition() { let client = ClientSocket::new_closed(); - let solver = MockBackend; - let mut state = LspState::new(&client, solver); + let mut state = LspState::new(&client, StubbedBlackBoxSolver); let root_path = std::env::current_dir() .unwrap() diff --git a/noir/tooling/lsp/src/requests/mod.rs b/noir/tooling/lsp/src/requests/mod.rs index ba2ef870d88..9a4738e1985 100644 --- a/noir/tooling/lsp/src/requests/mod.rs +++ b/noir/tooling/lsp/src/requests/mod.rs @@ -209,21 +209,19 @@ pub(crate) fn on_shutdown( #[cfg(test)] mod initialization { + use acvm::blackbox_solver::StubbedBlackBoxSolver; use async_lsp::ClientSocket; use lsp_types::{ CodeLensOptions, InitializeParams, TextDocumentSyncCapability, TextDocumentSyncKind, }; use tokio::test; - use crate::{ - requests::on_initialize, solver::MockBackend, types::ServerCapabilities, LspState, - }; + use crate::{requests::on_initialize, types::ServerCapabilities, LspState}; #[test] async fn test_on_initialize() { let client = ClientSocket::new_closed(); - let solver = MockBackend; - let mut state = LspState::new(&client, solver); + let mut state = LspState::new(&client, StubbedBlackBoxSolver); let params = InitializeParams::default(); let response = on_initialize(&mut state, params).await.unwrap(); assert!(matches!( diff --git a/noir/tooling/lsp/src/solver.rs b/noir/tooling/lsp/src/solver.rs index 8c2ea54fe59..6217b7ad71f 100644 --- a/noir/tooling/lsp/src/solver.rs +++ b/noir/tooling/lsp/src/solver.rs @@ -58,63 +58,3 @@ impl BlackBoxFunctionSolver for WrapperSolver { self.0.ec_double(input_x, input_y) } } - -// We also have a mocked implementation of the `BlackBoxFunctionSolver` trait for use in tests - -#[cfg(test)] -pub(crate) struct MockBackend; - -#[cfg(test)] -impl BlackBoxFunctionSolver for MockBackend { - fn schnorr_verify( - &self, - _public_key_x: &acvm::FieldElement, - _public_key_y: &acvm::FieldElement, - _signature: &[u8], - _message: &[u8], - ) -> Result { - unimplemented!() - } - - fn pedersen_commitment( - &self, - _inputs: &[acvm::FieldElement], - _domain_separator: u32, - ) -> Result<(acvm::FieldElement, acvm::FieldElement), acvm::BlackBoxResolutionError> { - unimplemented!() - } - - fn fixed_base_scalar_mul( - &self, - _low: &acvm::FieldElement, - _high: &acvm::FieldElement, - ) -> Result<(acvm::FieldElement, acvm::FieldElement), acvm::BlackBoxResolutionError> { - unimplemented!() - } - - fn pedersen_hash( - &self, - _inputs: &[acvm::FieldElement], - _domain_separator: u32, - ) -> Result { - unimplemented!() - } - - fn ec_add( - &self, - _input1_x: &acvm::FieldElement, - _input1_y: &acvm::FieldElement, - _input2_x: &acvm::FieldElement, - _input2_y: &acvm::FieldElement, - ) -> Result<(acvm::FieldElement, acvm::FieldElement), acvm::BlackBoxResolutionError> { - unimplemented!(); - } - - fn ec_double( - &self, - _input_x: &acvm::FieldElement, - _input_y: &acvm::FieldElement, - ) -> Result<(acvm::FieldElement, acvm::FieldElement), acvm::BlackBoxResolutionError> { - unimplemented!(); - } -} diff --git a/noir/tooling/noir_js/src/witness_generation.ts b/noir/tooling/noir_js/src/witness_generation.ts index a329c79c919..1f233422061 100644 --- a/noir/tooling/noir_js/src/witness_generation.ts +++ b/noir/tooling/noir_js/src/witness_generation.ts @@ -1,8 +1,24 @@ import { abiEncode, InputMap } from '@noir-lang/noirc_abi'; import { base64Decode } from './base64_decode.js'; -import { executeCircuit, WitnessMap, ForeignCallHandler, ForeignCallInput } from '@noir-lang/acvm_js'; +import { + WitnessMap, + ForeignCallHandler, + ForeignCallInput, + createBlackBoxSolver, + WasmBlackBoxFunctionSolver, + executeCircuitWithBlackBoxSolver, +} from '@noir-lang/acvm_js'; import { CompiledCircuit } from '@noir-lang/types'; +let solver: Promise; + +const getSolver = (): Promise => { + if (!solver) { + solver = createBlackBoxSolver(); + } + return solver; +}; + const defaultForeignCallHandler: ForeignCallHandler = async (name: string, args: ForeignCallInput[]) => { if (name == 'print') { // By default we do not print anything for `print` foreign calls due to a need for formatting, @@ -26,7 +42,12 @@ export async function generateWitness( // Execute the circuit to generate the rest of the witnesses and serialize // them into a Uint8Array. try { - const solvedWitness = await executeCircuit(base64Decode(compiledProgram.bytecode), witnessMap, foreignCallHandler); + const solvedWitness = await executeCircuitWithBlackBoxSolver( + await getSolver(), + base64Decode(compiledProgram.bytecode), + witnessMap, + foreignCallHandler, + ); return solvedWitness; } catch (err) { throw new Error(`Circuit execution failed: ${err}`); diff --git a/noir/yarn.lock b/noir/yarn.lock index f4e0ce7df36..ea141531601 100644 --- a/noir/yarn.lock +++ b/noir/yarn.lock @@ -221,20 +221,6 @@ __metadata: languageName: node linkType: hard -"@aztec/bb.js@npm:0.16.0": - version: 0.16.0 - resolution: "@aztec/bb.js@npm:0.16.0" - dependencies: - comlink: ^4.4.1 - commander: ^10.0.1 - debug: ^4.3.4 - tslib: ^2.4.0 - bin: - bb.js: dest/node/main.js - checksum: 5f68b4ad16284a3a871e0ad21fea05aed670383bc639c9d07ab3bf9b7a9d15cc8a4e5cda404a9290775ad5023924739543a8aac37d602892dd1fb5087521970b - languageName: node - linkType: hard - "@aztec/bb.js@npm:0.17.0": version: 0.17.0 resolution: "@aztec/bb.js@npm:0.17.0" @@ -4395,13 +4381,6 @@ __metadata: languageName: node linkType: hard -"@noir-lang/acvm_js@npm:0.35.0": - version: 0.35.0 - resolution: "@noir-lang/acvm_js@npm:0.35.0" - checksum: 0a2209f60242d9dbef31e72b738d70ff802da71f12d4b4f278144d373941f30844c8d041518970e71ba82eb9337cf4cc3a40fbd4b2c50acff45d84d2ee7dd435 - languageName: node - linkType: hard - "@noir-lang/acvm_js@workspace:*, @noir-lang/acvm_js@workspace:acvm-repo/acvm_js": version: 0.0.0-use.local resolution: "@noir-lang/acvm_js@workspace:acvm-repo/acvm_js" @@ -4420,18 +4399,7 @@ __metadata: languageName: unknown linkType: soft -"@noir-lang/backend_barretenberg@npm:^0.19.2": - version: 0.19.4 - resolution: "@noir-lang/backend_barretenberg@npm:0.19.4" - dependencies: - "@aztec/bb.js": 0.16.0 - "@noir-lang/types": 0.19.4 - fflate: ^0.8.0 - checksum: b84382e71f29f0e10415f8c3a68eb7bb0653f56df1b3e8afd66c22df7adc950fb9016124f32253abad3d05583bccf26b1d0c0cabc601218083fd27d0601a3c02 - languageName: node - linkType: hard - -"@noir-lang/backend_barretenberg@workspace:*, @noir-lang/backend_barretenberg@workspace:tooling/noir_js_backend_barretenberg": +"@noir-lang/backend_barretenberg@^0.22.0, @noir-lang/backend_barretenberg@workspace:*, @noir-lang/backend_barretenberg@workspace:tooling/noir_js_backend_barretenberg": version: 0.0.0-use.local resolution: "@noir-lang/backend_barretenberg@workspace:tooling/noir_js_backend_barretenberg" dependencies: @@ -4475,18 +4443,7 @@ __metadata: languageName: unknown linkType: soft -"@noir-lang/noir_js@npm:^0.19.2": - version: 0.19.4 - resolution: "@noir-lang/noir_js@npm:0.19.4" - dependencies: - "@noir-lang/acvm_js": 0.35.0 - "@noir-lang/noirc_abi": 0.19.4 - "@noir-lang/types": 0.19.4 - checksum: 1ee6140019861cee3a27d511951e6b3ed629925a83328b0fbe18791a534c36d26d33ae3ca3aa25252fac8932dfeefedc0d5f07169d5d08f1485d6290965d2491 - languageName: node - linkType: hard - -"@noir-lang/noir_js@workspace:*, @noir-lang/noir_js@workspace:tooling/noir_js": +"@noir-lang/noir_js@^0.22.0, @noir-lang/noir_js@workspace:*, @noir-lang/noir_js@workspace:tooling/noir_js": version: 0.0.0-use.local resolution: "@noir-lang/noir_js@workspace:tooling/noir_js" dependencies: @@ -4509,16 +4466,7 @@ __metadata: languageName: unknown linkType: soft -"@noir-lang/noir_wasm@npm:^0.19.2": - version: 0.19.4 - resolution: "@noir-lang/noir_wasm@npm:0.19.4" - peerDependencies: - "@noir-lang/source-resolver": 0.19.4 - checksum: b69748240e27851f19b20b4ce1d0c57da7e9055b9d0e0c16f699338394912c00277e5586afcff77d3f6f08e17bbf1bc6253ff1ad156b8f4985c4435adad0ba49 - languageName: node - linkType: hard - -"@noir-lang/noir_wasm@workspace:*, @noir-lang/noir_wasm@workspace:compiler/wasm": +"@noir-lang/noir_wasm@^0.22.0, @noir-lang/noir_wasm@workspace:*, @noir-lang/noir_wasm@workspace:compiler/wasm": version: 0.0.0-use.local resolution: "@noir-lang/noir_wasm@workspace:compiler/wasm" dependencies: @@ -4560,13 +4508,6 @@ __metadata: languageName: unknown linkType: soft -"@noir-lang/noirc_abi@npm:0.19.4": - version: 0.19.4 - resolution: "@noir-lang/noirc_abi@npm:0.19.4" - checksum: 7446127935c954ae1b2bfdfa6cf111a9c14a2024f13a2d7e7e0a612319b0b4cc199acdbceaa94168e3bd5d82760b9d2fd2c9eec6677d57ed76e7b666e2b28c7d - languageName: node - linkType: hard - "@noir-lang/noirc_abi@workspace:*, @noir-lang/noirc_abi@workspace:tooling/noirc_abi_wasm": version: 0.0.0-use.local resolution: "@noir-lang/noirc_abi@workspace:tooling/noirc_abi_wasm" @@ -4597,23 +4538,7 @@ __metadata: languageName: unknown linkType: soft -"@noir-lang/source-resolver@npm:^0.19.2": - version: 0.19.4 - resolution: "@noir-lang/source-resolver@npm:0.19.4" - checksum: f0e51bb54daa1197894a17e5d0d125481aa0872c49c0d955feec2629b8ff51b9b48144778def6539a87b723a9b4c5eacc79d6eb935f0da6a1893d8d403689683 - languageName: node - linkType: hard - -"@noir-lang/types@npm:0.19.4, @noir-lang/types@npm:^0.19.2": - version: 0.19.4 - resolution: "@noir-lang/types@npm:0.19.4" - dependencies: - "@noir-lang/noirc_abi": 0.19.4 - checksum: 1d0ce99895c0bc98e9daf67028132f71e30f60b2dc0799ee99f311d917e84459a0d2a37c318f5ab14e594e7dd26f5e612e5fd9a7e0a20a692a7017d7c883bb4d - languageName: node - linkType: hard - -"@noir-lang/types@workspace:*, @noir-lang/types@workspace:tooling/noir_js_types": +"@noir-lang/types@^0.22.0, @noir-lang/types@workspace:*, @noir-lang/types@workspace:tooling/noir_js_types": version: 0.0.0-use.local resolution: "@noir-lang/types@workspace:tooling/noir_js_types" dependencies: @@ -5333,16 +5258,15 @@ __metadata: languageName: node linkType: hard -"@signorecello/noir_playground@npm:^0.6.0": - version: 0.6.0 - resolution: "@signorecello/noir_playground@npm:0.6.0" +"@signorecello/noir_playground@npm:^0.7.0": + version: 0.7.0 + resolution: "@signorecello/noir_playground@npm:0.7.0" dependencies: "@monaco-editor/react": 4.6.0 - "@noir-lang/backend_barretenberg": ^0.19.2 - "@noir-lang/noir_js": ^0.19.2 - "@noir-lang/noir_wasm": ^0.19.2 - "@noir-lang/source-resolver": ^0.19.2 - "@noir-lang/types": ^0.19.2 + "@noir-lang/backend_barretenberg": ^0.22.0 + "@noir-lang/noir_js": ^0.22.0 + "@noir-lang/noir_wasm": ^0.22.0 + "@noir-lang/types": ^0.22.0 fflate: ^0.8.1 js-base64: ^3.7.5 monaco-editor: ^0.44.0 @@ -5350,7 +5274,7 @@ __metadata: monaco-textmate: ^3.0.1 onigasm: ^2.2.5 react-toastify: ^9.1.3 - checksum: a1fa6f5b6aded80ad8ecdf8841dbbcd70e2a3faa479bc39f8077d3e96d65ceab53488f278db1a991a6cc8c6ce63206cc1627fe87e683187941359251e67c48ed + checksum: 360bd1dbc8964a6ab8a6e8d0eb0cd11d7446cc23bf63c253083b18b5d6d5ccf2ec6ca847614106cd93490bb815aac651a6e4584ac63ea0fda182cdb1aadf3f45 languageName: node linkType: hard @@ -5906,15 +5830,6 @@ __metadata: languageName: node linkType: hard -"@types/fs-extra@npm:^9.0.13": - version: 9.0.13 - resolution: "@types/fs-extra@npm:9.0.13" - dependencies: - "@types/node": "*" - checksum: add79e212acd5ac76b97b9045834e03a7996aef60a814185e0459088fd290519a3c1620865d588fa36c4498bf614210d2a703af5cf80aa1dbc125db78f6edac3 - languageName: node - linkType: hard - "@types/gtag.js@npm:^0.0.12": version: 0.0.12 resolution: "@types/gtag.js@npm:0.0.12" @@ -6110,13 +6025,6 @@ __metadata: languageName: node linkType: hard -"@types/minimist@npm:^1.2.2": - version: 1.2.5 - resolution: "@types/minimist@npm:1.2.5" - checksum: 477047b606005058ab0263c4f58097136268007f320003c348794f74adedc3166ffc47c80ec3e94687787f2ab7f4e72c468223946e79892cf0fd9e25e9970a90 - languageName: node - linkType: hard - "@types/mocha-each@npm:^2": version: 2.0.4 resolution: "@types/mocha-each@npm:2.0.4" @@ -6179,15 +6087,6 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^18.7.20": - version: 18.19.3 - resolution: "@types/node@npm:18.19.3" - dependencies: - undici-types: ~5.26.4 - checksum: 58c4fa45a78fcec75c78182a4b266395905957633654eb0311c5f9c30ac15c179ea2287ab1af034e46c2db7bb0589ef0000ee64c1de8f568a0aad29eaadb100c - languageName: node - linkType: hard - "@types/node@npm:^20.10.5": version: 20.10.5 resolution: "@types/node@npm:20.10.5" @@ -6257,13 +6156,6 @@ __metadata: languageName: node linkType: hard -"@types/ps-tree@npm:^1.1.2": - version: 1.1.6 - resolution: "@types/ps-tree@npm:1.1.6" - checksum: bf5b7bb9bd11b8762a8302b93c335728ecb19c85a74c640a3888d476368a03733f11612b9a87b1ad9ea56f95720db23a824c78113b16024dc59264b7f9008df5 - languageName: node - linkType: hard - "@types/qs@npm:*": version: 6.9.10 resolution: "@types/qs@npm:6.9.10" @@ -6474,13 +6366,6 @@ __metadata: languageName: node linkType: hard -"@types/which@npm:^2.0.1": - version: 2.0.2 - resolution: "@types/which@npm:2.0.2" - checksum: 8626a3c2f6db676c449142e1082e33ea0c9d88b8a2bd796366b944891e6da0088b2aa83d3fa9c79e6696f7381a851fc76d43bd353eb6c4d98a7775b4ae0a96a5 - languageName: node - linkType: hard - "@types/ws@npm:^7.4.0": version: 7.4.7 resolution: "@types/ws@npm:7.4.7" @@ -9971,13 +9856,6 @@ __metadata: languageName: node linkType: hard -"data-uri-to-buffer@npm:^4.0.0": - version: 4.0.1 - resolution: "data-uri-to-buffer@npm:4.0.1" - checksum: 0d0790b67ffec5302f204c2ccca4494f70b4e2d940fea3d36b09f0bb2b8539c2e86690429eb1f1dc4bcc9e4df0644193073e63d9ee48ac9fce79ec1506e4aa4c - languageName: node - linkType: hard - "data-uri-to-buffer@npm:^6.0.0": version: 6.0.1 resolution: "data-uri-to-buffer@npm:6.0.1" @@ -10384,7 +10262,7 @@ __metadata: "@noir-lang/noir_js": "workspace:*" "@noir-lang/noirc_abi": "workspace:*" "@noir-lang/types": "workspace:*" - "@signorecello/noir_playground": ^0.6.0 + "@signorecello/noir_playground": ^0.7.0 "@types/prettier": ^3 axios: ^1.4.0 clsx: ^1.2.1 @@ -10541,7 +10419,7 @@ __metadata: languageName: node linkType: hard -"duplexer@npm:^0.1.2, duplexer@npm:~0.1.1": +"duplexer@npm:^0.1.2": version: 0.1.2 resolution: "duplexer@npm:0.1.2" checksum: 62ba61a830c56801db28ff6305c7d289b6dc9f859054e8c982abd8ee0b0a14d2e9a8e7d086ffee12e868d43e2bbe8a964be55ddbd8c8957714c87373c7a4f9b0 @@ -11346,21 +11224,6 @@ __metadata: languageName: node linkType: hard -"event-stream@npm:=3.3.4": - version: 3.3.4 - resolution: "event-stream@npm:3.3.4" - dependencies: - duplexer: ~0.1.1 - from: ~0 - map-stream: ~0.1.0 - pause-stream: 0.0.11 - split: 0.3 - stream-combiner: ~0.0.4 - through: ~2.3.1 - checksum: 80b467820b6daf824d9fb4345d2daf115a056e5c104463f2e98534e92d196a27f2df5ea2aa085624db26f4c45698905499e881d13bc7c01f7a13eac85be72a22 - languageName: node - linkType: hard - "event-target-shim@npm:^5.0.0": version: 5.0.1 resolution: "event-target-shim@npm:5.0.1" @@ -11629,16 +11492,6 @@ __metadata: languageName: node linkType: hard -"fetch-blob@npm:^3.1.2, fetch-blob@npm:^3.1.4": - version: 3.2.0 - resolution: "fetch-blob@npm:3.2.0" - dependencies: - node-domexception: ^1.0.0 - web-streams-polyfill: ^3.0.3 - checksum: f19bc28a2a0b9626e69fd7cf3a05798706db7f6c7548da657cbf5026a570945f5eeaedff52007ea35c8bcd3d237c58a20bf1543bc568ab2422411d762dd3d5bf - languageName: node - linkType: hard - "fflate@npm:^0.8.0, fflate@npm:^0.8.1": version: 0.8.1 resolution: "fflate@npm:0.8.1" @@ -11922,15 +11775,6 @@ __metadata: languageName: node linkType: hard -"formdata-polyfill@npm:^4.0.10": - version: 4.0.10 - resolution: "formdata-polyfill@npm:4.0.10" - dependencies: - fetch-blob: ^3.1.2 - checksum: 82a34df292afadd82b43d4a740ce387bc08541e0a534358425193017bf9fb3567875dc5f69564984b1da979979b70703aa73dee715a17b6c229752ae736dd9db - languageName: node - linkType: hard - "forwarded@npm:0.2.0": version: 0.2.0 resolution: "forwarded@npm:0.2.0" @@ -11966,13 +11810,6 @@ __metadata: languageName: node linkType: hard -"from@npm:~0": - version: 0.1.7 - resolution: "from@npm:0.1.7" - checksum: b85125b7890489656eb2e4f208f7654a93ec26e3aefaf3bbbcc0d496fc1941e4405834fcc9fe7333192aa2187905510ace70417bbf9ac6f6f4784a731d986939 - languageName: node - linkType: hard - "fs-constants@npm:^1.0.0": version: 1.0.0 resolution: "fs-constants@npm:1.0.0" @@ -12392,7 +12229,7 @@ __metadata: languageName: node linkType: hard -"globby@npm:^13.1.1, globby@npm:^13.1.2": +"globby@npm:^13.1.1": version: 13.2.2 resolution: "globby@npm:13.2.2" dependencies: @@ -14444,13 +14281,6 @@ __metadata: languageName: node linkType: hard -"kleur@npm:^4.0.3": - version: 4.1.5 - resolution: "kleur@npm:4.1.5" - checksum: 1dc476e32741acf0b1b5b0627ffd0d722e342c1b0da14de3e8ae97821327ca08f9fb944542fb3c126d90ac5f27f9d804edbe7c585bf7d12ef495d115e0f22c12 - languageName: node - linkType: hard - "koa-compose@npm:^4.1.0": version: 4.1.0 resolution: "koa-compose@npm:4.1.0" @@ -15053,13 +14883,6 @@ __metadata: languageName: node linkType: hard -"map-stream@npm:~0.1.0": - version: 0.1.0 - resolution: "map-stream@npm:0.1.0" - checksum: 38abbe4eb883888031e6b2fc0630bc583c99396be16b8ace5794b937b682a8a081f03e8b15bfd4914d1bc88318f0e9ac73ba3512ae65955cd449f63256ddb31d - languageName: node - linkType: hard - "mark.js@npm:^8.11.1": version: 8.11.1 resolution: "mark.js@npm:8.11.1" @@ -16379,13 +16202,6 @@ __metadata: languageName: node linkType: hard -"mri@npm:^1.1.0": - version: 1.2.0 - resolution: "mri@npm:1.2.0" - checksum: 83f515abbcff60150873e424894a2f65d68037e5a7fcde8a9e2b285ee9c13ac581b63cfc1e6826c4732de3aeb84902f7c1e16b7aff46cd3f897a0f757a894e85 - languageName: node - linkType: hard - "mrmime@npm:^1.0.0": version: 1.0.1 resolution: "mrmime@npm:1.0.1" @@ -16518,13 +16334,6 @@ __metadata: languageName: node linkType: hard -"node-domexception@npm:^1.0.0": - version: 1.0.0 - resolution: "node-domexception@npm:1.0.0" - checksum: ee1d37dd2a4eb26a8a92cd6b64dfc29caec72bff5e1ed9aba80c294f57a31ba4895a60fd48347cf17dd6e766da0ae87d75657dfd1f384ebfa60462c2283f5c7f - languageName: node - linkType: hard - "node-emoji@npm:^1.10.0": version: 1.11.0 resolution: "node-emoji@npm:1.11.0" @@ -16560,17 +16369,6 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:3.2.10": - version: 3.2.10 - resolution: "node-fetch@npm:3.2.10" - dependencies: - data-uri-to-buffer: ^4.0.0 - fetch-blob: ^3.1.4 - formdata-polyfill: ^4.0.10 - checksum: e65322431f4897ded04197aa5923eaec63a8d53e00432de4e70a4f7006625c8dc32629c5c35f4fe8ee719a4825544d07bf53f6e146a7265914262f493e8deac1 - languageName: node - linkType: hard - "node-fetch@npm:^2.6.12": version: 2.7.0 resolution: "node-fetch@npm:2.7.0" @@ -17329,15 +17127,6 @@ __metadata: languageName: node linkType: hard -"pause-stream@npm:0.0.11": - version: 0.0.11 - resolution: "pause-stream@npm:0.0.11" - dependencies: - through: ~2.3 - checksum: 3c4a14052a638b92e0c96eb00c0d7977df7f79ea28395250c525d197f1fc02d34ce1165d5362e2e6ebbb251524b94a76f3f0d4abc39ab8b016d97449fe15583c - languageName: node - linkType: hard - "pbkdf2@npm:^3.0.17": version: 3.1.2 resolution: "pbkdf2@npm:3.1.2" @@ -18096,17 +17885,6 @@ __metadata: languageName: node linkType: hard -"ps-tree@npm:^1.2.0": - version: 1.2.0 - resolution: "ps-tree@npm:1.2.0" - dependencies: - event-stream: =3.3.4 - bin: - ps-tree: ./bin/ps-tree.js - checksum: e635dd00f53d30d31696cf5f95b3a8dbdf9b1aeb36d4391578ce8e8cd22949b7c5536c73b0dc18c78615ea3ddd4be96101166be59ca2e3e3cb1e2f79ba3c7f98 - languageName: node - linkType: hard - "pump@npm:^3.0.0": version: 3.0.0 resolution: "pump@npm:3.0.0" @@ -18754,15 +18532,6 @@ __metadata: languageName: node linkType: hard -"release-tests@workspace:release-tests": - version: 0.0.0-use.local - resolution: "release-tests@workspace:release-tests" - dependencies: - uvu: 0.5.6 - zx: 7.1.1 - languageName: unknown - linkType: soft - "remark-directive@npm:^3.0.0": version: 3.0.0 resolution: "remark-directive@npm:3.0.0" @@ -19320,15 +19089,6 @@ __metadata: languageName: node linkType: hard -"sade@npm:^1.7.3": - version: 1.8.1 - resolution: "sade@npm:1.8.1" - dependencies: - mri: ^1.1.0 - checksum: 0756e5b04c51ccdc8221ebffd1548d0ce5a783a44a0fa9017a026659b97d632913e78f7dca59f2496aa996a0be0b0c322afd87ca72ccd909406f49dbffa0f45d - languageName: node - linkType: hard - "safe-buffer@npm:5.1.2, safe-buffer@npm:~5.1.0, safe-buffer@npm:~5.1.1": version: 5.1.2 resolution: "safe-buffer@npm:5.1.2" @@ -19981,15 +19741,6 @@ __metadata: languageName: node linkType: hard -"split@npm:0.3": - version: 0.3.3 - resolution: "split@npm:0.3.3" - dependencies: - through: 2 - checksum: 2e076634c9637cfdc54ab4387b6a243b8c33b360874a25adf6f327a5647f07cb3bf1c755d515248eb3afee4e382278d01f62c62d87263c118f28065b86f74f02 - languageName: node - linkType: hard - "sprintf-js@npm:^1.0.3": version: 1.1.3 resolution: "sprintf-js@npm:1.1.3" @@ -20071,15 +19822,6 @@ __metadata: languageName: node linkType: hard -"stream-combiner@npm:~0.0.4": - version: 0.0.4 - resolution: "stream-combiner@npm:0.0.4" - dependencies: - duplexer: ~0.1.1 - checksum: 844b622cfe8b9de45a6007404f613b60aaf85200ab9862299066204242f89a7c8033b1c356c998aa6cfc630f6cd9eba119ec1c6dc1f93e245982be4a847aee7d - languageName: node - linkType: hard - "stream-read-all@npm:^3.0.1": version: 3.0.1 resolution: "stream-read-all@npm:3.0.1" @@ -20520,7 +20262,7 @@ __metadata: languageName: node linkType: hard -"through@npm:2, through@npm:^2.3.8, through@npm:~2.3, through@npm:~2.3.1": +"through@npm:^2.3.8": version: 2.3.8 resolution: "through@npm:2.3.8" checksum: a38c3e059853c494af95d50c072b83f8b676a9ba2818dcc5b108ef252230735c54e0185437618596c790bbba8fcdaef5b290405981ffa09dce67b1f1bf190cbd @@ -21551,20 +21293,6 @@ __metadata: languageName: node linkType: hard -"uvu@npm:0.5.6": - version: 0.5.6 - resolution: "uvu@npm:0.5.6" - dependencies: - dequal: ^2.0.0 - diff: ^5.0.0 - kleur: ^4.0.3 - sade: ^1.7.3 - bin: - uvu: bin.js - checksum: 09460a37975627de9fcad396e5078fb844d01aaf64a6399ebfcfd9e55f1c2037539b47611e8631f89be07656962af0cf48c334993db82b9ae9c3d25ce3862168 - languageName: node - linkType: hard - "uzip-module@npm:^1.0.2": version: 1.0.3 resolution: "uzip-module@npm:1.0.3" @@ -21740,13 +21468,6 @@ __metadata: languageName: node linkType: hard -"web-streams-polyfill@npm:^3.0.3": - version: 3.2.1 - resolution: "web-streams-polyfill@npm:3.2.1" - checksum: b119c78574b6d65935e35098c2afdcd752b84268e18746606af149e3c424e15621b6f1ff0b42b2676dc012fc4f0d313f964b41a4b5031e525faa03997457da02 - languageName: node - linkType: hard - "webidl-conversions@npm:^3.0.0": version: 3.0.1 resolution: "webidl-conversions@npm:3.0.1" @@ -22301,7 +22022,7 @@ __metadata: languageName: node linkType: hard -"yaml@npm:^2.1.1, yaml@npm:^2.2.2, yaml@npm:^2.3.4": +"yaml@npm:^2.2.2, yaml@npm:^2.3.4": version: 2.3.4 resolution: "yaml@npm:2.3.4" checksum: e6d1dae1c6383bcc8ba11796eef3b8c02d5082911c6723efeeb5ba50fc8e881df18d645e64de68e421b577296000bea9c75d6d9097c2f6699da3ae0406c030d8 @@ -22437,26 +22158,3 @@ __metadata: checksum: f22ec5fc2d5f02c423c93d35cdfa83573a3a3bd98c66b927c368ea4d0e7252a500df2a90a6b45522be536a96a73404393c958e945fdba95e6832c200791702b6 languageName: node linkType: hard - -"zx@npm:7.1.1": - version: 7.1.1 - resolution: "zx@npm:7.1.1" - dependencies: - "@types/fs-extra": ^9.0.13 - "@types/minimist": ^1.2.2 - "@types/node": ^18.7.20 - "@types/ps-tree": ^1.1.2 - "@types/which": ^2.0.1 - chalk: ^5.0.1 - fs-extra: ^10.1.0 - globby: ^13.1.2 - minimist: ^1.2.6 - node-fetch: 3.2.10 - ps-tree: ^1.2.0 - which: ^2.0.2 - yaml: ^2.1.1 - bin: - zx: build/cli.js - checksum: 510c56366a62220108247624a83fc088bfc8f393e3f20168d69a67e3c7aff1a4b790c118ee70e58171dcbc91b53ab079bba3074e1c40829f6179a7f48a38be78 - languageName: node - linkType: hard