diff --git a/build_manifest.json b/build_manifest.json index 7d994bb3751..c3ac0c9dd8c 100644 --- a/build_manifest.json +++ b/build_manifest.json @@ -148,6 +148,7 @@ "^l1-contracts/", "^yarn-project/l1-artifacts/", "^yarn-project/noir-contracts/", + "^yarn-project/noir-libs/", "^yarn-project/noir-compiler/", "^yarn-project/yarn-project-base/", "^yarn-project/yarn.lock" @@ -366,7 +367,8 @@ "projectDir": "yarn-project/noir-contracts", "dockerfile": "noir-contracts/Dockerfile.build", "rebuildPatterns": [ - "^yarn-project/noir-contracts/" + "^yarn-project/noir-contracts/", + "^yarn-project/noir-libs/" ], "dependencies": [ "aztec.js", @@ -379,7 +381,8 @@ "projectDir": "yarn-project/noir-contracts", "dockerfile": "noir-contracts/Dockerfile", "rebuildPatterns": [ - "^yarn-project/noir-contracts/" + "^yarn-project/noir-contracts/", + "^yarn-project/noir-libs/" ], "dependencies": [ "aztec.js", diff --git a/yarn-project/aztec.js/src/abis/ecdsa_account_contract.json b/yarn-project/aztec.js/src/abis/ecdsa_account_contract.json index 3b1c5f54ec1..07166efc208 100644 --- a/yarn-project/aztec.js/src/abis/ecdsa_account_contract.json +++ b/yarn-project/aztec.js/src/abis/ecdsa_account_contract.json @@ -96,6 +96,7 @@ "name": "payload", "type": { "kind": "struct", + "name": "EntrypointPayload", "fields": [ { "name": "flattened_args_hashes", diff --git a/yarn-project/aztec.js/src/abis/schnorr_account_contract.json b/yarn-project/aztec.js/src/abis/schnorr_account_contract.json index 7a0f83664a7..65807285b49 100644 --- a/yarn-project/aztec.js/src/abis/schnorr_account_contract.json +++ b/yarn-project/aztec.js/src/abis/schnorr_account_contract.json @@ -84,6 +84,7 @@ "name": "payload", "type": { "kind": "struct", + "name": "EntrypointPayload", "fields": [ { "name": "flattened_args_hashes", diff --git a/yarn-project/aztec.js/src/abis/schnorr_single_key_account_contract.json b/yarn-project/aztec.js/src/abis/schnorr_single_key_account_contract.json index b74a7de8350..84f0fff8039 100644 --- a/yarn-project/aztec.js/src/abis/schnorr_single_key_account_contract.json +++ b/yarn-project/aztec.js/src/abis/schnorr_single_key_account_contract.json @@ -19,6 +19,7 @@ "name": "payload", "type": { "kind": "struct", + "name": "EntrypointPayload", "fields": [ { "name": "flattened_args_hashes", diff --git a/yarn-project/circuits.js/src/cbind/constants.in.ts b/yarn-project/circuits.js/src/cbind/constants.in.ts index fe1c186b0c0..7b198754c81 100644 --- a/yarn-project/circuits.js/src/cbind/constants.in.ts +++ b/yarn-project/circuits.js/src/cbind/constants.in.ts @@ -110,7 +110,7 @@ function processEnumTS(enumName: string, enumValues: { [key: string]: number }): function processConstantsNoir(constants: { [key: string]: number }, prefix = ''): string { const code: string[] = []; Object.entries(constants).forEach(([key, value]) => { - code.push(`global ${prefix}${key}: comptime Field = ${value};`); + code.push(`global ${prefix}${key}: Field = ${value};`); }); return code.join('\n') + '\n'; } diff --git a/yarn-project/noir-compiler/src/compile/nargo.ts b/yarn-project/noir-compiler/src/compile/nargo.ts index f2f220afab1..9b38dd71ae2 100644 --- a/yarn-project/noir-compiler/src/compile/nargo.ts +++ b/yarn-project/noir-compiler/src/compile/nargo.ts @@ -28,7 +28,7 @@ export class NargoContractCompiler { const nargoBin = this.opts.nargoBin ?? 'nargo'; execSync(`${nargoBin} --version`, { cwd: this.projectPath, stdio }); emptyDirSync(this.getTargetFolder()); - execSync(`${nargoBin} compile --contracts `, { cwd: this.projectPath, stdio }); + execSync(`${nargoBin} compile `, { cwd: this.projectPath, stdio }); return Promise.resolve(this.collectArtifacts()); } diff --git a/yarn-project/noir-compiler/src/fixtures/test_contract/Nargo.toml b/yarn-project/noir-compiler/src/fixtures/test_contract/Nargo.toml index e223a13fde4..6b453ec8c63 100644 --- a/yarn-project/noir-compiler/src/fixtures/test_contract/Nargo.toml +++ b/yarn-project/noir-compiler/src/fixtures/test_contract/Nargo.toml @@ -2,7 +2,7 @@ name = "test" authors = [""] compiler_version = "0.1" -type = "bin" +type = "contract" [dependencies] test = { path = "../test_lib" } diff --git a/yarn-project/noir-contracts/scripts/compile.sh b/yarn-project/noir-contracts/scripts/compile.sh index 6ad7bd25ed4..b333829a07c 100755 --- a/yarn-project/noir-contracts/scripts/compile.sh +++ b/yarn-project/noir-contracts/scripts/compile.sh @@ -38,7 +38,7 @@ build() { rm -f target/* # If the compilation fails, rerun the compilation with 'nargo' and show the compiler output. - nargo compile --contracts; + nargo compile; } echo "Using $(nargo --version)" diff --git a/yarn-project/noir-contracts/src/contracts/child_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/child_contract/Nargo.toml index 66dbffc56af..ee16960f684 100644 --- a/yarn-project/noir-contracts/src/contracts/child_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/child_contract/Nargo.toml @@ -2,7 +2,7 @@ name = "child_contract" authors = [""] compiler_version = "0.1" -type = "bin" +type = "contract" [dependencies] aztec = { path = "../../../../noir-libs/noir-aztec" } diff --git a/yarn-project/noir-contracts/src/contracts/easy_private_token_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/easy_private_token_contract/Nargo.toml index 78d480cc66b..b12c667a3a7 100644 --- a/yarn-project/noir-contracts/src/contracts/easy_private_token_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/easy_private_token_contract/Nargo.toml @@ -2,7 +2,7 @@ name = "easy_private_token_contract" authors = [""] compiler_version = "0.1" -type = "bin" +type = "contract" [dependencies] aztec = { path = "../../../../noir-libs/noir-aztec" } diff --git a/yarn-project/noir-contracts/src/contracts/ecdsa_account_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/ecdsa_account_contract/Nargo.toml index 38ed88d7c94..fafe0d80e0d 100644 --- a/yarn-project/noir-contracts/src/contracts/ecdsa_account_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/ecdsa_account_contract/Nargo.toml @@ -2,7 +2,7 @@ name = "ecdsa_account_contract" authors = [""] compiler_version = "0.1" -type = "bin" +type = "contract" [dependencies] aztec = { path = "../../../../noir-libs/noir-aztec" } diff --git a/yarn-project/noir-contracts/src/contracts/escrow_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/escrow_contract/Nargo.toml index 1f198c43ddc..1659fd53bd1 100644 --- a/yarn-project/noir-contracts/src/contracts/escrow_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/escrow_contract/Nargo.toml @@ -2,7 +2,7 @@ name = "escrow_contract" authors = [""] compiler_version = "0.1" -type = "bin" +type = "contract" [dependencies] aztec = { path = "../../../../noir-libs/noir-aztec" } diff --git a/yarn-project/noir-contracts/src/contracts/example_public_state_increment_BROKE/Nargo.toml b/yarn-project/noir-contracts/src/contracts/example_public_state_increment_BROKE/Nargo.toml index f833b9612f9..ecf14c9d70b 100644 --- a/yarn-project/noir-contracts/src/contracts/example_public_state_increment_BROKE/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/example_public_state_increment_BROKE/Nargo.toml @@ -2,7 +2,7 @@ name = "example_public_state_increment_contract" authors = [""] compiler_version = "0.1" -type = "bin" +type = "contract" [dependencies] aztec = { path = "../../../../noir-libs/noir-aztec" } \ No newline at end of file diff --git a/yarn-project/noir-contracts/src/contracts/import_test_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/import_test_contract/Nargo.toml index 41b131fcc79..1dfaf41bec9 100644 --- a/yarn-project/noir-contracts/src/contracts/import_test_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/import_test_contract/Nargo.toml @@ -2,7 +2,7 @@ name = "import_test_contract" authors = [""] compiler_version = "0.1" -type = "bin" +type = "contract" [dependencies] aztec = { path = "../../../../noir-libs/noir-aztec" } \ No newline at end of file diff --git a/yarn-project/noir-contracts/src/contracts/lending_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/lending_contract/Nargo.toml index 13d01409d0b..8de71f3fdf1 100644 --- a/yarn-project/noir-contracts/src/contracts/lending_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/lending_contract/Nargo.toml @@ -2,7 +2,7 @@ name = "lending_contract" authors = [""] compiler_version = "0.1" -type = "bin" +type = "contract" [dependencies] aztec = { path = "../../../../noir-libs/noir-aztec" } diff --git a/yarn-project/noir-contracts/src/contracts/non_native_token_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/non_native_token_contract/Nargo.toml index bd6fc1bc260..a114d29bd83 100644 --- a/yarn-project/noir-contracts/src/contracts/non_native_token_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/non_native_token_contract/Nargo.toml @@ -2,7 +2,7 @@ name = "non_native_token_contract" authors = [""] compiler_version = "0.1" -type = "bin" +type = "contract" [dependencies] aztec = { path = "../../../../noir-libs/noir-aztec" } diff --git a/yarn-project/noir-contracts/src/contracts/parent_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/parent_contract/Nargo.toml index 7f679650686..5c12622f00f 100644 --- a/yarn-project/noir-contracts/src/contracts/parent_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/parent_contract/Nargo.toml @@ -2,7 +2,7 @@ name = "parent_contract" authors = [""] compiler_version = "0.1" -type = "bin" +type = "contract" [dependencies] aztec = { path = "../../../../noir-libs/noir-aztec" } diff --git a/yarn-project/noir-contracts/src/contracts/pending_commitments_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/pending_commitments_contract/Nargo.toml index 2d794f60fbf..052b4bff730 100644 --- a/yarn-project/noir-contracts/src/contracts/pending_commitments_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/pending_commitments_contract/Nargo.toml @@ -2,7 +2,7 @@ name = "pending_commitments_contract" authors = [""] compiler_version = "0.1" -type = "bin" +type = "contract" [dependencies] aztec = { path = "../../../../noir-libs/noir-aztec" } diff --git a/yarn-project/noir-contracts/src/contracts/pokeable_token_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/pokeable_token_contract/Nargo.toml index 7f11017fb72..0e36de1f22c 100644 --- a/yarn-project/noir-contracts/src/contracts/pokeable_token_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/pokeable_token_contract/Nargo.toml @@ -2,7 +2,7 @@ name = "pokeable_token_contract" authors = [""] compiler_version = "0.1" -type = "bin" +type = "contract" [dependencies] aztec = { path = "../../../../noir-libs/noir-aztec" } diff --git a/yarn-project/noir-contracts/src/contracts/private_token_airdrop_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/private_token_airdrop_contract/Nargo.toml index 9dbab5c7d3c..b198e85407d 100644 --- a/yarn-project/noir-contracts/src/contracts/private_token_airdrop_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/private_token_airdrop_contract/Nargo.toml @@ -2,7 +2,7 @@ name = "private_token_airdrop_contract" authors = [""] compiler_version = "0.1" -type = "bin" +type = "contract" [dependencies] aztec = { path = "../../../../noir-libs/noir-aztec" } diff --git a/yarn-project/noir-contracts/src/contracts/private_token_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/private_token_contract/Nargo.toml index f787ae48c25..4bdd80daff0 100644 --- a/yarn-project/noir-contracts/src/contracts/private_token_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/private_token_contract/Nargo.toml @@ -3,7 +3,7 @@ name = "private_token_contract" authors = [""] compiler_version = "0.1" -type = "bin" +type = "contract" [dependencies] # highlight-next-line:importing-aztec diff --git a/yarn-project/noir-contracts/src/contracts/public_token_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/public_token_contract/Nargo.toml index 29df41c221a..3f6be8e4142 100644 --- a/yarn-project/noir-contracts/src/contracts/public_token_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/public_token_contract/Nargo.toml @@ -2,7 +2,7 @@ name = "public_token_contract" authors = [""] compiler_version = "0.1" -type = "bin" +type = "contract" [dependencies] aztec = { path = "../../../../noir-libs/noir-aztec" } \ No newline at end of file diff --git a/yarn-project/noir-contracts/src/contracts/schnorr_account_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/schnorr_account_contract/Nargo.toml index 33be6fb3c9b..1ea6bf3dbe6 100644 --- a/yarn-project/noir-contracts/src/contracts/schnorr_account_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/schnorr_account_contract/Nargo.toml @@ -2,7 +2,7 @@ name = "schnorr_account_contract" authors = [""] compiler_version = "0.1" -type = "bin" +type = "contract" [dependencies] aztec = { path = "../../../../noir-libs/noir-aztec" } \ No newline at end of file diff --git a/yarn-project/noir-contracts/src/contracts/schnorr_single_key_account_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/schnorr_single_key_account_contract/Nargo.toml index d00f9b6a944..f21b6ca513c 100644 --- a/yarn-project/noir-contracts/src/contracts/schnorr_single_key_account_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/schnorr_single_key_account_contract/Nargo.toml @@ -2,7 +2,7 @@ name = "schnorr_single_key_account_contract" authors = [""] compiler_version = "0.1" -type = "bin" +type = "contract" [dependencies] aztec = { path = "../../../../noir-libs/noir-aztec" } diff --git a/yarn-project/noir-contracts/src/contracts/test_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/test_contract/Nargo.toml index 49e599200d7..fd7213c7a9a 100644 --- a/yarn-project/noir-contracts/src/contracts/test_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/test_contract/Nargo.toml @@ -2,7 +2,7 @@ name = "test_contract" authors = [""] compiler_version = "0.1" -type = "bin" +type = "contract" [dependencies] aztec = { path = "../../../../noir-libs/noir-aztec" } diff --git a/yarn-project/noir-contracts/src/contracts/uniswap_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/uniswap_contract/Nargo.toml index 99ea910215b..d02ae559dd1 100644 --- a/yarn-project/noir-contracts/src/contracts/uniswap_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/uniswap_contract/Nargo.toml @@ -2,7 +2,7 @@ name = "uniswap_contract" authors = [""] compiler_version = "0.1" -type = "bin" +type = "contract" [dependencies] aztec = { path = "../../../../noir-libs/noir-aztec" } diff --git a/yarn-project/noir-libs/noir-aztec/src/constants_gen.nr b/yarn-project/noir-libs/noir-aztec/src/constants_gen.nr index aac66a0a8d7..359d20b5042 100644 --- a/yarn-project/noir-libs/noir-aztec/src/constants_gen.nr +++ b/yarn-project/noir-libs/noir-aztec/src/constants_gen.nr @@ -1,75 +1,75 @@ // GENERATED FILE - DO NOT EDIT, RUN yarn remake-constants in circuits.js -global ARGS_LENGTH: comptime Field = 16; -global RETURN_VALUES_LENGTH: comptime Field = 4; -global MAX_NEW_COMMITMENTS_PER_CALL: comptime Field = 4; -global MAX_NEW_NULLIFIERS_PER_CALL: comptime Field = 4; -global MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL: comptime Field = 4; -global MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL: comptime Field = 4; -global MAX_NEW_L2_TO_L1_MSGS_PER_CALL: comptime Field = 2; -global MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL: comptime Field = 8; -global MAX_PUBLIC_DATA_READS_PER_CALL: comptime Field = 8; -global MAX_READ_REQUESTS_PER_CALL: comptime Field = 4; -global MAX_NEW_COMMITMENTS_PER_TX: comptime Field = 16; -global MAX_NEW_NULLIFIERS_PER_TX: comptime Field = 16; -global MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX: comptime Field = 8; -global MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX: comptime Field = 8; -global MAX_NEW_L2_TO_L1_MSGS_PER_TX: comptime Field = 2; -global MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX: comptime Field = 8; -global MAX_PUBLIC_DATA_READS_PER_TX: comptime Field = 8; -global MAX_NEW_CONTRACTS_PER_TX: comptime Field = 1; -global MAX_OPTIONALLY_REVEALED_DATA_LENGTH_PER_TX: comptime Field = 4; -global MAX_READ_REQUESTS_PER_TX: comptime Field = 16; -global NUM_ENCRYPTED_LOGS_HASHES_PER_TX: comptime Field = 1; -global NUM_UNENCRYPTED_LOGS_HASHES_PER_TX: comptime Field = 1; -global NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP: comptime Field = 16; -global KERNELS_PER_BASE_ROLLUP: comptime Field = 2; -global VK_TREE_HEIGHT: comptime Field = 3; -global FUNCTION_TREE_HEIGHT: comptime Field = 4; -global CONTRACT_TREE_HEIGHT: comptime Field = 16; -global PRIVATE_DATA_TREE_HEIGHT: comptime Field = 32; -global PUBLIC_DATA_TREE_HEIGHT: comptime Field = 254; -global NULLIFIER_TREE_HEIGHT: comptime Field = 16; -global L1_TO_L2_MSG_TREE_HEIGHT: comptime Field = 16; -global ROLLUP_VK_TREE_HEIGHT: comptime Field = 8; -global CONTRACT_SUBTREE_HEIGHT: comptime Field = 1; -global CONTRACT_SUBTREE_SIBLING_PATH_LENGTH: comptime Field = 15; -global PRIVATE_DATA_SUBTREE_HEIGHT: comptime Field = 5; -global PRIVATE_DATA_SUBTREE_SIBLING_PATH_LENGTH: comptime Field = 27; -global NULLIFIER_SUBTREE_HEIGHT: comptime Field = 5; -global HISTORIC_BLOCKS_TREE_HEIGHT: comptime Field = 16; -global NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH: comptime Field = 11; -global L1_TO_L2_MSG_SUBTREE_HEIGHT: comptime Field = 4; -global L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH: comptime Field = 12; -global FUNCTION_SELECTOR_NUM_BYTES: comptime Field = 4; -global MAPPING_SLOT_PEDERSEN_SEPARATOR: comptime Field = 4; -global NUM_FIELDS_PER_SHA256: comptime Field = 2; -global L1_TO_L2_MESSAGE_LENGTH: comptime Field = 8; -global L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH: comptime Field = 26; -global MAX_NOTE_FIELDS_LENGTH: comptime Field = 20; -global GET_NOTE_ORACLE_RETURN_LENGTH: comptime Field = 23; -global MAX_NOTES_PER_PAGE: comptime Field = 10; -global VIEW_NOTE_ORACLE_RETURN_LENGTH: comptime Field = 212; -global CALL_CONTEXT_LENGTH: comptime Field = 6; -global HISTORIC_BLOCK_DATA_LENGTH: comptime Field = 7; -global FUNCTION_DATA_LENGTH: comptime Field = 4; -global CONTRACT_DEPLOYMENT_DATA_LENGTH: comptime Field = 6; -global PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH: comptime Field = 58; -global CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH: comptime Field = 3; -global CONTRACT_STORAGE_READ_LENGTH: comptime Field = 2; -global PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH: comptime Field = 77; -global GET_NOTES_ORACLE_RETURN_LENGTH: comptime Field = 86; -global EMPTY_NULLIFIED_COMMITMENT: comptime Field = 1000000; -global CALL_PRIVATE_FUNCTION_RETURN_SIZE: comptime Field = 64; -global PUBLIC_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH: comptime Field = 47; -global PRIVATE_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH: comptime Field = 48; -global COMMITMENTS_NUM_BYTES_PER_BASE_ROLLUP: comptime Field = 1024; -global NULLIFIERS_NUM_BYTES_PER_BASE_ROLLUP: comptime Field = 1024; -global PUBLIC_DATA_WRITES_NUM_BYTES_PER_BASE_ROLLUP: comptime Field = 1024; -global CONTRACTS_NUM_BYTES_PER_BASE_ROLLUP: comptime Field = 64; -global CONTRACT_DATA_NUM_BYTES_PER_BASE_ROLLUP: comptime Field = 128; -global CONTRACT_DATA_NUM_BYTES_PER_BASE_ROLLUP_UNPADDED: comptime Field = 104; -global L2_TO_L1_MSGS_NUM_BYTES_PER_BASE_ROLLUP: comptime Field = 128; -global LOGS_HASHES_NUM_BYTES_PER_BASE_ROLLUP: comptime Field = 128; +global ARGS_LENGTH: Field = 16; +global RETURN_VALUES_LENGTH: Field = 4; +global MAX_NEW_COMMITMENTS_PER_CALL: Field = 4; +global MAX_NEW_NULLIFIERS_PER_CALL: Field = 4; +global MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL: Field = 4; +global MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL: Field = 4; +global MAX_NEW_L2_TO_L1_MSGS_PER_CALL: Field = 2; +global MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL: Field = 8; +global MAX_PUBLIC_DATA_READS_PER_CALL: Field = 8; +global MAX_READ_REQUESTS_PER_CALL: Field = 4; +global MAX_NEW_COMMITMENTS_PER_TX: Field = 16; +global MAX_NEW_NULLIFIERS_PER_TX: Field = 16; +global MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX: Field = 8; +global MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX: Field = 8; +global MAX_NEW_L2_TO_L1_MSGS_PER_TX: Field = 2; +global MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX: Field = 8; +global MAX_PUBLIC_DATA_READS_PER_TX: Field = 8; +global MAX_NEW_CONTRACTS_PER_TX: Field = 1; +global MAX_OPTIONALLY_REVEALED_DATA_LENGTH_PER_TX: Field = 4; +global MAX_READ_REQUESTS_PER_TX: Field = 16; +global NUM_ENCRYPTED_LOGS_HASHES_PER_TX: Field = 1; +global NUM_UNENCRYPTED_LOGS_HASHES_PER_TX: Field = 1; +global NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP: Field = 16; +global KERNELS_PER_BASE_ROLLUP: Field = 2; +global VK_TREE_HEIGHT: Field = 3; +global FUNCTION_TREE_HEIGHT: Field = 4; +global CONTRACT_TREE_HEIGHT: Field = 16; +global PRIVATE_DATA_TREE_HEIGHT: Field = 32; +global PUBLIC_DATA_TREE_HEIGHT: Field = 254; +global NULLIFIER_TREE_HEIGHT: Field = 16; +global L1_TO_L2_MSG_TREE_HEIGHT: Field = 16; +global ROLLUP_VK_TREE_HEIGHT: Field = 8; +global CONTRACT_SUBTREE_HEIGHT: Field = 1; +global CONTRACT_SUBTREE_SIBLING_PATH_LENGTH: Field = 15; +global PRIVATE_DATA_SUBTREE_HEIGHT: Field = 5; +global PRIVATE_DATA_SUBTREE_SIBLING_PATH_LENGTH: Field = 27; +global NULLIFIER_SUBTREE_HEIGHT: Field = 5; +global HISTORIC_BLOCKS_TREE_HEIGHT: Field = 16; +global NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH: Field = 11; +global L1_TO_L2_MSG_SUBTREE_HEIGHT: Field = 4; +global L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH: Field = 12; +global FUNCTION_SELECTOR_NUM_BYTES: Field = 4; +global MAPPING_SLOT_PEDERSEN_SEPARATOR: Field = 4; +global NUM_FIELDS_PER_SHA256: Field = 2; +global L1_TO_L2_MESSAGE_LENGTH: Field = 8; +global L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH: Field = 26; +global MAX_NOTE_FIELDS_LENGTH: Field = 20; +global GET_NOTE_ORACLE_RETURN_LENGTH: Field = 23; +global MAX_NOTES_PER_PAGE: Field = 10; +global VIEW_NOTE_ORACLE_RETURN_LENGTH: Field = 212; +global CALL_CONTEXT_LENGTH: Field = 6; +global HISTORIC_BLOCK_DATA_LENGTH: Field = 7; +global FUNCTION_DATA_LENGTH: Field = 4; +global CONTRACT_DEPLOYMENT_DATA_LENGTH: Field = 6; +global PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH: Field = 58; +global CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH: Field = 3; +global CONTRACT_STORAGE_READ_LENGTH: Field = 2; +global PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH: Field = 77; +global GET_NOTES_ORACLE_RETURN_LENGTH: Field = 86; +global EMPTY_NULLIFIED_COMMITMENT: Field = 1000000; +global CALL_PRIVATE_FUNCTION_RETURN_SIZE: Field = 64; +global PUBLIC_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH: Field = 47; +global PRIVATE_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH: Field = 48; +global COMMITMENTS_NUM_BYTES_PER_BASE_ROLLUP: Field = 1024; +global NULLIFIERS_NUM_BYTES_PER_BASE_ROLLUP: Field = 1024; +global PUBLIC_DATA_WRITES_NUM_BYTES_PER_BASE_ROLLUP: Field = 1024; +global CONTRACTS_NUM_BYTES_PER_BASE_ROLLUP: Field = 64; +global CONTRACT_DATA_NUM_BYTES_PER_BASE_ROLLUP: Field = 128; +global CONTRACT_DATA_NUM_BYTES_PER_BASE_ROLLUP_UNPADDED: Field = 104; +global L2_TO_L1_MSGS_NUM_BYTES_PER_BASE_ROLLUP: Field = 128; +global LOGS_HASHES_NUM_BYTES_PER_BASE_ROLLUP: Field = 128; global GENERATOR_INDEX__COMMITMENT = 1; global GENERATOR_INDEX__COMMITMENT_NONCE = 2; global GENERATOR_INDEX__UNIQUE_COMMITMENT = 3; diff --git a/yarn-project/noir-libs/noir-aztec/src/entrypoint.nr b/yarn-project/noir-libs/noir-aztec/src/entrypoint.nr index bad450d75db..efb4c9aa1f6 100644 --- a/yarn-project/noir-libs/noir-aztec/src/entrypoint.nr +++ b/yarn-project/noir-libs/noir-aztec/src/entrypoint.nr @@ -4,11 +4,11 @@ use crate::context::PrivateContext; use crate::private_call_stack_item::PrivateCallStackItem; use crate::public_call_stack_item::PublicCallStackItem; -global ACCOUNT_MAX_PRIVATE_CALLS: comptime Field = 2; -global ACCOUNT_MAX_PUBLIC_CALLS: comptime Field = 2; -global ACCOUNT_MAX_CALLS: comptime Field = 4; +global ACCOUNT_MAX_PRIVATE_CALLS: Field = 2; +global ACCOUNT_MAX_PUBLIC_CALLS: Field = 2; +global ACCOUNT_MAX_CALLS: Field = 4; // 1 (ARGS_HASH) + 1 (FUNCTION_SELECTOR) + 1 (TARGET_ADDRESS) -global FUNCTION_CALL_SIZE: comptime Field = 3; +global FUNCTION_CALL_SIZE: Field = 3; struct FunctionCall { args_hash: Field, @@ -23,8 +23,8 @@ impl FunctionCall { } // FUNCTION_CALL_SIZE * (ACCOUNT_MAX_PUBLIC_CALLS + ACCOUNT_MAX_PRIVATE_CALLS) + 1 -global ENTRYPOINT_PAYLOAD_SIZE: comptime Field = 13; -global ENTRYPOINT_PAYLOAD_SIZE_IN_BYTES: comptime Field = 416; +global ENTRYPOINT_PAYLOAD_SIZE: Field = 13; +global ENTRYPOINT_PAYLOAD_SIZE_IN_BYTES: Field = 416; struct EntrypointPayload { // Noir doesnt support nested arrays or structs yet so we flatten everything diff --git a/yarn-project/noir-libs/noir-aztec/src/messaging/get_commitment_getter_data.nr b/yarn-project/noir-libs/noir-aztec/src/messaging/get_commitment_getter_data.nr index 5eaaa7e63e2..07d826d41d7 100644 --- a/yarn-project/noir-libs/noir-aztec/src/messaging/get_commitment_getter_data.nr +++ b/yarn-project/noir-libs/noir-aztec/src/messaging/get_commitment_getter_data.nr @@ -6,7 +6,7 @@ struct CommitmentGetterData { root: Field, } -fn make_commitment_getter_data(fields: [Field; COMMITMENT_GETTER_LENGTH], start: comptime Field) -> CommitmentGetterData { +fn make_commitment_getter_data(fields: [Field; COMMITMENT_GETTER_LENGTH], start: Field) -> CommitmentGetterData { CommitmentGetterData { message: fields[start], leaf_index: fields[start + 1], diff --git a/yarn-project/noir-libs/noir-aztec/src/messaging/l1_to_l2_message_getter_data.nr b/yarn-project/noir-libs/noir-aztec/src/messaging/l1_to_l2_message_getter_data.nr index d82977a1579..70ae8137ae8 100644 --- a/yarn-project/noir-libs/noir-aztec/src/messaging/l1_to_l2_message_getter_data.nr +++ b/yarn-project/noir-libs/noir-aztec/src/messaging/l1_to_l2_message_getter_data.nr @@ -12,11 +12,11 @@ struct L1ToL2MessageGetterData { root: Field, } -fn l1_to_l2_message_getter_len() -> comptime Field { +fn l1_to_l2_message_getter_len() -> Field { L1_TO_L2_MESSAGE_LENGTH + 1 + L1_TO_L2_MSG_TREE_HEIGHT + 1 } -fn make_l1_to_l2_message_getter_data(fields: [Field; N], start: comptime Field, secret: Field) -> L1ToL2MessageGetterData { +fn make_l1_to_l2_message_getter_data(fields: [Field; N], start: Field, secret: Field) -> L1ToL2MessageGetterData { L1ToL2MessageGetterData { message: L1ToL2Message::deserialize(arr_copy_slice(fields, [0; L1_TO_L2_MESSAGE_LENGTH], start), secret, fields[start + L1_TO_L2_MESSAGE_LENGTH]), leaf_index: fields[start + L1_TO_L2_MESSAGE_LENGTH], diff --git a/yarn-project/noir-libs/noir-aztec/src/oracle/enqueue_public_function_call.nr b/yarn-project/noir-libs/noir-aztec/src/oracle/enqueue_public_function_call.nr index 0c2a216a377..4e767ceeeb7 100644 --- a/yarn-project/noir-libs/noir-aztec/src/oracle/enqueue_public_function_call.nr +++ b/yarn-project/noir-libs/noir-aztec/src/oracle/enqueue_public_function_call.nr @@ -4,7 +4,7 @@ // crate::abi::FUNCTION_DATA_SIZE + // crate::abi::CALL_CONTEXT_SIZE + // = 2 + 4 + 6 -global ENQUEUE_PUBLIC_FUNCTION_CALL_RETURN_SIZE: comptime Field = 12; +global ENQUEUE_PUBLIC_FUNCTION_CALL_RETURN_SIZE: Field = 12; #[oracle(enqueuePublicFunctionCall)] fn enqueue_public_function_call_oracle( diff --git a/yarn-project/noir-libs/noir-aztec/src/oracle/notes.nr b/yarn-project/noir-libs/noir-aztec/src/oracle/notes.nr index 9deeadcea62..bd364569b66 100644 --- a/yarn-project/noir-libs/noir-aztec/src/oracle/notes.nr +++ b/yarn-project/noir-libs/noir-aztec/src/oracle/notes.nr @@ -77,10 +77,10 @@ unconstrained fn get_notes( let set_header = note_interface.set_header; for i in 0..placeholder_opt_notes.len() { if i as u32 < num_notes { - // comptime lengths named as per typescript. - let return_header_length: comptime Field = 2; // num_notes & contract_address. - let extra_preimage_length: comptime Field = 2; // nonce & is_some. - let read_offset: comptime Field = return_header_length + i * (N + extra_preimage_length); + // lengths named as per typescript. + let return_header_length: Field = 2; // num_notes & contract_address. + let extra_preimage_length: Field = 2; // nonce & is_some. + let read_offset: Field = return_header_length + i * (N + extra_preimage_length); let nonce = fields[read_offset]; let header = NoteHeader { contract_address, nonce, storage_slot }; let is_some = fields[read_offset + 1] as bool; diff --git a/yarn-project/noir-libs/noir-aztec/src/types/vec.nr b/yarn-project/noir-libs/noir-aztec/src/types/vec.nr index 4cb9ce09cbb..4f0e1c95701 100644 --- a/yarn-project/noir-libs/noir-aztec/src/types/vec.nr +++ b/yarn-project/noir-libs/noir-aztec/src/types/vec.nr @@ -1,7 +1,7 @@ struct BoundedVec { storage: [T; MaxLen], - len: comptime Field, + len: Field, } impl BoundedVec { @@ -9,7 +9,7 @@ impl BoundedVec { BoundedVec { storage: [initial_value; MaxLen], len: 0 } } - fn get(mut self: Self, index: comptime Field) -> T { + fn get(mut self: Self, index: Field) -> T { assert(index as u64 < self.len as u64); self.storage[index] } diff --git a/yarn-project/noir-libs/noir-aztec/src/utils.nr b/yarn-project/noir-libs/noir-aztec/src/utils.nr index adb72816b0d..83b9863a2e3 100644 --- a/yarn-project/noir-libs/noir-aztec/src/utils.nr +++ b/yarn-project/noir-libs/noir-aztec/src/utils.nr @@ -1,7 +1,7 @@ fn arr_copy_slice( src: [T; N], mut dst: [T; M], - offset: comptime Field, + offset: Field, ) -> [T; M] { for i in 0..dst.len() { dst[i] = src[i + offset];