Skip to content

Commit

Permalink
Merge pull request #49 from noir-lang/jc/update
Browse files Browse the repository at this point in the history
update to nargo 0.11.0, bbjs 0.5.1
  • Loading branch information
critesjosh authored Sep 8, 2023
2 parents 5e1a277 + 63bba45 commit ba430a1
Show file tree
Hide file tree
Showing 15 changed files with 414 additions and 350 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/with_foundry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install Nargo
uses: noir-lang/[email protected]
with:
toolchain: 0.9.0
toolchain: 0.11.0

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
Expand All @@ -31,7 +31,7 @@ jobs:

- name: Generate proof
run: |
nargo prove p
nargo prove
working-directory: with-foundry/circuits

- name: Test with Foundry
Expand Down
8 changes: 6 additions & 2 deletions next-hardhat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ It also features multiple files and different entry points by resolving multiple
curl -L https://raw.githubusercontent.com/noir-lang/noirup/main/install | bash
```

4. Install Nargo v0.10.1 with
4. Install Nargo v0.11.0 with

```bash
noirup -v 0.10.1
noirup -v 0.11.0
```

If you had a lower version of `nargo` installed previously and are running into errors when
compiling, you may need to uninstall it, instructions
[here](https://noir-lang.org/getting_started/nargo_installation#uninstalling-nargo).

5. Install dependencies with

```bash
Expand Down
2 changes: 1 addition & 1 deletion next-hardhat/circuits/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
name = "noirstarter"
type = "bin"
authors = [""]
compiler_version = "0.10.1"
compiler_version = "0.11.0"

[dependencies]
2 changes: 1 addition & 1 deletion next-hardhat/circuits/target/noirstarter.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"backend":"acvm-backend-barretenberg","abi":{"parameters":[{"name":"x","type":{"kind":"field"},"visibility":"private"},{"name":"y","type":{"kind":"field"},"visibility":"public"}],"param_witnesses":{"x":[1],"y":[2]},"return_type":null,"return_witnesses":[]},"bytecode":"H4sIAAAAAAAA/7WTMRLEIAhFMYkp9ywgGrHbq6yz5v5H2JkdCyaxC9LgWDw+H9gBwMM91p7fPeOzIKdYjEeMLYdGTB8MpUrCmOohJJQkfYMwN4mSSy0ZC0VudKbCZ4cthqzVrsc/yw28dMZeWmrWerfBexnsxD6hJ7jUufr4GvyZFp8xpG0C14Pd8s/q29vPCBXypvmpDx7sD8opnfqIfsM1RNtxBQAA","proving_key":null,"verification_key":null}
{"backend":"acvm-backend-barretenberg","abi":{"parameters":[{"name":"x","type":{"kind":"field"},"visibility":"private"},{"name":"y","type":{"kind":"field"},"visibility":"public"}],"param_witnesses":{"x":[1],"y":[2]},"return_type":null,"return_witnesses":[]},"bytecode":"H4sIAAAAAAAA/7VTQQ6EIAwsKh73LS0FKbf9ypLF/z/BxGBClJtlLiUcpjPTdgUAC0/MtX5rxXcg03Axbt6X6Aox/dClLAF9yJuQUJDwd8JcxEtMOUVM5LnQHhLvlWxS5Jr1PJ5cppOlUc5SU3Ord+m8p85OrAM8wa3PPcdP50+1+YghLQN4Legt/yjfVn9G2FA+NL/NwYL+QZlGZ3tEFw56E7wBeQUAAA=="}
2 changes: 1 addition & 1 deletion next-hardhat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test": "hardhat compile && vitest"
},
"dependencies": {
"@aztec/bb.js": "0.3.6",
"@aztec/bb.js": "0.5.1",
"@noir-lang/acvm_js": "git+https://[email protected]/noir-lang/acvm-js-wasm.git#b9d9ca9dfc5140839f23998d9466307215607c42",
"@nomicfoundation/hardhat-chai-matchers": "^1.0.6",
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion next-hardhat/utils/addresses.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"chainId":31337,"verifier":"0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0"}
{"chainId":31337,"verifier":"0x5FbDB2315678afecb367f032d93F642f64180aa3"}
10 changes: 5 additions & 5 deletions next-hardhat/utils/noir/noirBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// import { compile } from '@noir-lang/noir_wasm';
import { decompressSync } from 'fflate';
import {
BarretenbergApiAsync,
Crs,
newBarretenbergApiAsync,
Barretenberg,
RawBuffer,
} from '@aztec/bb.js/dest/browser/index.js';
// @ts-ignore
} from '@aztec/bb.js';
import initACVM, { executeCircuit, compressWitness } from '@noir-lang/acvm_js';
import { ethers } from 'ethers'; // I'm lazy so I'm using ethers to pad my input
import circuit from '../../circuits/target/noirstarter.json';
Expand All @@ -17,7 +17,7 @@ export class NoirBrowser {
acirBuffer: Uint8Array = Uint8Array.from([]);
acirBufferUncompressed: Uint8Array = Uint8Array.from([]);

api = {} as BarretenbergApiAsync;
api = {} as Barretenberg;
acirComposer = {} as Ptr;

async init() {
Expand All @@ -29,7 +29,7 @@ export class NoirBrowser {
this.acirBuffer = Buffer.from(circuit.bytecode, 'base64');
this.acirBufferUncompressed = decompressSync(this.acirBuffer);

this.api = await newBarretenbergApiAsync(4);
this.api = await Barretenberg.new(4);

const [exact, total, subgroup] = await this.api.acirGetCircuitSizes(
this.acirBufferUncompressed,
Expand Down
10 changes: 5 additions & 5 deletions next-hardhat/utils/noir/noirNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// import { compile } from '@noir-lang/noir_wasm';
import { decompressSync } from 'fflate';
import {
BarretenbergApiAsync,
Barretenberg,
Crs,
newBarretenbergApiAsync,
RawBuffer,
} from '@aztec/bb.js/dest/node/index.js';
// @ts-ignore
} from '@aztec/bb.js';
import { executeCircuit, compressWitness } from '@noir-lang/acvm_js';
import { ethers } from 'ethers'; // I'm lazy so I'm using ethers to pad my input
import circuit from '../../circuits/target/noirstarter.json';
Expand All @@ -17,7 +17,7 @@ export class NoirNode {
acirBuffer: Uint8Array = Uint8Array.from([]);
acirBufferUncompressed: Uint8Array = Uint8Array.from([]);

api = {} as BarretenbergApiAsync;
api = {} as Barretenberg;
acirComposer = {} as Ptr;

async init() {
Expand All @@ -28,7 +28,7 @@ export class NoirNode {
this.acirBuffer = Buffer.from(circuit.bytecode, 'base64');
this.acirBufferUncompressed = decompressSync(this.acirBuffer);

this.api = await newBarretenbergApiAsync(4);
this.api = await Barretenberg.new(4);

const [exact, total, subgroup] = await this.api.acirGetCircuitSizes(
this.acirBufferUncompressed,
Expand Down
Loading

0 comments on commit ba430a1

Please sign in to comment.