Skip to content

Commit

Permalink
[1 changes] chore: fix alerts on rust msrv (noir-lang/noir#4817)
Browse files Browse the repository at this point in the history
chore(ci): fix alerts on msrv issues (noir-lang/noir#4816)
chore: run clippy (noir-lang/noir#4810)
chore: optimize poseidon2 implementation (noir-lang/noir#4807)
fix: catch panics from EC point creation (e.g. the point is at infinity) (noir-lang/noir#4790)
feat: Sync from aztec-packages (noir-lang/noir#4792)
feat: lalrpop lexer prototype (noir-lang/noir#4656)
feat(nargo): Handle call stacks for multiple Acir calls (noir-lang/noir#4711)
fix: proper field inversion for bigints (noir-lang/noir#4802)
feat: add `NARGO_FOREIGN_CALL_TIMEOUT` environment variable (noir-lang/noir#4780)
chore(debugger): Docs (noir-lang/noir#4145)
feat: narrow ABI encoding errors down to target problem argument/field (noir-lang/noir#4798)
chore: Rename 'global' to 'function' in the monomorphization pass (noir-lang/noir#4774)
chore: Add Hir -> Ast conversion (noir-lang/noir#4788)
fix: Fix panic when returning a zeroed unit value (noir-lang/noir#4797)
  • Loading branch information
AztecBot committed Apr 16, 2024
1 parent 1dfbe7b commit 0d7d3f4
Show file tree
Hide file tree
Showing 94 changed files with 2,857 additions and 1,271 deletions.
2 changes: 1 addition & 1 deletion .noir-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1d96937a8e94a91c0c17c97102498d067fca76c3
053d5e8879865c25ac2bfcfd206a6b729d328b9c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ jobs:
# We treat any cancelled, 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') }}

- name: Checkout
if: ${{ failure() }}
uses: actions/checkout@v4

# Raise an issue if the tests failed
- name: Alert on failed publish
uses: JasonEtco/create-an-issue@v2
Expand All @@ -122,4 +126,4 @@ jobs:
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
update_existing: true
filename: .github/JS_PUBLISH_FAILED.md
filename: .github/ACVM_NOT_PUBLISHABLE.md
1 change: 1 addition & 0 deletions noir/noir-repo/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ examples/**/target/
examples/9
node_modules
pkg/
.idea

# Yarn
.pnp.*
Expand Down
127 changes: 118 additions & 9 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/acvm-repo/acir/src/circuit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ impl Circuit {
}
}

#[derive(Debug, Copy, Clone)]
/// The opcode location for a call to a separate ACIR circuit
/// This includes the function index of the caller within a [program][Program]
/// and the index in the callers ACIR to the specific call opcode.
/// This is only resolved and set during circuit execution.
pub struct ResolvedOpcodeLocation {
pub acir_function_index: usize,
pub opcode_location: OpcodeLocation,
}

#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)]
/// Opcodes are locatable so that callers can
/// map opcodes to debug information related to their context.
Expand Down
2 changes: 1 addition & 1 deletion noir/noir-repo/acvm-repo/acvm/src/pwg/blackbox/bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl BigIntSolver {
}
BlackBoxFunc::BigIntMul => lhs * rhs,
BlackBoxFunc::BigIntDiv => {
lhs * rhs.modpow(&(&modulus - BigUint::from(1_u32)), &modulus)
lhs * rhs.modpow(&(&modulus - BigUint::from(2_u32)), &modulus)
} //TODO ensure that modulus is prime
_ => unreachable!("ICE - bigint_op must be called for an operation"),
};
Expand Down
5 changes: 3 additions & 2 deletions noir/noir-repo/acvm-repo/acvm_js/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function run_if_available {
require_command jq
require_command cargo
require_command wasm-bindgen
require_command wasm-opt

self_path=$(dirname "$(readlink -f "$0")")
pname=$(cargo read-manifest | jq -r '.name')
Expand All @@ -48,5 +49,5 @@ BROWSER_WASM=${BROWSER_DIR}/${pname}_bg.wasm
run_or_fail cargo build --lib --release --target $TARGET --package ${pname}
run_or_fail wasm-bindgen $WASM_BINARY --out-dir $NODE_DIR --typescript --target nodejs
run_or_fail wasm-bindgen $WASM_BINARY --out-dir $BROWSER_DIR --typescript --target web
run_if_available wasm-opt $NODE_WASM -o $NODE_WASM -O
run_if_available wasm-opt $BROWSER_WASM -o $BROWSER_WASM -O
run_or_fail wasm-opt $NODE_WASM -o $NODE_WASM -O
run_or_fail wasm-opt $BROWSER_WASM -o $BROWSER_WASM -O
15 changes: 14 additions & 1 deletion noir/noir-repo/acvm-repo/bn254_blackbox_solver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ repository.workspace = true
acir.workspace = true
acvm_blackbox_solver.workspace = true
thiserror.workspace = true
num-traits.workspace = true
cfg-if = "1.0.0"
hex.workspace = true
lazy_static = "1.4"

# BN254 fixed base scalar multiplication solver
grumpkin = { version = "0.1.0", package = "noir_grumpkin", features = ["std"] }
Expand All @@ -38,6 +39,18 @@ js-sys.workspace = true
getrandom.workspace = true
wasmer = "4.2.6"

[dev-dependencies]
criterion = "0.5.0"
pprof = { version = "0.12", features = [
"flamegraph",
"frame-pointer",
"criterion",
] }

[[bench]]
name = "criterion"
harness = false

[features]
default = ["bn254"]
bn254 = ["acir/bn254"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use criterion::{criterion_group, criterion_main, Criterion};
use std::{hint::black_box, time::Duration};

use acir::FieldElement;
use bn254_blackbox_solver::poseidon2_permutation;

use pprof::criterion::{Output, PProfProfiler};

fn bench_poseidon2(c: &mut Criterion) {
let inputs = [FieldElement::zero(); 4];

c.bench_function("poseidon2", |b| b.iter(|| poseidon2_permutation(black_box(&inputs), 4)));
}

criterion_group!(
name = benches;
config = Criterion::default().sample_size(40).measurement_time(Duration::from_secs(20)).with_profiler(PProfProfiler::new(100, Output::Flamegraph(None)));
targets = bench_poseidon2
);

criterion_main!(benches);
Loading

0 comments on commit 0d7d3f4

Please sign in to comment.