diff --git a/yarn-project/Dockerfile b/yarn-project/Dockerfile index 54c26ede564..fcc719fefd1 100644 --- a/yarn-project/Dockerfile +++ b/yarn-project/Dockerfile @@ -15,7 +15,7 @@ RUN yarn workspace @aztec/noir-compiler build RUN yarn workspace @aztec/noir-contracts build:contracts # We need to build accounts as it needs to copy in account contracts from noir-contracts. RUN yarn workspace @aztec/accounts build:copy-contracts -RUN yarn workspace @aztec/noir-protocol-circuits noir:build +RUN yarn workspace @aztec/noir-protocol-circuits build RUN yarn tsc -b ENTRYPOINT ["yarn"] diff --git a/yarn-project/bootstrap.sh b/yarn-project/bootstrap.sh index 5701cbaaaf1..cd54fe0911f 100755 --- a/yarn-project/bootstrap.sh +++ b/yarn-project/bootstrap.sh @@ -36,7 +36,7 @@ yarn workspace @aztec/noir-compiler build yarn workspace @aztec/noir-contracts build:contracts yarn workspace @aztec/accounts build:copy-contracts # Build protocol circuits. TODO: move pre yarn-project. -yarn workspace @aztec/noir-protocol-circuits noir:build +yarn workspace @aztec/noir-protocol-circuits build yarn build diff --git a/yarn-project/noir-protocol-circuits/.gitignore b/yarn-project/noir-protocol-circuits/.gitignore index fef96f805be..bc5c9c9dc28 100644 --- a/yarn-project/noir-protocol-circuits/.gitignore +++ b/yarn-project/noir-protocol-circuits/.gitignore @@ -3,3 +3,4 @@ Prover.toml Verifier.toml src/target src/crs +src/types diff --git a/yarn-project/noir-protocol-circuits/package.json b/yarn-project/noir-protocol-circuits/package.json index d8217fd505e..2839c24f3bc 100644 --- a/yarn-project/noir-protocol-circuits/package.json +++ b/yarn-project/noir-protocol-circuits/package.json @@ -7,13 +7,13 @@ "./types": "./dest/types/index.js" }, "scripts": { - "build": "yarn clean && tsc -b", - "build:dev": "tsc -b --watch", - "clean": "rm -rf ./dest .tsbuildinfo", + "build": "yarn clean && yarn noir:build && yarn noir:types", + "clean": "rm -rf ./dest .tsbuildinfo src/types src/target", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "NODE_OPTIONS='--max-old-space-size=8096' run -T eslint --fix ./src && run -T prettier -w ./src", + "formatting:fix:types": "NODE_OPTIONS='--max-old-space-size=8096' run -T eslint --fix ./src/types && run -T prettier -w ./src/types", "noir:build": "cd src && ../../../noir/target/release/nargo compile --silence-warnings && rm -rf ./target/debug_*", - "noir:types": "node --loader ts-node/esm src/scripts/generate_ts_from_abi.ts && yarn formatting:fix", + "noir:types": "node --loader ts-node/esm src/scripts/generate_ts_from_abi.ts && yarn formatting:fix:types", "noir:test": "cd src && ../../../noir/target/release/nargo test", "test": "yarn test:js && yarn noir:test", "test:js": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests" diff --git a/yarn-project/noir-protocol-circuits/src/scripts/generate_ts_from_abi.ts b/yarn-project/noir-protocol-circuits/src/scripts/generate_ts_from_abi.ts index bce893dba8b..b3c5d16482a 100644 --- a/yarn-project/noir-protocol-circuits/src/scripts/generate_ts_from_abi.ts +++ b/yarn-project/noir-protocol-circuits/src/scripts/generate_ts_from_abi.ts @@ -209,11 +209,19 @@ const circuits = [ ]; const main = async () => { + try { + await fs.access('./src/types/'); + } catch (error) { + await fs.mkdir('./src/types', { recursive: true }); + } + for (const circuit of circuits) { const rawData = await fs.readFile(`./src/target/${circuit}.json`, 'utf-8'); const abiObj: NoirCompiledCircuit = JSON.parse(rawData); const generatedInterface = generateTsInterface(abiObj.abi); - await fs.writeFile(`./src/types/${circuit}_types.ts`, generatedInterface); + + const outputFile = `./src/types/${circuit}_types.ts`; + await fs.writeFile(outputFile, generatedInterface); } }; diff --git a/yarn-project/noir-protocol-circuits/src/type_conversion.ts b/yarn-project/noir-protocol-circuits/src/type_conversion.ts index 4a250ab6eec..429dabb590f 100644 --- a/yarn-project/noir-protocol-circuits/src/type_conversion.ts +++ b/yarn-project/noir-protocol-circuits/src/type_conversion.ts @@ -87,7 +87,7 @@ import { AztecAddress as NoirAztecAddress, EthAddress as NoirEthAddress, Field as NoirField, - Point as NoirPoint, + GrumpkinPoint as NoirPoint, OptionallyRevealedData as OptionallyRevealedDataNoir, PrivateCallData as PrivateCallDataNoir, PrivateCallStackItem as PrivateCallStackItemNoir, diff --git a/yarn-project/noir-protocol-circuits/src/types/private_kernel_init_types.ts b/yarn-project/noir-protocol-circuits/src/types/private_kernel_init_types.ts deleted file mode 100644 index 014514bdbd2..00000000000 --- a/yarn-project/noir-protocol-circuits/src/types/private_kernel_init_types.ts +++ /dev/null @@ -1,233 +0,0 @@ -/* Autogenerated file, do not edit! */ - -/* eslint-disable */ - -export type FixedLengthArray = L extends 0 ? never[] : T[] & { length: L }; - -export type Field = string; -export type u32 = string; - -export interface AztecAddress { - inner: Field; -} - -export interface Point { - x: Field; - y: Field; -} - -export interface EthAddress { - inner: Field; -} - -export interface ContractDeploymentData { - deployer_public_key: Point; - constructor_vk_hash: Field; - function_tree_root: Field; - contract_address_salt: Field; - portal_contract_address: EthAddress; -} - -export interface TxContext { - is_fee_payment_tx: boolean; - is_rebate_payment_tx: boolean; - is_contract_deployment_tx: boolean; - contract_deployment_data: ContractDeploymentData; - chain_id: Field; - version: Field; -} - -export interface FunctionSelector { - inner: u32; -} - -export interface FunctionData { - selector: FunctionSelector; - is_internal: boolean; - is_private: boolean; - is_constructor: boolean; -} - -export interface TxRequest { - origin: AztecAddress; - args_hash: Field; - tx_context: TxContext; - function_data: FunctionData; -} - -export interface CallContext { - msg_sender: AztecAddress; - storage_contract_address: AztecAddress; - portal_contract_address: EthAddress; - function_selector: FunctionSelector; - is_delegate_call: boolean; - is_static_call: boolean; - is_contract_deployment: boolean; - start_side_effect_counter: Field; -} - -export interface SideEffect { - value: Field; - counter: Field; -} - -export interface SideEffectLinkedToNoteHash { - value: Field; - note_hash: Field; - counter: Field; -} - -export interface BlockHeader { - note_hash_tree_root: Field; - nullifier_tree_root: Field; - contract_tree_root: Field; - l1_to_l2_message_tree_root: Field; - archive_root: Field; - public_data_tree_root: Field; - global_variables_hash: Field; -} - -export interface PrivateCircuitPublicInputs { - call_context: CallContext; - args_hash: Field; - return_values: FixedLengthArray; - read_requests: FixedLengthArray; - new_commitments: FixedLengthArray; - new_nullifiers: FixedLengthArray; - private_call_stack_hashes: FixedLengthArray; - public_call_stack_hashes: FixedLengthArray; - new_l2_to_l1_msgs: FixedLengthArray; - end_side_effect_counter: Field; - encrypted_logs_hash: FixedLengthArray; - unencrypted_logs_hash: FixedLengthArray; - encrypted_log_preimages_length: Field; - unencrypted_log_preimages_length: Field; - block_header: BlockHeader; - contract_deployment_data: ContractDeploymentData; - chain_id: Field; - version: Field; -} - -export interface PrivateCallStackItem { - contract_address: AztecAddress; - public_inputs: PrivateCircuitPublicInputs; - function_data: FunctionData; - is_execution_request: boolean; -} - -export interface CallerContext { - msg_sender: AztecAddress; - storage_contract_address: AztecAddress; -} - -export interface CallRequest { - hash: Field; - caller_contract_address: AztecAddress; - caller_context: CallerContext; - start_side_effect_counter: Field; - end_side_effect_counter: Field; -} - -export interface Proof {} - -export interface VerificationKey {} - -export interface FunctionLeafMembershipWitness { - leaf_index: Field; - sibling_path: FixedLengthArray; -} - -export interface ContractLeafMembershipWitness { - leaf_index: Field; - sibling_path: FixedLengthArray; -} - -export interface ReadRequestMembershipWitness { - leaf_index: Field; - sibling_path: FixedLengthArray; - is_transient: boolean; - hint_to_commitment: Field; -} - -export interface PrivateCallData { - call_stack_item: PrivateCallStackItem; - private_call_stack: FixedLengthArray; - public_call_stack: FixedLengthArray; - proof: Proof; - vk: VerificationKey; - function_leaf_membership_witness: FunctionLeafMembershipWitness; - contract_leaf_membership_witness: ContractLeafMembershipWitness; - read_request_membership_witnesses: FixedLengthArray; - portal_contract_address: EthAddress; - acir_hash: Field; -} - -export interface PrivateKernelInputsInit { - tx_request: TxRequest; - private_call: PrivateCallData; -} - -export interface AggregationObject {} - -export interface NewContractData { - contract_address: AztecAddress; - portal_contract_address: EthAddress; - function_tree_root: Field; -} - -export interface OptionallyRevealedData { - call_stack_item_hash: Field; - function_data: FunctionData; - vk_hash: Field; - portal_contract_address: EthAddress; - pay_fee_from_l1: boolean; - pay_fee_from_public_l2: boolean; - called_from_l1: boolean; - called_from_public_l2: boolean; -} - -export interface PublicDataUpdateRequest { - leaf_slot: Field; - old_value: Field; - new_value: Field; -} - -export interface PublicDataRead { - leaf_slot: Field; - value: Field; -} - -export interface CombinedAccumulatedData { - aggregation_object: AggregationObject; - read_requests: FixedLengthArray; - new_commitments: FixedLengthArray; - new_nullifiers: FixedLengthArray; - private_call_stack: FixedLengthArray; - public_call_stack: FixedLengthArray; - new_l2_to_l1_msgs: FixedLengthArray; - encrypted_logs_hash: FixedLengthArray; - unencrypted_logs_hash: FixedLengthArray; - encrypted_log_preimages_length: Field; - unencrypted_log_preimages_length: Field; - new_contracts: FixedLengthArray; - optionally_revealed_data: FixedLengthArray; - public_data_update_requests: FixedLengthArray; - public_data_reads: FixedLengthArray; -} - -export interface CombinedConstantData { - block_header: BlockHeader; - tx_context: TxContext; -} - -export interface KernelCircuitPublicInputs { - end: CombinedAccumulatedData; - constants: CombinedConstantData; - is_private: boolean; -} - -export type ReturnType = KernelCircuitPublicInputs; - -export interface InputType { - input: PrivateKernelInputsInit; -} diff --git a/yarn-project/noir-protocol-circuits/src/types/private_kernel_inner_types.ts b/yarn-project/noir-protocol-circuits/src/types/private_kernel_inner_types.ts deleted file mode 100644 index 3305c67df49..00000000000 --- a/yarn-project/noir-protocol-circuits/src/types/private_kernel_inner_types.ts +++ /dev/null @@ -1,234 +0,0 @@ -/* Autogenerated file, do not edit! */ - -/* eslint-disable */ - -export type FixedLengthArray = L extends 0 ? never[] : T[] & { length: L }; - -export type Field = string; -export type u32 = string; - -export interface AggregationObject {} - -export interface SideEffect { - value: Field; - counter: Field; -} - -export interface SideEffectLinkedToNoteHash { - value: Field; - note_hash: Field; - counter: Field; -} - -export interface AztecAddress { - inner: Field; -} - -export interface CallerContext { - msg_sender: AztecAddress; - storage_contract_address: AztecAddress; -} - -export interface CallRequest { - hash: Field; - caller_contract_address: AztecAddress; - caller_context: CallerContext; - start_side_effect_counter: Field; - end_side_effect_counter: Field; -} - -export interface EthAddress { - inner: Field; -} - -export interface NewContractData { - contract_address: AztecAddress; - portal_contract_address: EthAddress; - function_tree_root: Field; -} - -export interface FunctionSelector { - inner: u32; -} - -export interface FunctionData { - selector: FunctionSelector; - is_internal: boolean; - is_private: boolean; - is_constructor: boolean; -} - -export interface OptionallyRevealedData { - call_stack_item_hash: Field; - function_data: FunctionData; - vk_hash: Field; - portal_contract_address: EthAddress; - pay_fee_from_l1: boolean; - pay_fee_from_public_l2: boolean; - called_from_l1: boolean; - called_from_public_l2: boolean; -} - -export interface PublicDataUpdateRequest { - leaf_slot: Field; - old_value: Field; - new_value: Field; -} - -export interface PublicDataRead { - leaf_slot: Field; - value: Field; -} - -export interface CombinedAccumulatedData { - aggregation_object: AggregationObject; - read_requests: FixedLengthArray; - new_commitments: FixedLengthArray; - new_nullifiers: FixedLengthArray; - private_call_stack: FixedLengthArray; - public_call_stack: FixedLengthArray; - new_l2_to_l1_msgs: FixedLengthArray; - encrypted_logs_hash: FixedLengthArray; - unencrypted_logs_hash: FixedLengthArray; - encrypted_log_preimages_length: Field; - unencrypted_log_preimages_length: Field; - new_contracts: FixedLengthArray; - optionally_revealed_data: FixedLengthArray; - public_data_update_requests: FixedLengthArray; - public_data_reads: FixedLengthArray; -} - -export interface BlockHeader { - note_hash_tree_root: Field; - nullifier_tree_root: Field; - contract_tree_root: Field; - l1_to_l2_message_tree_root: Field; - archive_root: Field; - public_data_tree_root: Field; - global_variables_hash: Field; -} - -export interface Point { - x: Field; - y: Field; -} - -export interface ContractDeploymentData { - deployer_public_key: Point; - constructor_vk_hash: Field; - function_tree_root: Field; - contract_address_salt: Field; - portal_contract_address: EthAddress; -} - -export interface TxContext { - is_fee_payment_tx: boolean; - is_rebate_payment_tx: boolean; - is_contract_deployment_tx: boolean; - contract_deployment_data: ContractDeploymentData; - chain_id: Field; - version: Field; -} - -export interface CombinedConstantData { - block_header: BlockHeader; - tx_context: TxContext; -} - -export interface KernelCircuitPublicInputs { - end: CombinedAccumulatedData; - constants: CombinedConstantData; - is_private: boolean; -} - -export interface Proof {} - -export interface VerificationKey {} - -export interface PreviousKernelData { - public_inputs: KernelCircuitPublicInputs; - proof: Proof; - vk: VerificationKey; - vk_index: u32; - vk_path: FixedLengthArray; -} - -export interface CallContext { - msg_sender: AztecAddress; - storage_contract_address: AztecAddress; - portal_contract_address: EthAddress; - function_selector: FunctionSelector; - is_delegate_call: boolean; - is_static_call: boolean; - is_contract_deployment: boolean; - start_side_effect_counter: Field; -} - -export interface PrivateCircuitPublicInputs { - call_context: CallContext; - args_hash: Field; - return_values: FixedLengthArray; - read_requests: FixedLengthArray; - new_commitments: FixedLengthArray; - new_nullifiers: FixedLengthArray; - private_call_stack_hashes: FixedLengthArray; - public_call_stack_hashes: FixedLengthArray; - new_l2_to_l1_msgs: FixedLengthArray; - end_side_effect_counter: Field; - encrypted_logs_hash: FixedLengthArray; - unencrypted_logs_hash: FixedLengthArray; - encrypted_log_preimages_length: Field; - unencrypted_log_preimages_length: Field; - block_header: BlockHeader; - contract_deployment_data: ContractDeploymentData; - chain_id: Field; - version: Field; -} - -export interface PrivateCallStackItem { - contract_address: AztecAddress; - public_inputs: PrivateCircuitPublicInputs; - function_data: FunctionData; - is_execution_request: boolean; -} - -export interface FunctionLeafMembershipWitness { - leaf_index: Field; - sibling_path: FixedLengthArray; -} - -export interface ContractLeafMembershipWitness { - leaf_index: Field; - sibling_path: FixedLengthArray; -} - -export interface ReadRequestMembershipWitness { - leaf_index: Field; - sibling_path: FixedLengthArray; - is_transient: boolean; - hint_to_commitment: Field; -} - -export interface PrivateCallData { - call_stack_item: PrivateCallStackItem; - private_call_stack: FixedLengthArray; - public_call_stack: FixedLengthArray; - proof: Proof; - vk: VerificationKey; - function_leaf_membership_witness: FunctionLeafMembershipWitness; - contract_leaf_membership_witness: ContractLeafMembershipWitness; - read_request_membership_witnesses: FixedLengthArray; - portal_contract_address: EthAddress; - acir_hash: Field; -} - -export interface PrivateKernelInputsInner { - previous_kernel: PreviousKernelData; - private_call: PrivateCallData; -} - -export type ReturnType = KernelCircuitPublicInputs; - -export interface InputType { - input: PrivateKernelInputsInner; -} diff --git a/yarn-project/noir-protocol-circuits/src/types/private_kernel_ordering_types.ts b/yarn-project/noir-protocol-circuits/src/types/private_kernel_ordering_types.ts deleted file mode 100644 index b26501d646b..00000000000 --- a/yarn-project/noir-protocol-circuits/src/types/private_kernel_ordering_types.ts +++ /dev/null @@ -1,187 +0,0 @@ -/* Autogenerated file, do not edit! */ - -/* eslint-disable */ - -export type FixedLengthArray = L extends 0 ? never[] : T[] & { length: L }; - -export type Field = string; -export type u32 = string; - -export interface AggregationObject {} - -export interface SideEffect { - value: Field; - counter: Field; -} - -export interface SideEffectLinkedToNoteHash { - value: Field; - note_hash: Field; - counter: Field; -} - -export interface AztecAddress { - inner: Field; -} - -export interface CallerContext { - msg_sender: AztecAddress; - storage_contract_address: AztecAddress; -} - -export interface CallRequest { - hash: Field; - caller_contract_address: AztecAddress; - caller_context: CallerContext; - start_side_effect_counter: Field; - end_side_effect_counter: Field; -} - -export interface EthAddress { - inner: Field; -} - -export interface NewContractData { - contract_address: AztecAddress; - portal_contract_address: EthAddress; - function_tree_root: Field; -} - -export interface FunctionSelector { - inner: u32; -} - -export interface FunctionData { - selector: FunctionSelector; - is_internal: boolean; - is_private: boolean; - is_constructor: boolean; -} - -export interface OptionallyRevealedData { - call_stack_item_hash: Field; - function_data: FunctionData; - vk_hash: Field; - portal_contract_address: EthAddress; - pay_fee_from_l1: boolean; - pay_fee_from_public_l2: boolean; - called_from_l1: boolean; - called_from_public_l2: boolean; -} - -export interface PublicDataUpdateRequest { - leaf_slot: Field; - old_value: Field; - new_value: Field; -} - -export interface PublicDataRead { - leaf_slot: Field; - value: Field; -} - -export interface CombinedAccumulatedData { - aggregation_object: AggregationObject; - read_requests: FixedLengthArray; - new_commitments: FixedLengthArray; - new_nullifiers: FixedLengthArray; - private_call_stack: FixedLengthArray; - public_call_stack: FixedLengthArray; - new_l2_to_l1_msgs: FixedLengthArray; - encrypted_logs_hash: FixedLengthArray; - unencrypted_logs_hash: FixedLengthArray; - encrypted_log_preimages_length: Field; - unencrypted_log_preimages_length: Field; - new_contracts: FixedLengthArray; - optionally_revealed_data: FixedLengthArray; - public_data_update_requests: FixedLengthArray; - public_data_reads: FixedLengthArray; -} - -export interface BlockHeader { - note_hash_tree_root: Field; - nullifier_tree_root: Field; - contract_tree_root: Field; - l1_to_l2_message_tree_root: Field; - archive_root: Field; - public_data_tree_root: Field; - global_variables_hash: Field; -} - -export interface Point { - x: Field; - y: Field; -} - -export interface ContractDeploymentData { - deployer_public_key: Point; - constructor_vk_hash: Field; - function_tree_root: Field; - contract_address_salt: Field; - portal_contract_address: EthAddress; -} - -export interface TxContext { - is_fee_payment_tx: boolean; - is_rebate_payment_tx: boolean; - is_contract_deployment_tx: boolean; - contract_deployment_data: ContractDeploymentData; - chain_id: Field; - version: Field; -} - -export interface CombinedConstantData { - block_header: BlockHeader; - tx_context: TxContext; -} - -export interface KernelCircuitPublicInputs { - end: CombinedAccumulatedData; - constants: CombinedConstantData; - is_private: boolean; -} - -export interface Proof {} - -export interface VerificationKey {} - -export interface PreviousKernelData { - public_inputs: KernelCircuitPublicInputs; - proof: Proof; - vk: VerificationKey; - vk_index: u32; - vk_path: FixedLengthArray; -} - -export interface PrivateKernelInputsOrdering { - previous_kernel: PreviousKernelData; - read_commitment_hints: FixedLengthArray; - nullifier_commitment_hints: FixedLengthArray; -} - -export interface FinalAccumulatedData { - aggregation_object: AggregationObject; - new_commitments: FixedLengthArray; - new_nullifiers: FixedLengthArray; - private_call_stack: FixedLengthArray; - public_call_stack: FixedLengthArray; - new_l2_to_l1_msgs: FixedLengthArray; - encrypted_logs_hash: FixedLengthArray; - unencrypted_logs_hash: FixedLengthArray; - encrypted_log_preimages_length: Field; - unencrypted_log_preimages_length: Field; - new_contracts: FixedLengthArray; - optionally_revealed_data: FixedLengthArray; -} - -export interface KernelCircuitPublicInputsFinal { - end: FinalAccumulatedData; - constants: CombinedConstantData; - is_private: boolean; -} - -export type ReturnType = KernelCircuitPublicInputsFinal; - -export interface InputType { - input: PrivateKernelInputsOrdering; -} diff --git a/yarn-project/noir-protocol-circuits/src/types/public_kernel_private_previous_types.ts b/yarn-project/noir-protocol-circuits/src/types/public_kernel_private_previous_types.ts deleted file mode 100644 index 9b5836579b1..00000000000 --- a/yarn-project/noir-protocol-circuits/src/types/public_kernel_private_previous_types.ts +++ /dev/null @@ -1,218 +0,0 @@ -/* Autogenerated file, do not edit! */ - -/* eslint-disable */ - -export type FixedLengthArray = L extends 0 ? never[] : T[] & { length: L }; - -export type Field = string; -export type u32 = string; - -export interface AggregationObject {} - -export interface SideEffect { - value: Field; - counter: Field; -} - -export interface SideEffectLinkedToNoteHash { - value: Field; - note_hash: Field; - counter: Field; -} - -export interface AztecAddress { - inner: Field; -} - -export interface CallerContext { - msg_sender: AztecAddress; - storage_contract_address: AztecAddress; -} - -export interface CallRequest { - hash: Field; - caller_contract_address: AztecAddress; - caller_context: CallerContext; - start_side_effect_counter: Field; - end_side_effect_counter: Field; -} - -export interface EthAddress { - inner: Field; -} - -export interface NewContractData { - contract_address: AztecAddress; - portal_contract_address: EthAddress; - function_tree_root: Field; -} - -export interface FunctionSelector { - inner: u32; -} - -export interface FunctionData { - selector: FunctionSelector; - is_internal: boolean; - is_private: boolean; - is_constructor: boolean; -} - -export interface OptionallyRevealedData { - call_stack_item_hash: Field; - function_data: FunctionData; - vk_hash: Field; - portal_contract_address: EthAddress; - pay_fee_from_l1: boolean; - pay_fee_from_public_l2: boolean; - called_from_l1: boolean; - called_from_public_l2: boolean; -} - -export interface PublicDataUpdateRequest { - leaf_slot: Field; - old_value: Field; - new_value: Field; -} - -export interface PublicDataRead { - leaf_slot: Field; - value: Field; -} - -export interface CombinedAccumulatedData { - aggregation_object: AggregationObject; - read_requests: FixedLengthArray; - new_commitments: FixedLengthArray; - new_nullifiers: FixedLengthArray; - private_call_stack: FixedLengthArray; - public_call_stack: FixedLengthArray; - new_l2_to_l1_msgs: FixedLengthArray; - encrypted_logs_hash: FixedLengthArray; - unencrypted_logs_hash: FixedLengthArray; - encrypted_log_preimages_length: Field; - unencrypted_log_preimages_length: Field; - new_contracts: FixedLengthArray; - optionally_revealed_data: FixedLengthArray; - public_data_update_requests: FixedLengthArray; - public_data_reads: FixedLengthArray; -} - -export interface BlockHeader { - note_hash_tree_root: Field; - nullifier_tree_root: Field; - contract_tree_root: Field; - l1_to_l2_message_tree_root: Field; - archive_root: Field; - public_data_tree_root: Field; - global_variables_hash: Field; -} - -export interface Point { - x: Field; - y: Field; -} - -export interface ContractDeploymentData { - deployer_public_key: Point; - constructor_vk_hash: Field; - function_tree_root: Field; - contract_address_salt: Field; - portal_contract_address: EthAddress; -} - -export interface TxContext { - is_fee_payment_tx: boolean; - is_rebate_payment_tx: boolean; - is_contract_deployment_tx: boolean; - contract_deployment_data: ContractDeploymentData; - chain_id: Field; - version: Field; -} - -export interface CombinedConstantData { - block_header: BlockHeader; - tx_context: TxContext; -} - -export interface KernelCircuitPublicInputs { - end: CombinedAccumulatedData; - constants: CombinedConstantData; - is_private: boolean; -} - -export interface Proof {} - -export interface VerificationKey {} - -export interface PreviousKernelData { - public_inputs: KernelCircuitPublicInputs; - proof: Proof; - vk: VerificationKey; - vk_index: u32; - vk_path: FixedLengthArray; -} - -export interface CallContext { - msg_sender: AztecAddress; - storage_contract_address: AztecAddress; - portal_contract_address: EthAddress; - function_selector: FunctionSelector; - is_delegate_call: boolean; - is_static_call: boolean; - is_contract_deployment: boolean; - start_side_effect_counter: Field; -} - -export interface StorageUpdateRequest { - storage_slot: Field; - old_value: Field; - new_value: Field; -} - -export interface StorageRead { - storage_slot: Field; - current_value: Field; -} - -export interface PublicCircuitPublicInputs { - call_context: CallContext; - args_hash: Field; - return_values: FixedLengthArray; - contract_storage_update_requests: FixedLengthArray; - contract_storage_reads: FixedLengthArray; - public_call_stack_hashes: FixedLengthArray; - new_commitments: FixedLengthArray; - new_nullifiers: FixedLengthArray; - new_l2_to_l1_msgs: FixedLengthArray; - unencrypted_logs_hash: FixedLengthArray; - unencrypted_log_preimages_length: Field; - block_header: BlockHeader; - prover_address: AztecAddress; -} - -export interface PublicCallStackItem { - contract_address: AztecAddress; - public_inputs: PublicCircuitPublicInputs; - function_data: FunctionData; - is_execution_request: boolean; -} - -export interface PublicCallData { - call_stack_item: PublicCallStackItem; - public_call_stack: FixedLengthArray; - proof: Proof; - portal_contract_address: EthAddress; - bytecode_hash: Field; -} - -export interface PublicKernelPrivatePreviousInputs { - previous_kernel: PreviousKernelData; - public_call: PublicCallData; -} - -export type ReturnType = KernelCircuitPublicInputs; - -export interface InputType { - input: PublicKernelPrivatePreviousInputs; -} diff --git a/yarn-project/noir-protocol-circuits/src/types/public_kernel_public_previous_types.ts b/yarn-project/noir-protocol-circuits/src/types/public_kernel_public_previous_types.ts deleted file mode 100644 index 3be8bcf5fa4..00000000000 --- a/yarn-project/noir-protocol-circuits/src/types/public_kernel_public_previous_types.ts +++ /dev/null @@ -1,218 +0,0 @@ -/* Autogenerated file, do not edit! */ - -/* eslint-disable */ - -export type FixedLengthArray = L extends 0 ? never[] : T[] & { length: L }; - -export type Field = string; -export type u32 = string; - -export interface AggregationObject {} - -export interface SideEffect { - value: Field; - counter: Field; -} - -export interface SideEffectLinkedToNoteHash { - value: Field; - note_hash: Field; - counter: Field; -} - -export interface AztecAddress { - inner: Field; -} - -export interface CallerContext { - msg_sender: AztecAddress; - storage_contract_address: AztecAddress; -} - -export interface CallRequest { - hash: Field; - caller_contract_address: AztecAddress; - caller_context: CallerContext; - start_side_effect_counter: Field; - end_side_effect_counter: Field; -} - -export interface EthAddress { - inner: Field; -} - -export interface NewContractData { - contract_address: AztecAddress; - portal_contract_address: EthAddress; - function_tree_root: Field; -} - -export interface FunctionSelector { - inner: u32; -} - -export interface FunctionData { - selector: FunctionSelector; - is_internal: boolean; - is_private: boolean; - is_constructor: boolean; -} - -export interface OptionallyRevealedData { - call_stack_item_hash: Field; - function_data: FunctionData; - vk_hash: Field; - portal_contract_address: EthAddress; - pay_fee_from_l1: boolean; - pay_fee_from_public_l2: boolean; - called_from_l1: boolean; - called_from_public_l2: boolean; -} - -export interface PublicDataUpdateRequest { - leaf_slot: Field; - old_value: Field; - new_value: Field; -} - -export interface PublicDataRead { - leaf_slot: Field; - value: Field; -} - -export interface CombinedAccumulatedData { - aggregation_object: AggregationObject; - read_requests: FixedLengthArray; - new_commitments: FixedLengthArray; - new_nullifiers: FixedLengthArray; - private_call_stack: FixedLengthArray; - public_call_stack: FixedLengthArray; - new_l2_to_l1_msgs: FixedLengthArray; - encrypted_logs_hash: FixedLengthArray; - unencrypted_logs_hash: FixedLengthArray; - encrypted_log_preimages_length: Field; - unencrypted_log_preimages_length: Field; - new_contracts: FixedLengthArray; - optionally_revealed_data: FixedLengthArray; - public_data_update_requests: FixedLengthArray; - public_data_reads: FixedLengthArray; -} - -export interface BlockHeader { - note_hash_tree_root: Field; - nullifier_tree_root: Field; - contract_tree_root: Field; - l1_to_l2_message_tree_root: Field; - archive_root: Field; - public_data_tree_root: Field; - global_variables_hash: Field; -} - -export interface Point { - x: Field; - y: Field; -} - -export interface ContractDeploymentData { - deployer_public_key: Point; - constructor_vk_hash: Field; - function_tree_root: Field; - contract_address_salt: Field; - portal_contract_address: EthAddress; -} - -export interface TxContext { - is_fee_payment_tx: boolean; - is_rebate_payment_tx: boolean; - is_contract_deployment_tx: boolean; - contract_deployment_data: ContractDeploymentData; - chain_id: Field; - version: Field; -} - -export interface CombinedConstantData { - block_header: BlockHeader; - tx_context: TxContext; -} - -export interface KernelCircuitPublicInputs { - end: CombinedAccumulatedData; - constants: CombinedConstantData; - is_private: boolean; -} - -export interface Proof {} - -export interface VerificationKey {} - -export interface PreviousKernelData { - public_inputs: KernelCircuitPublicInputs; - proof: Proof; - vk: VerificationKey; - vk_index: u32; - vk_path: FixedLengthArray; -} - -export interface CallContext { - msg_sender: AztecAddress; - storage_contract_address: AztecAddress; - portal_contract_address: EthAddress; - function_selector: FunctionSelector; - is_delegate_call: boolean; - is_static_call: boolean; - is_contract_deployment: boolean; - start_side_effect_counter: Field; -} - -export interface StorageUpdateRequest { - storage_slot: Field; - old_value: Field; - new_value: Field; -} - -export interface StorageRead { - storage_slot: Field; - current_value: Field; -} - -export interface PublicCircuitPublicInputs { - call_context: CallContext; - args_hash: Field; - return_values: FixedLengthArray; - contract_storage_update_requests: FixedLengthArray; - contract_storage_reads: FixedLengthArray; - public_call_stack_hashes: FixedLengthArray; - new_commitments: FixedLengthArray; - new_nullifiers: FixedLengthArray; - new_l2_to_l1_msgs: FixedLengthArray; - unencrypted_logs_hash: FixedLengthArray; - unencrypted_log_preimages_length: Field; - block_header: BlockHeader; - prover_address: AztecAddress; -} - -export interface PublicCallStackItem { - contract_address: AztecAddress; - public_inputs: PublicCircuitPublicInputs; - function_data: FunctionData; - is_execution_request: boolean; -} - -export interface PublicCallData { - call_stack_item: PublicCallStackItem; - public_call_stack: FixedLengthArray; - proof: Proof; - portal_contract_address: EthAddress; - bytecode_hash: Field; -} - -export interface PublicKernelPublicPreviousInputs { - previous_kernel: PreviousKernelData; - public_call: PublicCallData; -} - -export type ReturnType = KernelCircuitPublicInputs; - -export interface InputType { - input: PublicKernelPublicPreviousInputs; -} diff --git a/yarn-project/noir-protocol-circuits/src/types/rollup_base_types.ts b/yarn-project/noir-protocol-circuits/src/types/rollup_base_types.ts deleted file mode 100644 index 5958cb3e182..00000000000 --- a/yarn-project/noir-protocol-circuits/src/types/rollup_base_types.ts +++ /dev/null @@ -1,255 +0,0 @@ -/* Autogenerated file, do not edit! */ - -/* eslint-disable */ - -export type FixedLengthArray = L extends 0 ? never[] : T[] & { length: L }; - -export type Field = string; -export type u32 = string; - -export interface AggregationObject {} - -export interface SideEffect { - value: Field; - counter: Field; -} - -export interface SideEffectLinkedToNoteHash { - value: Field; - note_hash: Field; - counter: Field; -} - -export interface AztecAddress { - inner: Field; -} - -export interface CallerContext { - msg_sender: AztecAddress; - storage_contract_address: AztecAddress; -} - -export interface CallRequest { - hash: Field; - caller_contract_address: AztecAddress; - caller_context: CallerContext; - start_side_effect_counter: Field; - end_side_effect_counter: Field; -} - -export interface EthAddress { - inner: Field; -} - -export interface NewContractData { - contract_address: AztecAddress; - portal_contract_address: EthAddress; - function_tree_root: Field; -} - -export interface FunctionSelector { - inner: u32; -} - -export interface FunctionData { - selector: FunctionSelector; - is_internal: boolean; - is_private: boolean; - is_constructor: boolean; -} - -export interface OptionallyRevealedData { - call_stack_item_hash: Field; - function_data: FunctionData; - vk_hash: Field; - portal_contract_address: EthAddress; - pay_fee_from_l1: boolean; - pay_fee_from_public_l2: boolean; - called_from_l1: boolean; - called_from_public_l2: boolean; -} - -export interface PublicDataUpdateRequest { - leaf_slot: Field; - old_value: Field; - new_value: Field; -} - -export interface PublicDataRead { - leaf_slot: Field; - value: Field; -} - -export interface CombinedAccumulatedData { - aggregation_object: AggregationObject; - read_requests: FixedLengthArray; - new_commitments: FixedLengthArray; - new_nullifiers: FixedLengthArray; - private_call_stack: FixedLengthArray; - public_call_stack: FixedLengthArray; - new_l2_to_l1_msgs: FixedLengthArray; - encrypted_logs_hash: FixedLengthArray; - unencrypted_logs_hash: FixedLengthArray; - encrypted_log_preimages_length: Field; - unencrypted_log_preimages_length: Field; - new_contracts: FixedLengthArray; - optionally_revealed_data: FixedLengthArray; - public_data_update_requests: FixedLengthArray; - public_data_reads: FixedLengthArray; -} - -export interface BlockHeader { - note_hash_tree_root: Field; - nullifier_tree_root: Field; - contract_tree_root: Field; - l1_to_l2_message_tree_root: Field; - archive_root: Field; - public_data_tree_root: Field; - global_variables_hash: Field; -} - -export interface Point { - x: Field; - y: Field; -} - -export interface ContractDeploymentData { - deployer_public_key: Point; - constructor_vk_hash: Field; - function_tree_root: Field; - contract_address_salt: Field; - portal_contract_address: EthAddress; -} - -export interface TxContext { - is_fee_payment_tx: boolean; - is_rebate_payment_tx: boolean; - is_contract_deployment_tx: boolean; - contract_deployment_data: ContractDeploymentData; - chain_id: Field; - version: Field; -} - -export interface CombinedConstantData { - block_header: BlockHeader; - tx_context: TxContext; -} - -export interface KernelCircuitPublicInputs { - end: CombinedAccumulatedData; - constants: CombinedConstantData; - is_private: boolean; -} - -export interface Proof {} - -export interface VerificationKey {} - -export interface PreviousKernelData { - public_inputs: KernelCircuitPublicInputs; - proof: Proof; - vk: VerificationKey; - vk_index: u32; - vk_path: FixedLengthArray; -} - -export interface AppendOnlyTreeSnapshot { - root: Field; - next_available_leaf_index: u32; -} - -export interface NullifierLeafPreimage { - nullifier: Field; - next_nullifier: Field; - next_index: u32; -} - -export interface NullifierMembershipWitness { - leaf_index: Field; - sibling_path: FixedLengthArray; -} - -export interface PublicDataTreeLeaf { - slot: Field; - value: Field; -} - -export interface PublicDataTreeLeafPreimage { - slot: Field; - value: Field; - next_slot: Field; - next_index: u32; -} - -export interface PublicDataMembershipWitness { - leaf_index: Field; - sibling_path: FixedLengthArray; -} - -export interface ArchiveRootMembershipWitness { - leaf_index: Field; - sibling_path: FixedLengthArray; -} - -export interface GlobalVariables { - chain_id: Field; - version: Field; - block_number: Field; - timestamp: Field; -} - -export interface ConstantRollupData { - archive_snapshot: AppendOnlyTreeSnapshot; - private_kernel_vk_tree_root: Field; - public_kernel_vk_tree_root: Field; - base_rollup_vk_hash: Field; - merge_rollup_vk_hash: Field; - global_variables: GlobalVariables; -} - -export interface BaseRollupInputs { - kernel_data: PreviousKernelData; - start_note_hash_tree_snapshot: AppendOnlyTreeSnapshot; - start_nullifier_tree_snapshot: AppendOnlyTreeSnapshot; - start_contract_tree_snapshot: AppendOnlyTreeSnapshot; - start_public_data_tree_snapshot: AppendOnlyTreeSnapshot; - archive_snapshot: AppendOnlyTreeSnapshot; - sorted_new_nullifiers: FixedLengthArray; - sorted_new_nullifiers_indexes: FixedLengthArray; - low_nullifier_leaf_preimages: FixedLengthArray; - low_nullifier_membership_witness: FixedLengthArray; - new_commitments_subtree_sibling_path: FixedLengthArray; - new_nullifiers_subtree_sibling_path: FixedLengthArray; - public_data_writes_subtree_sibling_path: FixedLengthArray; - new_contracts_subtree_sibling_path: FixedLengthArray; - sorted_public_data_writes: FixedLengthArray; - sorted_public_data_writes_indexes: FixedLengthArray; - low_public_data_writes_preimages: FixedLengthArray; - low_public_data_writes_witnesses: FixedLengthArray; - public_data_reads_preimages: FixedLengthArray; - public_data_reads_witnesses: FixedLengthArray; - archive_root_membership_witness: ArchiveRootMembershipWitness; - constants: ConstantRollupData; -} - -export interface BaseOrMergeRollupPublicInputs { - rollup_type: u32; - rollup_subtree_height: Field; - end_aggregation_object: AggregationObject; - constants: ConstantRollupData; - start_note_hash_tree_snapshot: AppendOnlyTreeSnapshot; - end_note_hash_tree_snapshot: AppendOnlyTreeSnapshot; - start_nullifier_tree_snapshot: AppendOnlyTreeSnapshot; - end_nullifier_tree_snapshot: AppendOnlyTreeSnapshot; - start_contract_tree_snapshot: AppendOnlyTreeSnapshot; - end_contract_tree_snapshot: AppendOnlyTreeSnapshot; - start_public_data_tree_snapshot: AppendOnlyTreeSnapshot; - end_public_data_tree_snapshot: AppendOnlyTreeSnapshot; - calldata_hash: FixedLengthArray; -} - -export type ReturnType = BaseOrMergeRollupPublicInputs; - -export interface InputType { - inputs: BaseRollupInputs; -} diff --git a/yarn-project/noir-protocol-circuits/src/types/rollup_merge_types.ts b/yarn-project/noir-protocol-circuits/src/types/rollup_merge_types.ts deleted file mode 100644 index 70023af4266..00000000000 --- a/yarn-project/noir-protocol-circuits/src/types/rollup_merge_types.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* Autogenerated file, do not edit! */ - -/* eslint-disable */ - -export type FixedLengthArray = L extends 0 ? never[] : T[] & { length: L }; - -export type Field = string; -export type u32 = string; - -export interface AggregationObject {} - -export interface AppendOnlyTreeSnapshot { - root: Field; - next_available_leaf_index: u32; -} - -export interface GlobalVariables { - chain_id: Field; - version: Field; - block_number: Field; - timestamp: Field; -} - -export interface ConstantRollupData { - archive_snapshot: AppendOnlyTreeSnapshot; - private_kernel_vk_tree_root: Field; - public_kernel_vk_tree_root: Field; - base_rollup_vk_hash: Field; - merge_rollup_vk_hash: Field; - global_variables: GlobalVariables; -} - -export interface BaseOrMergeRollupPublicInputs { - rollup_type: u32; - rollup_subtree_height: Field; - end_aggregation_object: AggregationObject; - constants: ConstantRollupData; - start_note_hash_tree_snapshot: AppendOnlyTreeSnapshot; - end_note_hash_tree_snapshot: AppendOnlyTreeSnapshot; - start_nullifier_tree_snapshot: AppendOnlyTreeSnapshot; - end_nullifier_tree_snapshot: AppendOnlyTreeSnapshot; - start_contract_tree_snapshot: AppendOnlyTreeSnapshot; - end_contract_tree_snapshot: AppendOnlyTreeSnapshot; - start_public_data_tree_snapshot: AppendOnlyTreeSnapshot; - end_public_data_tree_snapshot: AppendOnlyTreeSnapshot; - calldata_hash: FixedLengthArray; -} - -export interface Proof {} - -export interface VerificationKey {} - -export interface VKMembershipWitness { - leaf_index: Field; - sibling_path: FixedLengthArray; -} - -export interface PreviousRollupData { - base_or_merge_rollup_public_inputs: BaseOrMergeRollupPublicInputs; - proof: Proof; - vk: VerificationKey; - vk_index: u32; - vk_sibling_path: VKMembershipWitness; -} - -export interface MergeRollupInputs { - previous_rollup_data: FixedLengthArray; -} - -export type ReturnType = BaseOrMergeRollupPublicInputs; - -export interface InputType { - inputs: MergeRollupInputs; -} diff --git a/yarn-project/noir-protocol-circuits/src/types/rollup_root_types.ts b/yarn-project/noir-protocol-circuits/src/types/rollup_root_types.ts deleted file mode 100644 index ef8427a33e6..00000000000 --- a/yarn-project/noir-protocol-circuits/src/types/rollup_root_types.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* Autogenerated file, do not edit! */ - -/* eslint-disable */ - -export type FixedLengthArray = L extends 0 ? never[] : T[] & { length: L }; - -export type Field = string; -export type u32 = string; - -export interface AggregationObject {} - -export interface AppendOnlyTreeSnapshot { - root: Field; - next_available_leaf_index: u32; -} - -export interface GlobalVariables { - chain_id: Field; - version: Field; - block_number: Field; - timestamp: Field; -} - -export interface ConstantRollupData { - archive_snapshot: AppendOnlyTreeSnapshot; - private_kernel_vk_tree_root: Field; - public_kernel_vk_tree_root: Field; - base_rollup_vk_hash: Field; - merge_rollup_vk_hash: Field; - global_variables: GlobalVariables; -} - -export interface BaseOrMergeRollupPublicInputs { - rollup_type: u32; - rollup_subtree_height: Field; - end_aggregation_object: AggregationObject; - constants: ConstantRollupData; - start_note_hash_tree_snapshot: AppendOnlyTreeSnapshot; - end_note_hash_tree_snapshot: AppendOnlyTreeSnapshot; - start_nullifier_tree_snapshot: AppendOnlyTreeSnapshot; - end_nullifier_tree_snapshot: AppendOnlyTreeSnapshot; - start_contract_tree_snapshot: AppendOnlyTreeSnapshot; - end_contract_tree_snapshot: AppendOnlyTreeSnapshot; - start_public_data_tree_snapshot: AppendOnlyTreeSnapshot; - end_public_data_tree_snapshot: AppendOnlyTreeSnapshot; - calldata_hash: FixedLengthArray; -} - -export interface Proof {} - -export interface VerificationKey {} - -export interface VKMembershipWitness { - leaf_index: Field; - sibling_path: FixedLengthArray; -} - -export interface PreviousRollupData { - base_or_merge_rollup_public_inputs: BaseOrMergeRollupPublicInputs; - proof: Proof; - vk: VerificationKey; - vk_index: u32; - vk_sibling_path: VKMembershipWitness; -} - -export interface RootRollupInputs { - previous_rollup_data: FixedLengthArray; - new_l1_to_l2_messages: FixedLengthArray; - new_l1_to_l2_message_tree_root_sibling_path: FixedLengthArray; - start_l1_to_l2_message_tree_snapshot: AppendOnlyTreeSnapshot; - start_archive_snapshot: AppendOnlyTreeSnapshot; - new_archive_sibling_path: FixedLengthArray; -} - -export interface RootRollupPublicInputs { - end_aggregation_object: AggregationObject; - global_variables: GlobalVariables; - start_note_hash_tree_snapshot: AppendOnlyTreeSnapshot; - end_note_hash_tree_snapshot: AppendOnlyTreeSnapshot; - start_nullifier_tree_snapshot: AppendOnlyTreeSnapshot; - end_nullifier_tree_snapshot: AppendOnlyTreeSnapshot; - start_contract_tree_snapshot: AppendOnlyTreeSnapshot; - end_contract_tree_snapshot: AppendOnlyTreeSnapshot; - start_public_data_tree_snapshot: AppendOnlyTreeSnapshot; - end_public_data_tree_snapshot: AppendOnlyTreeSnapshot; - start_l1_to_l2_message_tree_snapshot: AppendOnlyTreeSnapshot; - end_l1_to_l2_message_tree_snapshot: AppendOnlyTreeSnapshot; - start_archive_snapshot: AppendOnlyTreeSnapshot; - end_archive_snapshot: AppendOnlyTreeSnapshot; - calldata_hash: FixedLengthArray; - l1_to_l2_messages_hash: FixedLengthArray; -} - -export type ReturnType = RootRollupPublicInputs; - -export interface InputType { - inputs: RootRollupInputs; -}