Skip to content

Commit

Permalink
git subrepo pull (merge) --force --branch=jf/brillig-cow-assign2 ./no…
Browse files Browse the repository at this point in the history
…ir/noir-repo

subrepo:
  subdir:   "noir/noir-repo"
  merged:   "85ba5f688e"
upstream:
  origin:   "https://github.com/noir-lang/noir"
  branch:   "jf/brillig-cow-assign2"
  commit:   "85ba5f688e"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???"
  • Loading branch information
sirasistant committed Mar 11, 2024
1 parent f6d17c9 commit bbe25fc
Show file tree
Hide file tree
Showing 63 changed files with 384 additions and 684 deletions.
2 changes: 1 addition & 1 deletion noir/noir-repo/.aztec-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
73d640a4a033f0c865d45da470ef40c1fb03a844
9e246c1289fa40c35c4b28d2f0081dfdc2aa9d19
27 changes: 27 additions & 0 deletions noir/noir-repo/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Dockerfile*
.dockerignore

# Yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

packages
**/package.tgz
**/target
**/node_modules
**/outputs

# Noir.js
tooling/noir_js/lib

# Wasm build artifacts
compiler/wasm/nodejs
compiler/wasm/web
tooling/noirc_abi_wasm/nodejs
tooling/noirc_abi_wasm/web
tooling/noir_js/lib
3 changes: 3 additions & 0 deletions noir/noir-repo/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,8 @@ tooling/noirc_abi_wasm/nodejs
tooling/noirc_abi_wasm/web
tooling/noir_js/lib

**/package.tgz
packages

# docs autogen build
/docs/docs/noir_js/reference/
6 changes: 3 additions & 3 deletions noir/noir-repo/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
;
[subrepo]
remote = https://github.com/noir-lang/noir
branch = master
commit = 5f57ebb7ff4b810802f90699a10f4325ef904f2e
parent = 8307dadd853d5091841e169c841ab6b09c223efb
branch = jf/brillig-cow-assign2
commit = 85ba5f688e0a6cd8507a4afce00f538ffd949016
parent = f6d17c972d2cf9c5aa468c8cf954431b42240f87
method = merge
cmdver = 0.4.6
24 changes: 2 additions & 22 deletions noir/noir-repo/Cargo.lock

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

4 changes: 1 addition & 3 deletions noir/noir-repo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ members = [
"tooling/nargo_toml",
"tooling/noirc_abi",
"tooling/noirc_abi_wasm",
"tooling/acvm_cli",
# ACVM
"acvm-repo/acir_field",
"acvm-repo/acir",
Expand All @@ -37,7 +36,7 @@ members = [
"acvm-repo/blackbox_solver",
"acvm-repo/bn254_blackbox_solver",
]
default-members = ["tooling/nargo_cli", "tooling/acvm_cli"]
default-members = ["tooling/nargo_cli"]
resolver = "2"

[workspace.package]
Expand Down Expand Up @@ -79,7 +78,6 @@ noir_lsp = { path = "tooling/lsp" }
noir_debugger = { path = "tooling/debugger" }
noirc_abi = { path = "tooling/noirc_abi" }
bb_abstraction_leaks = { path = "tooling/bb_abstraction_leaks" }
acvm_cli = { path = "tooling/acvm_cli" }

# LSP
async-lsp = { version = "0.1.0", default-features = false }
Expand Down
12 changes: 12 additions & 0 deletions noir/noir-repo/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM rust:bullseye
WORKDIR /usr/src/noir
COPY . .
RUN ./scripts/bootstrap_native.sh

# When running the container, mount the users home directory to same location.
FROM ubuntu:focal
# Install Tini as nargo doesn't handle signals properly.
# Install git as nargo needs it to clone.
RUN apt-get update && apt-get install -y git tini && rm -rf /var/lib/apt/lists/* && apt-get clean
COPY --from=0 /usr/src/noir/target/release/nargo /usr/src/noir/target/release/nargo
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/src/noir/target/release/nargo"]
22 changes: 22 additions & 0 deletions noir/noir-repo/Dockerfile.packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM rust:alpine3.17
RUN apk update \
&& apk upgrade \
&& apk add --no-cache \
build-base \
pkgconfig \
openssl-dev \
npm \
yarn \
bash \
jq \
git \
curl

WORKDIR /usr/src/noir
COPY . .
RUN ./scripts/bootstrap_packages.sh

FROM scratch
COPY --from=0 /usr/src/noir/packages /usr/src/noir/packages
# For some unknown reason, on alpine only, we need this to exist.
COPY --from=0 /usr/src/noir/node_modules/@noir-lang /usr/src/noir/node_modules/@noir-lang
12 changes: 6 additions & 6 deletions noir/noir-repo/acvm-repo/acvm/src/compiler/optimizers/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use acir::circuit::{Circuit, Opcode};

// mod constant_backpropagation;
mod constant_backpropagation;
mod general;
mod redundant_range;
mod unused_memory;
Expand All @@ -9,7 +9,7 @@ pub(crate) use general::GeneralOptimizer;
pub(crate) use redundant_range::RangeOptimizer;
use tracing::info;

// use self::constant_backpropagation::ConstantBackpropagationOptimizer;
use self::constant_backpropagation::ConstantBackpropagationOptimizer;
use self::unused_memory::UnusedMemoryOptimizer;

use super::{transform_assert_messages, AcirTransformationMap};
Expand Down Expand Up @@ -58,16 +58,16 @@ pub(super) fn optimize_internal(acir: Circuit) -> (Circuit, Vec<usize>) {
let (acir, acir_opcode_positions) =
memory_optimizer.remove_unused_memory_initializations(acir_opcode_positions);

// let (acir, acir_opcode_positions) =
// ConstantBackpropagationOptimizer::backpropagate_constants(acir, acir_opcode_positions);
let (acir, acir_opcode_positions) =
ConstantBackpropagationOptimizer::backpropagate_constants(acir, acir_opcode_positions);

// Range optimization pass
let range_optimizer = RangeOptimizer::new(acir);
let (acir, acir_opcode_positions) =
range_optimizer.replace_redundant_ranges(acir_opcode_positions);

// let (acir, acir_opcode_positions) =
// ConstantBackpropagationOptimizer::backpropagate_constants(acir, acir_opcode_positions);
let (acir, acir_opcode_positions) =
ConstantBackpropagationOptimizer::backpropagate_constants(acir, acir_opcode_positions);

info!("Number of opcodes after: {}", acir.opcodes.len());

Expand Down
12 changes: 2 additions & 10 deletions noir/noir-repo/acvm-repo/acvm_js/test/node/build_info.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,12 @@ import { BuildInfo, buildInfo } from '@noir-lang/acvm_js';
import child_process from 'child_process';
import pkg from '../../package.json';

it('returns the correct build info', () => {
let revision: string;

try {
revision = child_process.execSync('git rev-parse HEAD').toString().trim();
} catch (error) {
console.log('Failed to get revision, skipping test.');
return;
}

it('returns the correct build into', () => {
const info: BuildInfo = buildInfo();

// TODO: enforce that `package.json` and `Cargo.toml` are consistent.
expect(info.version).to.be.eq(pkg.version);

const revision = child_process.execSync('git rev-parse HEAD').toString().trim();
expect(info.gitHash).to.be.eq(revision);
});
Loading

0 comments on commit bbe25fc

Please sign in to comment.