Skip to content

Commit

Permalink
feat: Sync from noir (#6986)
Browse files Browse the repository at this point in the history
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
(noir-lang/noir#5141)
chore!: remove `distinct` keyword
(noir-lang/noir#5219)
feat: Sync from aztec-packages
(noir-lang/noir#5222)
chore: add some property tests to ACVM crates
(noir-lang/noir#5215)
chore: inline `FieldElement.is_negative` and document
(noir-lang/noir#5214)
chore!: remove `param_witnesses` and `return_witnesses` from ABI
(noir-lang/noir#5154)
chore: move implementation of bitwise operations into `blackbox_solver`
(noir-lang/noir#5209)
chore: remove stale comment
(noir-lang/noir#5179)
chore: make `nargo` crate and debug info generic
(noir-lang/noir#5184)
feat!: add session id to foreign call RPC requests
(noir-lang/noir#5205)
chore(docs): fix incorrect docs github link in footer
(noir-lang/noir#5206)
fix: error for allocate instructions in acir-gen
(noir-lang/noir#5200)
feat: Implement println in the comptime interpreter
(noir-lang/noir#5197)
chore(docs): Supplement Noir Debugger's dependency versions
(noir-lang/noir#5199)
chore(docs): Update docs homepage
(noir-lang/noir#5198)
chore: add more lints related to oracle calls
(noir-lang/noir#5193)
feat: standardize pedersen functions to return `EmbeddedCurvePoint`
(noir-lang/noir#5190)
END_COMMIT_OVERRIDE

---------

Co-authored-by: Tom French <tom@tomfren.ch>
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
Co-authored-by: Maxim Vezenov <mvezenov@gmail.com>
  • Loading branch information
4 people authored Jun 13, 2024
1 parent 555d97a commit 12af650
Show file tree
Hide file tree
Showing 106 changed files with 783 additions and 910 deletions.
2 changes: 1 addition & 1 deletion .noir-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9c99a97ca8f42bee23cf97ebd724fdc51e647c60
2e543b40eb83ef2080e4d8f870f525fadd631099
1 change: 1 addition & 0 deletions avm-transpiler/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion noir-projects/aztec-nr/aztec/src/encrypted_logs.nr
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ mod header;
mod incoming_body;
mod outgoing_body;
mod payload;
mod encrypted_note_emission;
mod encrypted_note_emission;
2 changes: 1 addition & 1 deletion noir-projects/aztec-nr/aztec/src/note.nr
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ mod note_header;
mod note_interface;
mod note_viewer_options;
mod utils;
mod note_emission;
mod note_emission;
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
27 changes: 4 additions & 23 deletions noir-projects/aztec-nr/aztec/src/oracle/logs.nr
Original file line number Diff line number Diff line change
Expand Up @@ -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<M>(
_note_hash_counter: u32,
_encrypted_note: [u8; M],
_counter: u32
) {}
unconstrained fn emit_encrypted_note_log_oracle<M>(_note_hash_counter: u32, _encrypted_note: [u8; M], _counter: u32) {}

unconstrained pub fn emit_encrypted_note_log<M>(
note_hash_counter: u32,
Expand All @@ -17,12 +13,7 @@ unconstrained pub fn emit_encrypted_note_log<M>(
}

#[oracle(emitEncryptedEventLog)]
unconstrained fn emit_encrypted_event_log_oracle<M>(
_contract_address: AztecAddress,
_randomness: Field,
_encrypted_event: [u8; M],
_counter: u32
) {}
unconstrained fn emit_encrypted_event_log_oracle<M>(_contract_address: AztecAddress, _randomness: Field, _encrypted_event: [u8; M], _counter: u32) {}

unconstrained pub fn emit_encrypted_event_log<M>(
contract_address: AztecAddress,
Expand Down Expand Up @@ -98,12 +89,7 @@ unconstrained pub fn compute_encrypted_event_log<N, M>(
}

#[oracle(emitUnencryptedLog)]
unconstrained fn emit_unencrypted_log_oracle_private<T>(
_contract_address: AztecAddress,
_event_selector: Field,
_message: T,
_counter: u32
) -> Field {}
unconstrained fn emit_unencrypted_log_oracle_private<T>(_contract_address: AztecAddress, _event_selector: Field, _message: T, _counter: u32) -> Field {}

unconstrained pub fn emit_unencrypted_log_private_internal<T>(
contract_address: AztecAddress,
Expand All @@ -115,12 +101,7 @@ unconstrained pub fn emit_unencrypted_log_private_internal<T>(
}

#[oracle(emitContractClassUnencryptedLog)]
unconstrained fn emit_contract_class_unencrypted_log_private<N>(
contract_address: AztecAddress,
event_selector: Field,
message: [Field; N],
counter: u32
) -> Field {}
unconstrained fn emit_contract_class_unencrypted_log_private<N>(contract_address: AztecAddress, event_selector: Field, message: [Field; N], counter: u32) -> Field {}

unconstrained pub fn emit_contract_class_unencrypted_log_private_internal<N>(
contract_address: AztecAddress,
Expand Down
6 changes: 1 addition & 5 deletions noir-projects/aztec-nr/aztec/src/oracle/notes.nr
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ unconstrained pub fn notify_created_note<N>(
}

#[oracle(notifyNullifiedNote)]
unconstrained fn notify_nullified_note_oracle<N>(
_nullifier: Field,
_inner_note_hash: Field,
_counter: u32
) -> Field {}
unconstrained fn notify_nullified_note_oracle<N>(_nullifier: Field, _inner_note_hash: Field, _counter: u32) -> Field {}

unconstrained pub fn notify_nullified_note<N>(
nullifier: Field,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use dep::aztec::{
traits::{ToField, Serialize, FromField}, grumpkin_point::GrumpkinPoint,
constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL
},
encrypted_logs::encrypted_note_emission::encode_and_encrypt_with_keys, note::note_getter::view_notes,
state_vars::PrivateSet, note::constants::MAX_NOTES_PER_PAGE
encrypted_logs::encrypted_note_emission::encode_and_encrypt_with_keys,
note::note_getter::view_notes, state_vars::PrivateSet, note::constants::MAX_NOTES_PER_PAGE
};
use dep::std;
use dep::std::{option::Option};
Expand Down
27 changes: 0 additions & 27 deletions noir/noir-repo/.github/workflows/test-js-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,32 +221,6 @@ jobs:
- name: Run browser tests
run: yarn workspace @noir-lang/noirc_abi test:browser

test-noir-js-backend-barretenberg:
needs: [build-noirc-abi]
name: noir-js-backend-barretenberg
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download wasm package artifact
uses: actions/download-artifact@v4
with:
name: noirc_abi_wasm
path: ./tooling/noirc_abi_wasm

- name: Install Yarn dependencies
uses: ./.github/actions/setup

- name: Build noir_js_types
run: yarn workspace @noir-lang/types build

- name: Run barretenberg wrapper tests
run: |
yarn workspace @noir-lang/backend_barretenberg test
test-noir-js:
needs: [build-nargo, build-acvm-js, build-noirc-abi]
name: Noir JS
Expand Down Expand Up @@ -546,7 +520,6 @@ jobs:
- test-acvm_js-node
- test-acvm_js-browser
- test-noirc-abi
- test-noir-js-backend-barretenberg
- test-noir-js
- test-noir-wasm
- test-noir-codegen
Expand Down
8 changes: 5 additions & 3 deletions noir/noir-repo/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions noir/noir-repo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ noirc_abi = { path = "tooling/noirc_abi" }
bb_abstraction_leaks = { path = "tooling/bb_abstraction_leaks" }
acvm_cli = { path = "tooling/acvm_cli" }

# Arkworks
ark-bn254 = { version = "^0.4.0", default-features = false, features = ["curve"] }
ark-bls12-381 = { version = "^0.4.0", default-features = false, features = ["curve"] }
grumpkin = { version = "0.1.0", package = "noir_grumpkin", features = ["std"] }
ark-ec = { version = "^0.4.0", default-features = false }
ark-ff = { version = "^0.4.0", default-features = false }
ark-std = { version = "^0.4.0", default-features = false }

# Misc utils crates
iter-extended = { path = "utils/iter-extended" }

Expand Down Expand Up @@ -131,6 +139,8 @@ similar-asserts = "1.5.0"
tempfile = "3.6.0"
jsonrpc = { version = "0.16.0", features = ["minreq_http"] }
flate2 = "1.0.24"
rand = "0.8.5"
proptest = "1.2.0"

im = { version = "15.1", features = ["serde"] }
tracing = "0.1.40"
Expand Down
9 changes: 6 additions & 3 deletions noir/noir-repo/acvm-repo/acir_field/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ hex.workspace = true
num-bigint.workspace = true
serde.workspace = true

ark-bn254 = { version = "^0.4.0", default-features = false, features = ["curve"] }
ark-bls12-381 = { version = "^0.4.0", optional = true, default-features = false, features = ["curve"] }
ark-ff = { version = "^0.4.0", default-features = false }
ark-bn254.workspace = true
ark-bls12-381 = { workspace = true, optional = true }
ark-ff.workspace = true

cfg-if = "1.0.0"

[dev-dependencies]
proptest.workspace = true

[features]
bn254 = []
bls12_381 = ["dep:ark-bls12-381"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Seeds for failure cases proptest has generated in the past. It is
# automatically read and these particular cases re-run before any
# novel cases are generated.
#
# It is recommended to check this file in to source control so that
# everyone who runs the test benefits from these saved cases.
cc c1b2755b427c874de3ee55c2969e8adc1b4b0331a28173e9e1e492b3fee6b7b7 # shrinks to hex = "3a0aaaa0aa0aaa00000aaaaaaaa0000a000aaa0a00a0000aa00a00aa0a000a0a"
Loading

0 comments on commit 12af650

Please sign in to comment.