Skip to content

Commit

Permalink
feat: Sync from noir (#5935)
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: remove pub wildcard import of ast into `noirc_frontend` root
(noir-lang/noir#4862)
chore: remove `SecondaryAttribute::Event`
(noir-lang/noir#4868)
chore: more explicit `self` parameter in `Into` trait
(noir-lang/noir#4867)
chore: remove initialisation of logger in `acvm_js` tests
(noir-lang/noir#4850)
chore: bump MSRV to `1.74.1`
(noir-lang/noir#4873)
chore: update NoirJS tutorial
(noir-lang/noir#4861)
chore(docs): remove link to play.noir-lang.org
(noir-lang/noir#4872)
chore: update noir README (noir-lang/noir#4856)
feat(experimental): Add `comptime` keyword
(noir-lang/noir#4840)
feat: add `min` and `max` functions to the stdlib
(noir-lang/noir#4839)
feat: Allow numeric generics to non inlined ACIR functions
(noir-lang/noir#4834)
chore!: Add `as_array` and remove `_slice` variants of hash functions
(noir-lang/noir#4675)
feat!: reserve keyword `super`
(noir-lang/noir#4836)
feat: simplify `BoundedVec::eq`
(noir-lang/noir#4838)
feat: Add comptime Interpreter
(noir-lang/noir#4821)
feat: Sync from aztec-packages
(noir-lang/noir#4833)
feat: implement `Eq` trait on `BoundedVec`
(noir-lang/noir#4830)
chore: add benchmarks for serializing a dummy program
(noir-lang/noir#4813)
END_COMMIT_OVERRIDE

---------

Co-authored-by: TomAFrench <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 Apr 23, 2024
1 parent 13153d0 commit cea5107
Show file tree
Hide file tree
Showing 158 changed files with 2,744 additions and 837 deletions.
2 changes: 1 addition & 1 deletion .noir-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6cc105ee441e093b4fccdd5fcc3db922eb28a3fb
1969ce39378f633e88adedf43b747724b89ed7d7
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 avm-transpiler/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "1.73"
channel = "1.74.1"
components = ["rust-src"]
targets = []
profile = "default"
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ pub fn get_pack_cards(
// generate pseudo randomness deterministically from 'seed' and user secret
let secret = context.request_app_nullifier_secret_key(owner);
let mix = secret + seed;
let random_bytes = std::hash::sha256_slice(mix.to_le_bytes(32));
let mix_bytes: [u8; 32] = mix.to_le_bytes(32).as_array();
let random_bytes = std::hash::sha256(mix_bytes);

let mut cards = [Card::from_field(0); PACK_CARDS];
// we generate PACK_CARDS cards
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ contract EcdsaAccount {

// Verify payload signature using Ethereum's signing scheme
// Note that noir expects the hash of the message/challenge as input to the ECDSA verification.
let hashed_message: [u8; 32] = std::hash::sha256_slice(outer_hash.to_be_bytes(32));
let outer_hash_bytes: [u8; 32] = outer_hash.to_be_bytes(32).as_array();
let hashed_message: [u8; 32] = std::hash::sha256(outer_hash_bytes);
let verification = std::ecdsa_secp256k1::verify_signature(public_key.x, public_key.y, signature, hashed_message);
assert(verification == true);

Expand Down
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 @@ -55,7 +55,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.73.0
uses: dtolnay/rust-toolchain@1.74.1

- uses: Swatinem/rust-cache@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions noir/noir-repo/.github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.73.0
uses: dtolnay/rust-toolchain@1.74.1
with:
targets: ${{ matrix.target }}
components: clippy, rustfmt
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.73.0
uses: dtolnay/rust-toolchain@1.74.1

- uses: Swatinem/rust-cache@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion noir/noir-repo/.github/workflows/gates_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.73.0
uses: dtolnay/rust-toolchain@1.74.1

- uses: Swatinem/rust-cache@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion noir/noir-repo/.github/workflows/publish-acvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
ref: ${{ inputs.noir-ref }}

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.73.0
uses: dtolnay/rust-toolchain@1.74.1

# These steps are in a specific order so crate dependencies are updated first
- name: Publish acir_field
Expand Down
6 changes: 3 additions & 3 deletions noir/noir-repo/.github/workflows/publish-es-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
ref: ${{ inputs.noir-ref }}

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.73.0
uses: dtolnay/rust-toolchain@1.74.1

- uses: Swatinem/rust-cache@v2
with:
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
ref: ${{ inputs.noir-ref }}

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.73.0
uses: dtolnay/rust-toolchain@1.74.1

- uses: Swatinem/rust-cache@v2
with:
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
ref: ${{ inputs.noir-ref }}

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.73.0
uses: dtolnay/rust-toolchain@1.74.1

- uses: Swatinem/rust-cache@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions noir/noir-repo/.github/workflows/publish-nargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx$(sw_vers -productVersion) --show-sdk-platform-version)" >> $GITHUB_ENV
- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.73.0
uses: dtolnay/rust-toolchain@1.74.1
with:
targets: ${{ matrix.target }}

Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
ref: ${{ inputs.tag || env.GITHUB_REF }}

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.73.0
uses: dtolnay/rust-toolchain@1.74.1
with:
targets: ${{ matrix.target }}

Expand Down
8 changes: 4 additions & 4 deletions noir/noir-repo/.github/workflows/test-js-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.73.0
uses: dtolnay/rust-toolchain@1.74.1

- uses: Swatinem/rust-cache@v2
with:
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.73.0
uses: dtolnay/rust-toolchain@1.74.1

- uses: Swatinem/rust-cache@v2
with:
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.73.0
uses: dtolnay/rust-toolchain@1.74.1

- uses: Swatinem/rust-cache@v2
with:
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.73.0
uses: dtolnay/rust-toolchain@1.74.1

- uses: Swatinem/rust-cache@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions noir/noir-repo/.github/workflows/test-rust-workspace-msrv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.73.0
uses: dtolnay/rust-toolchain@1.74.1
with:
targets: x86_64-unknown-linux-gnu

Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
- uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.73.0
uses: dtolnay/rust-toolchain@1.74.1
with:
targets: x86_64-unknown-linux-gnu

Expand Down
4 changes: 2 additions & 2 deletions noir/noir-repo/.github/workflows/test-rust-workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.73.0
uses: dtolnay/rust-toolchain@1.74.1
with:
targets: x86_64-unknown-linux-gnu

Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
- uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.73.0
uses: dtolnay/rust-toolchain@1.74.1
with:
targets: x86_64-unknown-linux-gnu

Expand Down
2 changes: 1 addition & 1 deletion noir/noir-repo/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
* reserve `unchecked` keyword ([#4432](https://github.com/noir-lang/noir/issues/4432))
* Remove empty value from bounded vec ([#4431](https://github.com/noir-lang/noir/issues/4431))
* Ban Fields in for loop indices and bitwise ops ([#4376](https://github.com/noir-lang/noir/issues/4376))
* bump msrv to 1.73.0 ([#4406](https://github.com/noir-lang/noir/issues/4406))
* Bump msrv to 1.73.0 ([#4406](https://github.com/noir-lang/noir/issues/4406))
* **ci:** Bump MSRV to 1.72.1 and enforce that ACVM can be published using updated lockfile ([#4385](https://github.com/noir-lang/noir/issues/4385))
* Restrict bit sizes ([#4235](https://github.com/noir-lang/noir/issues/4235))
* move noir out of yarn-project (https://github.com/AztecProtocol/aztec-packages/pull/4479)
Expand Down
33 changes: 28 additions & 5 deletions noir/noir-repo/Cargo.lock

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

11 changes: 10 additions & 1 deletion noir/noir-repo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ version = "0.27.0"
# x-release-please-end
authors = ["The Noir Team <team@noir-lang.org>"]
edition = "2021"
rust-version = "1.73.0"
rust-version = "1.74.1"
license = "MIT OR Apache-2.0"
repository = "https://github.com/noir-lang/noir/"

Expand Down Expand Up @@ -104,6 +104,14 @@ chumsky = { git = "https://github.com/jfecher/chumsky", rev = "ad9d312", default
"ahash",
"std",
] }

# Benchmarking
criterion = "0.5.0"
# Note that using the "frame-pointer" feature breaks framegraphs on linux
# https://github.com/tikv/pprof-rs/pull/172
pprof = { version = "0.13", features = ["flamegraph","criterion"] }


dirs = "4"
serde = { version = "1.0.136", features = ["derive"] }
serde_json = "1.0"
Expand All @@ -124,6 +132,7 @@ tempfile = "3.6.0"
jsonrpc = { version = "0.16.0", features = ["minreq_http"] }
flate2 = "1.0.24"

im = { version = "15.1", features = ["serde"] }
tracing = "0.1.40"
tracing-web = "0.1.3"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
Expand Down
Loading

0 comments on commit cea5107

Please sign in to comment.