Skip to content

Commit 81c07ea

Browse files
committed
Merge branch 'main' into dark-pool
2 parents c7111d2 + f29fbd6 commit 81c07ea

File tree

13 files changed

+163
-509
lines changed

13 files changed

+163
-509
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.67.0",
18-
"@aztec/foundation": "0.67.0",
17+
"@aztec/aztec.js": "0.72.1",
18+
"@aztec/foundation": "0.72.1",
1919
"@hpke/core": "^1.7.1",
2020
"@hpke/dhkem-x25519": "^1.6.1",
21-
"@noir-lang/acvm_js": "1.0.0-beta.1",
22-
"@noir-lang/noir_js": "1.0.0-beta.1",
23-
"@noir-lang/noirc_abi": "1.0.0-beta.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",
2424
"@reown/walletkit": "^1.1.1",
2525
"@repo/contracts": "workspace:*",
2626
"@repo/ui": "workspace:*",

packages/contracts/hardhat.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ const config: HardhatUserConfig = {
1616
},
1717
},
1818
noir: {
19-
version: "1.0.0-beta.1",
20-
bbVersion: "0.67.0",
19+
version: "1.0.0-beta.3",
20+
bbVersion: "0.72.1",
2121
},
2222
networks: {},
2323
etherscan: {

packages/contracts/noir/common/Nargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ authors = ["Oleh Misarosh <olehmisar@gmail.com>"]
55
compiler_version = ">=0.39.0"
66

77
[dependencies]
8-
protocol_types = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "aztec-packages-v0.67.0", directory = "noir-projects/noir-protocol-circuits/crates/types" }
9-
nodash = { tag = "v0.39.4", git = "https://github.com/olehmisar/nodash/" }
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/" }

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

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

3+
use super::note::Note;
4+
use nodash::ArrayExtensions;
5+
use protocol_types::traits::Serialize;
6+
37
pub struct Erc20Note {
48
pub owner: crate::WaAddress,
59
pub amount: crate::TokenAmount,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use protocol_types::hash::poseidon2_hash_with_separator;
33
mod context;
44
mod uint252;
55
mod erc20_note;
6-
mod note;
6+
pub(crate) mod note;
77
mod owned_note;
88

99
pub use context::{Context, Result};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use protocol_types::hash::poseidon2_hash_with_separator;
33
/// A marker trait to mark structs as notes
44
pub trait Note: crate::Serialize<_> {
55

6-
pub fn emit(self, context: &mut crate::Context) {
6+
fn emit(self, context: &mut crate::Context) {
77
context.push_note_hash(crate::compute_note_hash(self));
88
}
99
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
pub use common::erc20_note::{Erc20Note, Erc20NoteConsumptionInputs};
22

33
pub mod Token {
4+
use common::Note;
5+
46
pub fn mint(
57
context: &mut common::Context,
68
to: common::WaAddress,

packages/contracts/noir/rollup/Nargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ authors = ["Oleh Misarosh <olehmisar@gmail.com"]
55
compiler_version = ">=0.39.0"
66

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

packages/contracts/noir/rollup/src/main.nr

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,18 @@ fn main(
2929
);
3030
assert(new_note_hash_tree == expected_new_note_hash_tree, "Invalid new note hash tree");
3131

32-
let new_nullifier_tree = compute_new_nullifier_tree_snapshot(
33-
nullifier_tree,
34-
new_nullifiers,
35-
sorted_nullifiers,
36-
sorted_nullifiers_indexes,
37-
nullifier_subtree_sibling_path,
38-
nullifier_low_leaf_preimages,
39-
nullifier_low_leaf_membership_witnesses,
40-
);
32+
// Safety: TODO(security): constrain this call. This is unconstrained because it's very expensive, so we mark it unconstrained while in active development
33+
let new_nullifier_tree = unsafe {
34+
compute_new_nullifier_tree_snapshot(
35+
nullifier_tree,
36+
new_nullifiers,
37+
sorted_nullifiers,
38+
sorted_nullifiers_indexes,
39+
nullifier_subtree_sibling_path,
40+
nullifier_low_leaf_preimages,
41+
nullifier_low_leaf_membership_witnesses,
42+
)
43+
};
4144
assert(new_nullifier_tree == expected_new_nullifier_tree, "Invalid new nullifier tree");
4245
}
4346

packages/contracts/noir/run.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@ timeEnd "mpc-generate-witness"
4242

4343
# run proving in MPC
4444
timeStart "mpc-build-proving-key"
45-
co-noir build-proving-key --witness target/witness.gz.0.shared --circuit $CIRCUIT --crs bn254_g1.dat --protocol REP3 --config configs/party0.toml --out target/proving_key.0 &
46-
co-noir build-proving-key --witness target/witness.gz.1.shared --circuit $CIRCUIT --crs bn254_g1.dat --protocol REP3 --config configs/party1.toml --out target/proving_key.1 &
47-
co-noir build-proving-key --witness target/witness.gz.2.shared --circuit $CIRCUIT --crs bn254_g1.dat --protocol REP3 --config configs/party2.toml --out target/proving_key.2
45+
co-noir build-proving-key --witness target/witness.gz.0.shared --circuit $CIRCUIT --protocol REP3 --config configs/party0.toml --out target/proving_key.0 &
46+
co-noir build-proving-key --witness target/witness.gz.1.shared --circuit $CIRCUIT --protocol REP3 --config configs/party1.toml --out target/proving_key.1 &
47+
co-noir build-proving-key --witness target/witness.gz.2.shared --circuit $CIRCUIT --protocol REP3 --config configs/party2.toml --out target/proving_key.2
4848
wait $(jobs -p)
4949
timeEnd "mpc-build-proving-key"
5050

5151
timeStart "mpc-generate-proof"
52-
co-noir generate-proof --proving-key target/proving_key.0 --protocol REP3 --hasher KECCAK --config configs/party0.toml --out target/proof.0.proof --public-input target/public_input.json &
53-
co-noir generate-proof --proving-key target/proving_key.1 --protocol REP3 --hasher KECCAK --config configs/party1.toml --out target/proof.1.proof &
54-
co-noir generate-proof --proving-key target/proving_key.2 --protocol REP3 --hasher KECCAK --config configs/party2.toml --out target/proof.2.proof
52+
co-noir generate-proof --proving-key target/proving_key.0 --protocol REP3 --hasher KECCAK --crs ~/.bb-crs/bn254_g1.dat --config configs/party0.toml --out target/proof.0.proof --public-input target/public_input.json &
53+
co-noir generate-proof --proving-key target/proving_key.1 --protocol REP3 --hasher KECCAK --crs ~/.bb-crs/bn254_g1.dat --config configs/party1.toml --out target/proof.1.proof &
54+
co-noir generate-proof --proving-key target/proving_key.2 --protocol REP3 --hasher KECCAK --crs ~/.bb-crs/bn254_g1.dat --config configs/party2.toml --out target/proof.2.proof
5555
wait $(jobs -p)
5656
timeEnd "mpc-generate-proof"
5757

0 commit comments

Comments
 (0)