From b94fce6f7a5b2fc9f1488f358cf7ac6a5afc6f75 Mon Sep 17 00:00:00 2001 From: Aztec Bot <49558828+AztecBot@users.noreply.github.com> Date: Thu, 13 Jun 2024 10:50:12 -0400 Subject: [PATCH] feat: Sync from noir (#6986) Automated pull of development from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE chore: avoid `bn254_blackbox_solver` polluting feature flags (https://github.com/noir-lang/noir/pull/5141) chore!: remove `distinct` keyword (https://github.com/noir-lang/noir/pull/5219) feat: Sync from aztec-packages (https://github.com/noir-lang/noir/pull/5222) chore: add some property tests to ACVM crates (https://github.com/noir-lang/noir/pull/5215) chore: inline `FieldElement.is_negative` and document (https://github.com/noir-lang/noir/pull/5214) chore!: remove `param_witnesses` and `return_witnesses` from ABI (https://github.com/noir-lang/noir/pull/5154) chore: move implementation of bitwise operations into `blackbox_solver` (https://github.com/noir-lang/noir/pull/5209) chore: remove stale comment (https://github.com/noir-lang/noir/pull/5179) chore: make `nargo` crate and debug info generic (https://github.com/noir-lang/noir/pull/5184) feat!: add session id to foreign call RPC requests (https://github.com/noir-lang/noir/pull/5205) chore(docs): fix incorrect docs github link in footer (https://github.com/noir-lang/noir/pull/5206) fix: error for allocate instructions in acir-gen (https://github.com/noir-lang/noir/pull/5200) feat: Implement println in the comptime interpreter (https://github.com/noir-lang/noir/pull/5197) chore(docs): Supplement Noir Debugger's dependency versions (https://github.com/noir-lang/noir/pull/5199) chore(docs): Update docs homepage (https://github.com/noir-lang/noir/pull/5198) chore: add more lints related to oracle calls (https://github.com/noir-lang/noir/pull/5193) feat: standardize pedersen functions to return `EmbeddedCurvePoint` (https://github.com/noir-lang/noir/pull/5190) END_COMMIT_OVERRIDE --------- Co-authored-by: Tom French Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com> Co-authored-by: Maxim Vezenov --- aztec/src/encrypted_logs.nr | 2 +- aztec/src/note.nr | 2 +- aztec/src/oracle/key_validation_request.nr | 5 +++- aztec/src/oracle/logs.nr | 27 ++++------------------ aztec/src/oracle/notes.nr | 6 +---- 5 files changed, 11 insertions(+), 31 deletions(-) diff --git a/aztec/src/encrypted_logs.nr b/aztec/src/encrypted_logs.nr index a8d92e00..2f1b93d9 100644 --- a/aztec/src/encrypted_logs.nr +++ b/aztec/src/encrypted_logs.nr @@ -2,4 +2,4 @@ mod header; mod incoming_body; mod outgoing_body; mod payload; -mod encrypted_note_emission; \ No newline at end of file +mod encrypted_note_emission; diff --git a/aztec/src/note.nr b/aztec/src/note.nr index 644450ef..670b3407 100644 --- a/aztec/src/note.nr +++ b/aztec/src/note.nr @@ -6,4 +6,4 @@ mod note_header; mod note_interface; mod note_viewer_options; mod utils; -mod note_emission; \ No newline at end of file +mod note_emission; diff --git a/aztec/src/oracle/key_validation_request.nr b/aztec/src/oracle/key_validation_request.nr index 8f9e0d42..77ab29f9 100644 --- a/aztec/src/oracle/key_validation_request.nr +++ b/aztec/src/oracle/key_validation_request.nr @@ -4,7 +4,10 @@ use dep::protocol_types::{ }; #[oracle(getKeyValidationRequest)] -unconstrained fn get_key_validation_request_oracle(_pk_m_hash: Field, _key_index: Field) -> [Field; KEY_VALIDATION_REQUEST_LENGTH] {} +unconstrained fn get_key_validation_request_oracle( + _pk_m_hash: Field, + _key_index: Field +) -> [Field; KEY_VALIDATION_REQUEST_LENGTH] {} unconstrained fn get_key_validation_request_internal(npk_m_hash: Field, key_index: Field) -> KeyValidationRequest { let result = get_key_validation_request_oracle(npk_m_hash, key_index); diff --git a/aztec/src/oracle/logs.nr b/aztec/src/oracle/logs.nr index 34aea855..02bbd75d 100644 --- a/aztec/src/oracle/logs.nr +++ b/aztec/src/oracle/logs.nr @@ -2,11 +2,7 @@ use dep::protocol_types::{address::AztecAddress, grumpkin_point::GrumpkinPoint}; // = 480 + 32 * N bytes #[oracle(emitEncryptedNoteLog)] -unconstrained fn emit_encrypted_note_log_oracle( - _note_hash_counter: u32, - _encrypted_note: [u8; M], - _counter: u32 -) {} +unconstrained fn emit_encrypted_note_log_oracle(_note_hash_counter: u32, _encrypted_note: [u8; M], _counter: u32) {} unconstrained pub fn emit_encrypted_note_log( note_hash_counter: u32, @@ -17,12 +13,7 @@ unconstrained pub fn emit_encrypted_note_log( } #[oracle(emitEncryptedEventLog)] -unconstrained fn emit_encrypted_event_log_oracle( - _contract_address: AztecAddress, - _randomness: Field, - _encrypted_event: [u8; M], - _counter: u32 -) {} +unconstrained fn emit_encrypted_event_log_oracle(_contract_address: AztecAddress, _randomness: Field, _encrypted_event: [u8; M], _counter: u32) {} unconstrained pub fn emit_encrypted_event_log( contract_address: AztecAddress, @@ -98,12 +89,7 @@ unconstrained pub fn compute_encrypted_event_log( } #[oracle(emitUnencryptedLog)] -unconstrained fn emit_unencrypted_log_oracle_private( - _contract_address: AztecAddress, - _event_selector: Field, - _message: T, - _counter: u32 -) -> Field {} +unconstrained fn emit_unencrypted_log_oracle_private(_contract_address: AztecAddress, _event_selector: Field, _message: T, _counter: u32) -> Field {} unconstrained pub fn emit_unencrypted_log_private_internal( contract_address: AztecAddress, @@ -115,12 +101,7 @@ unconstrained pub fn emit_unencrypted_log_private_internal( } #[oracle(emitContractClassUnencryptedLog)] -unconstrained fn emit_contract_class_unencrypted_log_private( - contract_address: AztecAddress, - event_selector: Field, - message: [Field; N], - counter: u32 -) -> Field {} +unconstrained fn emit_contract_class_unencrypted_log_private(contract_address: AztecAddress, event_selector: Field, message: [Field; N], counter: u32) -> Field {} unconstrained pub fn emit_contract_class_unencrypted_log_private_internal( contract_address: AztecAddress, diff --git a/aztec/src/oracle/notes.nr b/aztec/src/oracle/notes.nr index 6a2a311f..42c6bcdb 100644 --- a/aztec/src/oracle/notes.nr +++ b/aztec/src/oracle/notes.nr @@ -28,11 +28,7 @@ unconstrained pub fn notify_created_note( } #[oracle(notifyNullifiedNote)] -unconstrained fn notify_nullified_note_oracle( - _nullifier: Field, - _inner_note_hash: Field, - _counter: u32 -) -> Field {} +unconstrained fn notify_nullified_note_oracle(_nullifier: Field, _inner_note_hash: Field, _counter: u32) -> Field {} unconstrained pub fn notify_nullified_note( nullifier: Field,