Skip to content

Commit

Permalink
feat: Sync from noir (#12315)
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!: bump rust edition to 2024
(noir-lang/noir#7533)
chore: revert bump of base64ct to `v1.6.0` after `v1.7.0` yanked
(noir-lang/noir#7541)
feat(performance): Avoid extra Brillig array offsetting for constant
indices (noir-lang/noir#7522)
feat: test error spans and messages
(noir-lang/noir#7526)
chore: bump wasm-bindgen (noir-lang/noir#7535)
chore: parallelize `test_transform_program_is_idempotent`
(noir-lang/noir#7539)
chore(cli): Use `noir_artifact_cli::fs` to read artifacts
(noir-lang/noir#7391)
fix(experimental): Replace most remaining match panics with errors
(noir-lang/noir#7536)
chore: bump external pinned commits
(noir-lang/noir#7537)
END_COMMIT_OVERRIDE

---------

Co-authored-by: Tom French <[email protected]>
Co-authored-by: guipublic <[email protected]>
Co-authored-by: Tom French <[email protected]>
Co-authored-by: guipublic <[email protected]>
  • Loading branch information
5 people authored Mar 4, 2025
1 parent ce24b7b commit 1dc6641
Show file tree
Hide file tree
Showing 103 changed files with 1,911 additions and 2,692 deletions.
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 <[email protected]>"]
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
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 [email protected].86 --force --no-confirm
cargo binstall [email protected].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: [email protected].86
tool: [email protected].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: [email protected].86
tool: [email protected].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: [email protected].86
tool: [email protected].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
71 changes: 42 additions & 29 deletions noir/noir-repo/Cargo.lock

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

8 changes: 4 additions & 4 deletions noir/noir-repo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ resolver = "2"
version = "1.0.0-beta.3"
# x-release-please-end
authors = ["The Noir Team <[email protected]>"]
edition = "2021"
edition = "2024"
rust-version = "1.85.0"
license = "MIT OR Apache-2.0"
repository = "https://github.com/noir-lang/noir/"
Expand Down Expand Up @@ -116,9 +116,9 @@ lsp-types = "0.94.1"
tower = "0.4"

# Wasm
wasm-bindgen = { version = "=0.2.86", features = ["serde-serialize"] }
wasm-bindgen-test = "0.3.36"
wasm-bindgen-futures = "0.4.36"
wasm-bindgen = { version = "=0.2.100", features = ["serde-serialize"] }
wasm-bindgen-test = "0.3.50"
wasm-bindgen-futures = "0.4.50"
console_error_panic_hook = "0.1.7"
gloo-utils = { version = "0.1", features = ["serde"] }
js-sys = "0.3.62"
Expand Down
2 changes: 1 addition & 1 deletion noir/noir-repo/EXTERNAL_NOIR_LIBRARIES.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define: &AZ_COMMIT 17e79f42c0a1895dc87a74e4155591e38c45f09b
define: &AZ_COMMIT a90f08e245add379fa0257c81f8e2819beb190cb
libraries:
noir_check_shuffle:
repo: noir-lang/noir_check_shuffle
Expand Down
4 changes: 2 additions & 2 deletions noir/noir-repo/acvm-repo/acir/src/circuit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ impl<F: Serialize> Program<F> {
program_bytes
}

// Serialize and base64 encode program
/// Serialize and base64 encode program
pub fn serialize_program_base64<S>(program: &Self, s: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
Expand All @@ -277,7 +277,7 @@ impl<F: for<'a> Deserialize<'a>> Program<F> {
Program::read(serialized_circuit)
}

// Deserialize and base64 decode program
/// Deserialize and base64 decode program
pub fn deserialize_program_base64<'de, D>(deserializer: D) -> Result<Self, D::Error>
where
D: Deserializer<'de>,
Expand Down
2 changes: 1 addition & 1 deletion noir/noir-repo/acvm-repo/acvm/src/pwg/blackbox/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn first_missing_assignment<F>(
inputs: &[FunctionInput<F>],
) -> Option<Witness> {
inputs.iter().find_map(|input| {
if let ConstantOrWitnessEnum::Witness(ref witness) = input.input_ref() {
if let ConstantOrWitnessEnum::Witness(witness) = input.input_ref() {
if witness_assignments.contains_key(witness) { None } else { Some(*witness) }
} else {
None
Expand Down
2 changes: 1 addition & 1 deletion noir/noir-repo/acvm-repo/acvm_js/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ getrandom = { workspace = true, features = ["js"] }
build-data.workspace = true
pkg-config = "0.3"

[dev-dependencies]
[target.'cfg(all(any(target_arch = "wasm32", target_arch = "wasm64"), target_os = "unknown"))'.dev-dependencies]
wasm-bindgen-test.workspace = true

[features]
Expand Down
6 changes: 3 additions & 3 deletions noir/noir-repo/acvm-repo/acvm_js/src/js_witness_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ pub(crate) fn field_element_to_js_string(field_element: &FieldElement) -> JsStri
format!("0x{}", field_element.to_hex()).into()
}

#[cfg(test)]
#[cfg(all(test, any(target_arch = "wasm32", target_arch = "wasm64"), target_os = "unknown"))]
mod test {
use wasm_bindgen_test::wasm_bindgen_test as test;
use wasm_bindgen_test::*;

use std::collections::BTreeMap;

Expand All @@ -120,7 +120,7 @@ mod test {

use crate::JsWitnessMap;

#[test]
#[wasm_bindgen_test]
fn test_witness_map_to_js() {
let witness_map = BTreeMap::from([
(Witness(1), FieldElement::one()),
Expand Down
Loading

0 comments on commit 1dc6641

Please sign in to comment.