Skip to content

Commit db641e7

Browse files
committed
Merge branch 'main' into dark-pool
2 parents 7b07a93 + 2966aa0 commit db641e7

File tree

13 files changed

+675
-295
lines changed

13 files changed

+675
-295
lines changed

apps/interface/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
"_chore": "pnpm i"
1515
},
1616
"dependencies": {
17-
"@aztec/aztec.js": "0.72.1",
18-
"@aztec/foundation": "0.72.1",
17+
"@aztec/aztec.js": "0.86.0",
18+
"@aztec/foundation": "0.86.0",
1919
"@hpke/core": "^1.7.1",
2020
"@hpke/dhkem-x25519": "^1.6.1",
21-
"@noir-lang/acvm_js": "1.0.0-beta.3",
22-
"@noir-lang/noir_js": "1.0.0-beta.3",
23-
"@noir-lang/noirc_abi": "1.0.0-beta.3",
21+
"@noir-lang/acvm_js": "1.0.0-beta.5",
22+
"@noir-lang/noir_js": "1.0.0-beta.5",
23+
"@noir-lang/noirc_abi": "1.0.0-beta.5",
2424
"@reown/walletkit": "^1.1.1",
2525
"@repo/contracts": "workspace:*",
2626
"@repo/ui": "workspace:*",

packages/contracts/hardhat.config.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import "@nomicfoundation/hardhat-toolbox";
22
import "hardhat-deploy";
3-
import "hardhat-plugin-noir";
3+
import "hardhat-noir";
44
import { HardhatUserConfig } from "hardhat/config";
55
import envConfig from "./envConfig";
66
import "./shared/typed-hardhat-deploy";
@@ -16,8 +16,7 @@ const config: HardhatUserConfig = {
1616
},
1717
},
1818
noir: {
19-
version: "1.0.0-beta.3",
20-
bbVersion: "0.72.1",
19+
version: "1.0.0-beta.5",
2120
},
2221
networks: {},
2322
etherscan: {

packages/contracts/noir/common/Nargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
name = "common"
33
type = "lib"
44
authors = ["Oleh Misarosh <[email protected]>"]
5-
compiler_version = ">=0.39.0"
65

76
[dependencies]
8-
protocol_types = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "aztec-packages-v0.72.1", directory = "noir-projects/noir-protocol-circuits/crates/types" }
9-
nodash = { tag = "v0.40.0", git = "https://github.com/olehmisar/nodash/" }
7+
protocol_types = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v0.86.0", directory = "noir-projects/noir-protocol-circuits/crates/types" }
8+
nodash = { tag = "v0.41.2", git = "https://github.com/olehmisar/nodash/" }

packages/contracts/noir/common/src/erc20_note.nr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// fails to compile if this file is moved to erc20 crate
22

33
use super::note::Note;
4-
use nodash::ArrayExtensions;
54
use protocol_types::traits::Serialize;
65

76
pub struct Erc20Note {

packages/contracts/noir/lob_router/src/lib.nr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
mod LobRouter {
2+
use common::OwnedNote;
3+
24
pub fn swap(
35
context: &mut common::Context,
46
seller_secret_key: Field,

packages/contracts/noir/rollup/Nargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
name = "rollup"
33
type = "bin"
44
authors = ["Oleh Misarosh <[email protected]"]
5-
compiler_version = ">=0.39.0"
65

76
[dependencies]
8-
protocol_types = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "aztec-packages-v0.72.1", directory = "noir-projects/noir-protocol-circuits/crates/types" }
7+
protocol_types = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v0.86.0", directory = "noir-projects/noir-protocol-circuits/crates/types" }
98
common = { path = "../common" }

packages/contracts/package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"hardhat": "^2.22.16",
3030
"hardhat-deploy": "^0.11.45",
3131
"hardhat-gas-reporter": "^1.0.10",
32-
"hardhat-plugin-noir": "^0.3.0-next.0",
32+
"hardhat-noir": "^0.5.0",
3333
"json-stringify-deterministic": "^1.0.12",
3434
"lodash": "^4.17.21",
3535
"ms": "^2.1.3",
@@ -43,19 +43,20 @@
4343
"typescript": "^5.3.3"
4444
},
4545
"dependencies": {
46-
"@aztec/aztec.js": "0.72.1",
47-
"@aztec/bb.js": "0.72.1",
48-
"@aztec/circuits.js": "0.72.1",
49-
"@aztec/foundation": "0.72.1",
50-
"@aztec/kv-store": "0.72.1",
51-
"@aztec/merkle-tree": "0.72.1",
46+
"@aztec/aztec.js": "0.86.0",
47+
"@aztec/bb.js": "0.86.0",
48+
"@aztec/foundation": "0.86.0",
49+
"@aztec/kv-store": "0.86.0",
50+
"@aztec/merkle-tree": "0.86.0",
51+
"@aztec/stdlib": "0.86.0",
5252
"@hpke/core": "^1.7.1",
5353
"@hpke/dhkem-x25519": "^1.6.1",
54-
"@noir-lang/noir_js": "1.0.0-beta.3",
54+
"@noir-lang/noir_js": "1.0.0-beta.5",
5555
"@repo/utils": "workspace:*",
5656
"ethers": "^6.13.4",
5757
"ky": "^1.7.2",
5858
"lodash-es": "^4.17.21",
59+
"ox": "^0.7.2",
5960
"p-queue": "^8.1.0",
6061
"smol-toml": "^1.3.1",
6162
"ts-essentials": "^9.4.1",

packages/contracts/sdk/NativeUltraHonkBackend.ts

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import type { ProofData } from "@aztec/bb.js";
22
import type { CompiledCircuit } from "@noir-lang/noir_js";
3+
import { chunk } from "lodash-es";
34
import { spawn } from "node:child_process";
45
import fs from "node:fs";
56
import path from "node:path";
6-
import { decodeNativeHonkProof } from "./utils.js";
7+
import { Hex } from "ox";
8+
import { assert } from "ts-essentials";
79

810
export class NativeUltraHonkBackend {
911
constructor(
@@ -32,13 +34,17 @@ export class NativeUltraHonkBackend {
3234
fs.writeFileSync(circuitJsonPath, JSON.stringify(this.circuit));
3335
fs.writeFileSync(witnessOutputPath, witness);
3436
const args = [
35-
"prove_ultra_keccak_honk",
37+
"prove",
38+
"--scheme",
39+
"ultra_honk",
3640
"-b",
3741
circuitJsonPath,
3842
"-w",
3943
witnessOutputPath,
4044
"-o",
4145
proofOutputPath,
46+
"--oracle_hash",
47+
"keccak",
4248
];
4349

4450
const bbProcess = spawn(this.bbPath, args);
@@ -57,10 +63,21 @@ export class NativeUltraHonkBackend {
5763
return;
5864
}
5965

60-
const proofData = decodeNativeHonkProof(
61-
fs.readFileSync(proofOutputPath),
66+
const proof = fs.readFileSync(path.join(proofOutputPath, "proof"));
67+
const publicInputs = fs.readFileSync(
68+
path.join(proofOutputPath, "public_inputs"),
6269
);
63-
resolve(proofData);
70+
assert(
71+
publicInputs.length % 32 === 0,
72+
"publicInputs length must be divisible by 32",
73+
);
74+
resolve({
75+
proof,
76+
// TODO: not sure if this publicInputs decoding is correct
77+
publicInputs: chunk(Array.from(publicInputs), 32).map((x) =>
78+
Hex.fromBytes(Uint8Array.from(x)),
79+
),
80+
});
6481
});
6582

6683
bbProcess.on("error", (err) => {

packages/contracts/sdk/NonMembershipTree.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export class NonMembershipTree {
1515
"@aztec/merkle-tree"
1616
);
1717
const { NullifierLeaf, NullifierLeafPreimage } = await import(
18-
"@aztec/circuits.js"
18+
// @ts-ignore hardhat does not support ESM
19+
"@aztec/stdlib/trees"
1920
);
2021
// @ts-ignore hardhat does not support ESM
2122
const { AztecLmdbStore } = await import("@aztec/kv-store/lmdb");
@@ -96,7 +97,7 @@ export class NonMembershipTree {
9697
leaf_index: bigIntToString(lowLeafIndex),
9798
sibling_path: lowLeafSiblingPath
9899
.toFields()
99-
.map((x) => bigIntToString(x.toBigInt())),
100+
.map((x: Fr) => bigIntToString(x.toBigInt())),
100101
},
101102
};
102103
return witness;

packages/contracts/sdk/backendSdk.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { UltraHonkBackend } from "@aztec/bb.js";
2+
import type { CompiledCircuit } from "@noir-lang/noir_js";
23
import { utils } from "@repo/utils";
34
import os from "node:os";
45
import type { AsyncOrSync } from "ts-essentials";
56
import { NativeUltraHonkBackend } from "./NativeUltraHonkBackend";
67
import { RollupService } from "./RollupOnlyService";
7-
import { type CompiledCircuit, createCoreSdk } from "./sdk";
8+
import { createCoreSdk } from "./sdk";
89
import type { TreesService } from "./TreesService";
910

1011
export function createBackendSdk(

0 commit comments

Comments
 (0)