Skip to content

Commit

Permalink
refactor: Make noir-circuit independent of aztec-nr (#3591)
Browse files Browse the repository at this point in the history
Fixes #3589 by adding constants to `protocol-circuits` and removing them
from `aztec-nr`. The importing looks a bit clunky after since reexports
of modules did not seem to work in noir #3590.
  • Loading branch information
LHerskind authored Dec 6, 2023
1 parent 4b7dc68 commit 3013354
Show file tree
Hide file tree
Showing 122 changed files with 259 additions and 201 deletions.
4 changes: 2 additions & 2 deletions docs/docs/dev_docs/contracts/syntax/storage/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ An example of how to use this operation is visible in the `easy_private_state`:

This function returns the notes the account has access to.

The kernel circuits are constrained to a maximum number of notes this function can return at a time. Check [here](https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/aztec-nr/aztec/src/constants_gen.nr) and look for `MAX_READ_REQUESTS_PER_CALL` for the up-to-date number.
The kernel circuits are constrained to a maximum number of notes this function can return at a time. Check [here](https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/noir-protocol-circuits/src/crates/types/src/constants.nr) and look for `MAX_READ_REQUESTS_PER_CALL` for the up-to-date number.

Because of this limit, we should always consider using the second argument `NoteGetterOptions` to limit the number of notes we need to read and constrain in our programs. This is quite important as every extra call increases the time used to prove the program and we don't want to spend more time than necessary.

Expand All @@ -430,7 +430,7 @@ Functionally similar to [`get_notes`](#get_notes), but executed unconstrained an

#include_code view_notes /yarn-project/aztec-nr/value-note/src/balance_utils.nr rust

There's also a limit on the maximum number of notes that can be returned in one go. To find the current limit, refer to [this file](https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/aztec-nr/aztec/src/constants_gen.nr) and look for `MAX_NOTES_PER_PAGE`.
There's also a limit on the maximum number of notes that can be returned in one go. To find the current limit, refer to [this file](https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/noir-protocol-circuits/src/crates/types/src/constants.nr) and look for `MAX_NOTES_PER_PAGE`.

The key distinction is that this method is unconstrained. It does not perform a check to verify if the notes actually exist, which is something the [`get_notes`](#get_notes) method does under the hood. Therefore, it should only be used in an unconstrained contract function.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/dev_docs/debugging/sandbox-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Circuits work by having a fixed size array. As such, we have limits on how many
- too many transient read requests in one tx
- too many transient read request membership witnesses in one tx

You can have a look at our current constants/limitations in [constants.nr](https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/aztec-nr/aztec/src/constants_gen.nr)
You can have a look at our current constants/limitations in [constants.nr](https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/noir-protocol-circuits/src/crates/types/src/constants.nr)

#### 7008 - MEMBERSHIP_CHECK_FAILED

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/dev_docs/limitations/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Due to the rigidity of zk-SNARK circuits, there are upper bounds on the amount o
Here are the current constants:

#include_code constants /yarn-project/aztec-nr/aztec/src/constants_gen.nr rust
#include_code constants /yarn-project/noir-protocol-circuits/src/crates/types/src/constants.nr rust

#### What are the consequences?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ We are using various utils within the Aztec library:
* `state_vars::{ map::Map, public_state::PublicState, }` - we will use a Map to store the votes (key = voteId, value = number of votes), and PublicState to hold our public values that we mentioned earlier
* `types::type_serialization::{..}` - various serialization methods for defining how to use these types
* `types::address::{AztecAddress},` - our admin will be held as an address
* `constants_gen::EMPTY_NULLIFIED_COMMITMENT,` - this will come in useful when creating our nullifier
* `constants::EMPTY_NULLIFIED_COMMITMENT,` - this will come in useful when creating our nullifier

## Set up storage

Expand Down
2 changes: 2 additions & 0 deletions l1-contracts/src/core/libraries/ConstantsGen.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ library Constants {
uint256 internal constant FUNCTION_SELECTOR_NUM_BYTES = 4;
uint256 internal constant MAPPING_SLOT_PEDERSEN_SEPARATOR = 4;
uint256 internal constant NUM_FIELDS_PER_SHA256 = 2;
uint256 internal constant ARGS_HASH_CHUNK_LENGTH = 32;
uint256 internal constant ARGS_HASH_CHUNK_COUNT = 16;
uint256 internal constant L1_TO_L2_MESSAGE_LENGTH = 8;
uint256 internal constant L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH = 26;
uint256 internal constant MAX_NOTE_FIELDS_LENGTH = 20;
Expand Down
3 changes: 2 additions & 1 deletion yarn-project/aztec-nr/authwit/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ compiler_version = ">=0.18.0"
type = "lib"

[dependencies]
aztec = { path = "../aztec" }
aztec = { path = "../aztec" }
protocol_types = { path = "../../noir-protocol-circuits/src/crates/types" }
2 changes: 1 addition & 1 deletion yarn-project/aztec-nr/authwit/src/auth.nr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use dep::protocol_types::constants::{EMPTY_NULLIFIED_COMMITMENT, GENERATOR_INDEX__SIGNATURE_PAYLOAD};
use dep::aztec::{
context::{PrivateContext, PublicContext, Context},
constants_gen::{EMPTY_NULLIFIED_COMMITMENT, GENERATOR_INDEX__SIGNATURE_PAYLOAD},
types::address::AztecAddress,
abi::hash_args,
hash::pedersen_hash,
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec-nr/authwit/src/entrypoint.nr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use dep::aztec::hash::pedersen_hash;
use dep::aztec::context::PrivateContext;
use dep::aztec::private_call_stack_item::PrivateCallStackItem;
use dep::aztec::public_call_stack_item::PublicCallStackItem;
use dep::aztec::constants_gen::GENERATOR_INDEX__SIGNATURE_PAYLOAD;
use dep::protocol_types::constants::GENERATOR_INDEX__SIGNATURE_PAYLOAD;

global ACCOUNT_MAX_CALLS: Field = 4;
// 1 (ARGS_HASH) + 1 (FUNCTION_SELECTOR) + 1 (TARGET_ADDRESS) + 1 (IS_PUBLIC)
Expand Down
3 changes: 2 additions & 1 deletion yarn-project/aztec-nr/aztec/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ authors = ["aztec-labs"]
compiler_version = ">=0.18.0"
type = "lib"

[dependencies]
[dependencies]
protocol_types = { path = "../../noir-protocol-circuits/src/crates/types" }
2 changes: 1 addition & 1 deletion yarn-project/aztec-nr/aztec/src/abi.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::constants_gen::{
use dep::protocol_types::constants::{
RETURN_VALUES_LENGTH,
MAX_READ_REQUESTS_PER_CALL,
MAX_PENDING_READ_REQUESTS_PER_CALL,
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec-nr/aztec/src/address.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::constants_gen::GENERATOR_INDEX__CONTRACT_ADDRESS;
use dep::protocol_types::constants::GENERATOR_INDEX__CONTRACT_ADDRESS;
use crate::hash::pedersen_hash;

pub fn compute_address(pub_key_x: Field, pub_key_y: Field, partial_address: Field) -> Field {
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec-nr/aztec/src/context.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::constants_gen::{
use dep::protocol_types::constants::{
EMPTY_NULLIFIED_COMMITMENT,
MAX_NEW_COMMITMENTS_PER_CALL,
MAX_NEW_L2_TO_L1_MSGS_PER_CALL,
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec-nr/aztec/src/hash.nr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use dep::std::hash::{pedersen_hash_with_separator, sha256};
use crate::constants_gen::{
use dep::protocol_types::constants::{
GENERATOR_INDEX__SIGNATURE_PAYLOAD,
GENERATOR_INDEX__L1_TO_L2_MESSAGE_SECRET,
};
Expand Down
1 change: 0 additions & 1 deletion yarn-project/aztec-nr/aztec/src/lib.nr
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
mod abi;
mod address;
mod constants_gen;
mod context;
mod hash;
mod log;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::constants_gen::{
use dep::protocol_types::constants::{
L1_TO_L2_MESSAGE_LENGTH,
GENERATOR_INDEX__NULLIFIER,
GENERATOR_INDEX__L1_TO_L2_MESSAGE_SECRET,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::messaging::l1_to_l2_message::L1ToL2Message;
use crate::constants_gen::{
use dep::protocol_types::constants::{
L1_TO_L2_MSG_TREE_HEIGHT,
L1_TO_L2_MESSAGE_LENGTH,
};
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec-nr/aztec/src/note/lifecycle.nr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::note::{
utils::compute_inner_note_hash,
};
use crate::oracle::notes::{notify_created_note, notify_nullified_note};
use crate::constants_gen::EMPTY_NULLIFIED_COMMITMENT;
use dep::protocol_types::constants::EMPTY_NULLIFIED_COMMITMENT;

pub fn create_note<Note, N>(
context: &mut PrivateContext,
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec-nr/aztec/src/note/note_getter.nr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use dep::std::option::Option;
use crate::constants_gen::{
use dep::protocol_types::constants::{
MAX_READ_REQUESTS_PER_CALL,
GET_NOTE_ORACLE_RETURN_LENGTH,
GET_NOTES_ORACLE_RETURN_LENGTH,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use dep::std::option::Option;
use crate::types::vec::BoundedVec;
use crate::constants_gen::MAX_READ_REQUESTS_PER_CALL;
use dep::protocol_types::constants::MAX_READ_REQUESTS_PER_CALL;

struct Select {
field_index: u8,
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec-nr/aztec/src/note/note_hash.nr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::hash::pedersen_hash;
use crate::constants_gen::{GENERATOR_INDEX__UNIQUE_COMMITMENT, GENERATOR_INDEX__SILOED_COMMITMENT};
use dep::protocol_types::constants::{GENERATOR_INDEX__UNIQUE_COMMITMENT, GENERATOR_INDEX__SILOED_COMMITMENT};

pub fn compute_inner_hash(storage_slot: Field, note_hash: Field) -> Field {
// TODO(#1205) Do we need a generator index here?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use dep::std::option::Option;
use crate::constants_gen::MAX_NOTES_PER_PAGE;
use dep::protocol_types::constants::MAX_NOTES_PER_PAGE;
use crate::note::note_getter_options::{Select, Sort};
use crate::types::vec::BoundedVec;

Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec-nr/aztec/src/note/utils.nr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use dep::protocol_types::constants::GENERATOR_INDEX__OUTER_NULLIFIER;
use crate::{
constants_gen::GENERATOR_INDEX__OUTER_NULLIFIER,
note::{
note_hash::{compute_inner_hash, compute_siloed_hash, compute_unique_hash},
note_header::NoteHeader,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::constants_gen::CALL_PRIVATE_FUNCTION_RETURN_SIZE;
use dep::protocol_types::constants::CALL_PRIVATE_FUNCTION_RETURN_SIZE;

#[oracle(callPrivateFunction)]
fn call_private_function_oracle(_contract_address: Field, _function_selector: Field, _args_hash: Field) -> [Field; CALL_PRIVATE_FUNCTION_RETURN_SIZE] {}
Expand Down
9 changes: 5 additions & 4 deletions yarn-project/aztec-nr/aztec/src/oracle/get_block_header.nr
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use dep::std::merkle::compute_merkle_root;
use dep::protocol_types::constants::{
BLOCK_HEADER_LENGTH,
ARCHIVE_HEIGHT,
};

use crate::{
abi::BlockHeader,
constants_gen::{
BLOCK_HEADER_LENGTH,
ARCHIVE_HEIGHT,
},
context::PrivateContext,
oracle::get_membership_witness::{
get_membership_witness,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::constants_gen::L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH;
use dep::protocol_types::constants::L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH;

// Checks if a msg is within the l1ToL2Msg tree
#[oracle(getL1ToL2Message)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::constants_gen::NOTE_HASH_TREE_HEIGHT;
use dep::protocol_types::constants::NOTE_HASH_TREE_HEIGHT;
use crate::utils::arr_copy_slice;

// Note: We have M here because we need to somehow set it when calling get_membership_witness function and one way to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::constants_gen::NULLIFIER_TREE_HEIGHT;
use dep::protocol_types::constants::NULLIFIER_TREE_HEIGHT;
use crate::utils::arr_copy_slice;
use crate::hash::pedersen_hash;

Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec-nr/aztec/src/oracle/get_sibling_path.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::constants_gen::NOTE_HASH_TREE_HEIGHT;
use dep::protocol_types::constants::NOTE_HASH_TREE_HEIGHT;
use crate::utils::arr_copy_slice;

#[oracle(getSiblingPath)]
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec-nr/aztec/src/oracle/logs.nr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::types::point::Point;
use crate::constants_gen::NUM_FIELDS_PER_SHA256;
use dep::protocol_types::constants::NUM_FIELDS_PER_SHA256;

// TODO: Should take encrypted data.
#[oracle(emitEncryptedLog)]
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec-nr/aztec/src/oracle/public_call.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::constants_gen::RETURN_VALUES_LENGTH;
use dep::protocol_types::constants::RETURN_VALUES_LENGTH;

#[oracle(callPublicFunction)]
fn call_public_function_oracle(_contract_address: Field, _function_selector: Field, _args_hash: Field) -> [Field; RETURN_VALUES_LENGTH] {}
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec-nr/aztec/src/private_call_stack_item.nr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::abi::FunctionData;
use crate::abi::PrivateCircuitPublicInputs;
use crate::constants_gen::GENERATOR_INDEX__CALL_STACK_ITEM;
use dep::protocol_types::constants::GENERATOR_INDEX__CALL_STACK_ITEM;
use crate::hash::pedersen_hash;

struct PrivateCallStackItem {
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec-nr/aztec/src/public_call_stack_item.nr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
FunctionData,
},
};
use crate::constants_gen::{
use dep::protocol_types::constants::{
RETURN_VALUES_LENGTH,
GENERATOR_INDEX__CALL_STACK_ITEM,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use dep::std::option::Option;
use crate::constants_gen::EMPTY_NULLIFIED_COMMITMENT;
use dep::protocol_types::constants::EMPTY_NULLIFIED_COMMITMENT;
use crate::context::{PrivateContext, Context};
use crate::note::{
lifecycle::create_note,
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec-nr/aztec/src/state_vars/set.nr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use dep::std::option::Option;
use crate::abi::PublicContextInputs;
use crate::constants_gen::{MAX_NOTES_PER_PAGE, MAX_READ_REQUESTS_PER_CALL};
use dep::protocol_types::constants::{MAX_NOTES_PER_PAGE, MAX_READ_REQUESTS_PER_CALL};
use crate::context::{PrivateContext, PublicContext, Context};
use crate::note::{
lifecycle::{create_note, create_note_hash_from_public, destroy_note},
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec-nr/aztec/src/state_vars/singleton.nr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use dep::std::option::Option;
use crate::constants_gen::{EMPTY_NULLIFIED_COMMITMENT, GENERATOR_INDEX__INITIALIZATION_NULLIFIER};
use dep::protocol_types::constants::{EMPTY_NULLIFIED_COMMITMENT, GENERATOR_INDEX__INITIALIZATION_NULLIFIER};
use crate::context::{PrivateContext, PublicContext, Context};
use crate::note::{
lifecycle::{create_note, destroy_note},
Expand Down
3 changes: 2 additions & 1 deletion yarn-project/aztec-nr/value-note/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ compiler_version = ">=0.18.0"
type = "lib"

[dependencies]
aztec = { path = "../aztec" }
aztec = { path = "../aztec" }
protocol_types = { path = "../../noir-protocol-circuits/src/crates/types" }
2 changes: 1 addition & 1 deletion yarn-project/aztec-nr/value-note/src/filter.nr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use dep::std::option::Option;
use dep::aztec::constants_gen::MAX_READ_REQUESTS_PER_CALL;
use dep::protocol_types::constants::MAX_READ_REQUESTS_PER_CALL;
use crate::value_note::ValueNote;

pub fn filter_notes_min_sum(notes: [Option<ValueNote>; MAX_READ_REQUESTS_PER_CALL], min_sum: Field) -> [Option<ValueNote>; MAX_READ_REQUESTS_PER_CALL] {
Expand Down
3 changes: 2 additions & 1 deletion yarn-project/boxes/token/src/contracts/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ type = "contract"
aztec = { path = "../../../../aztec-nr/aztec" }
value_note = { path = "../../../../aztec-nr/value-note"}
safe_math = { path = "../../../../aztec-nr/safe-math" }
authwit = { path = "../../../../aztec-nr/authwit" }
authwit = { path = "../../../../aztec-nr/authwit" }
protocol_types = { path = "../../../../noir-protocol-circuits/src/crates/types" }
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use dep::std::option::Option;
use dep::safe_math::SafeU120;
use dep::protocol_types::constants::MAX_READ_REQUESTS_PER_CALL;
use dep::aztec::{
context::Context,
constants_gen::MAX_READ_REQUESTS_PER_CALL,
state_vars::set::Set,
types::address::AztecAddress,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use dep::protocol_types::constants::MAX_READ_REQUESTS_PER_CALL;
use dep::aztec::{
note::{
note_header::NoteHeader,
Expand All @@ -6,7 +7,6 @@ use dep::aztec::{
},
hash::pedersen_hash,
context::PrivateContext,
constants_gen::MAX_READ_REQUESTS_PER_CALL,
state_vars::set::Set,
log::emit_encrypted_log,
};
Expand Down
2 changes: 2 additions & 0 deletions yarn-project/circuits.js/src/constants.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ export const L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH = 12;
export const FUNCTION_SELECTOR_NUM_BYTES = 4;
export const MAPPING_SLOT_PEDERSEN_SEPARATOR = 4;
export const NUM_FIELDS_PER_SHA256 = 2;
export const ARGS_HASH_CHUNK_LENGTH = 32;
export const ARGS_HASH_CHUNK_COUNT = 16;
export const L1_TO_L2_MESSAGE_LENGTH = 8;
export const L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH = 26;
export const MAX_NOTE_FIELDS_LENGTH = 20;
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/circuits.js/src/scripts/constants.in.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { fileURLToPath } from '@aztec/foundation/url';
import * as fs from 'fs';
import { dirname, join } from 'path';

const NOIR_CONSTANTS_FILE = '../../../aztec-nr/aztec/src/constants_gen.nr';
const NOIR_CONSTANTS_FILE = '../../../noir-protocol-circuits/src/crates/types/src/constants.nr';
const TS_CONSTANTS_FILE = '../constants.gen.ts';
const SOLIDITY_CONSTANTS_FILE = '../../../../l1-contracts/src/core/libraries/ConstantsGen.sol';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ exports[`noir-compiler using nargo generates Aztec.nr external interface 1`] = `
use dep::std;
use dep::aztec::context::{ PrivateContext, PublicContext };
use dep::aztec::constants_gen::RETURN_VALUES_LENGTH;
use dep::protocol_types::constants::RETURN_VALUES_LENGTH;
Expand Down Expand Up @@ -240,7 +240,7 @@ exports[`noir-compiler using wasm binary generates Aztec.nr external interface 1
use dep::std;
use dep::aztec::context::{ PrivateContext, PublicContext };
use dep::aztec::constants_gen::RETURN_VALUES_LENGTH;
use dep::protocol_types::constants::RETURN_VALUES_LENGTH;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ ${callStatement}
function generateStaticImports() {
return `use dep::std;
use dep::aztec::context::{ PrivateContext, PublicContext };
use dep::aztec::constants_gen::RETURN_VALUES_LENGTH;`;
use dep::protocol_types::constants::RETURN_VALUES_LENGTH;`;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ type = "contract"
[dependencies]
aztec = { path = "../../../../aztec-nr/aztec" }
value_note = { path = "../../../../aztec-nr/value-note"}
protocol_types = { path = "../../../../noir-protocol-circuits/src/crates/types" }
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use dep::protocol_types::constants::{MAX_NOTES_PER_PAGE, MAX_READ_REQUESTS_PER_CALL};
use dep::aztec::{
context::{PrivateContext, PublicContext, Context},
constants_gen::{MAX_NOTES_PER_PAGE, MAX_READ_REQUESTS_PER_CALL},
note::{
note_getter_options::NoteGetterOptions,
note_viewer_options::NoteViewerOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ mod cards;
mod game;

contract CardGame {
use dep::protocol_types::constants::MAX_NOTES_PER_PAGE;
use dep::aztec::{
context::Context,
hash::pedersen_hash,
Expand All @@ -22,7 +23,6 @@ contract CardGame {

use dep::aztec::{
abi,
constants_gen::{MAX_NOTES_PER_PAGE},
abi::{
Hasher, PrivateContextInputs,
},
Expand Down
Loading

0 comments on commit 3013354

Please sign in to comment.