diff --git a/avm-transpiler/src/opcodes.rs b/avm-transpiler/src/opcodes.rs index ca41eba96740..60bdbc87a4ed 100644 --- a/avm-transpiler/src/opcodes.rs +++ b/avm-transpiler/src/opcodes.rs @@ -22,7 +22,6 @@ pub enum AvmOpcode { ADDRESS, STORAGEADDRESS, SENDER, - PORTAL, FEEPERL1GAS, FEEPERL2GAS, FEEPERDAGAS, @@ -102,7 +101,6 @@ impl AvmOpcode { AvmOpcode::ADDRESS => "ADDRESS", AvmOpcode::STORAGEADDRESS => "STORAGEADDRESS", AvmOpcode::SENDER => "SENDER", - AvmOpcode::PORTAL => "PORTAL", AvmOpcode::FEEPERL1GAS => "FEEPERL1GAS", AvmOpcode::FEEPERL2GAS => "FEEPERL2GAS", AvmOpcode::FEEPERDAGAS => "FEEPERDAGAS", diff --git a/avm-transpiler/src/transpile.rs b/avm-transpiler/src/transpile.rs index fda785f1ff9c..e3141da53cde 100644 --- a/avm-transpiler/src/transpile.rs +++ b/avm-transpiler/src/transpile.rs @@ -744,7 +744,6 @@ fn handle_getter_instruction( "avmOpcodeAddress" => AvmOpcode::ADDRESS, "avmOpcodeStorageAddress" => AvmOpcode::STORAGEADDRESS, "avmOpcodeSender" => AvmOpcode::SENDER, - "avmOpcodePortal" => AvmOpcode::PORTAL, "avmOpcodeFeePerL1Gas" => AvmOpcode::FEEPERL1GAS, "avmOpcodeFeePerL2Gas" => AvmOpcode::FEEPERL2GAS, "avmOpcodeFeePerDaGas" => AvmOpcode::FEEPERDAGAS, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_opcode.cpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_opcode.cpp index 05caf1ace288..00988b2e5243 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_opcode.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_opcode.cpp @@ -32,7 +32,6 @@ const std::unordered_map Bytecode::OPERANDS_NUM = { //{OpCode::ADDRESS, }, //{OpCode::STORAGEADDRESS, }, //{OpCode::SENDER, }, - //{OpCode::PORTAL, }, //{OpCode::FEEPERL1GAS, }, //{OpCode::FEEPERL2GAS, }, //{OpCode::FEEPERDAGAS, }, @@ -116,7 +115,6 @@ bool Bytecode::has_in_tag(OpCode const op_code) case OpCode::ADDRESS: case OpCode::STORAGEADDRESS: case OpCode::SENDER: - case OpCode::PORTAL: case OpCode::FEEPERL1GAS: case OpCode::FEEPERL2GAS: case OpCode::FEEPERDAGAS: diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_opcode.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_opcode.hpp index 98adf14ab291..abd46c2af76e 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_opcode.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_opcode.hpp @@ -41,7 +41,6 @@ enum class OpCode : uint8_t { ADDRESS, STORAGEADDRESS, SENDER, - PORTAL, FEEPERL1GAS, FEEPERL2GAS, FEEPERDAGAS, diff --git a/docs/src/preprocess/InstructionSet/InstructionSet.js b/docs/src/preprocess/InstructionSet/InstructionSet.js index 496b2a8128d7..01d9c3a1efb9 100644 --- a/docs/src/preprocess/InstructionSet/InstructionSet.js +++ b/docs/src/preprocess/InstructionSet/InstructionSet.js @@ -547,24 +547,6 @@ const INSTRUCTION_SET_RAW = [ "Tag checks": "", "Tag updates": "`T[dstOffset] = u32`", }, - { - id: "portal", - Name: "`PORTAL`", - Category: "Execution Environment", - Flags: [{ name: "indirect", description: INDIRECT_FLAG_DESCRIPTION }], - Args: [ - { - name: "dstOffset", - description: - "memory offset specifying where to store operation's result", - }, - ], - Expression: "`M[dstOffset] = context.environment.portal`", - Summary: "Get the address of the l1 portal contract", - Details: "", - "Tag checks": "", - "Tag updates": "`T[dstOffset] = u32`", - }, { id: "feeperl1gas", Name: "`FEEPERL1GAS`", diff --git a/l1-contracts/src/core/libraries/ConstantsGen.sol b/l1-contracts/src/core/libraries/ConstantsGen.sol index 6661fc67443d..ede0efc514de 100644 --- a/l1-contracts/src/core/libraries/ConstantsGen.sol +++ b/l1-contracts/src/core/libraries/ConstantsGen.sol @@ -89,7 +89,7 @@ library Constants { uint256 internal constant DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_MAGIC_VALUE = 0x85864497636cf755ae7bde03f267ce01a520981c21c3682aaf82a631; uint256 internal constant DEPLOYER_CONTRACT_ADDRESS = - 0x1b5ecf3d26907648cf737f4304759b8c5850478e839e72f8ce1f5791b286e8f2; + 0x24d36d8806d145ee074d1a71502afa0452f9a202e6061d8324573387dab2220f; uint256 internal constant AZTEC_ADDRESS_LENGTH = 1; uint256 internal constant DIMENSION_GAS_SETTINGS_LENGTH = 3; uint256 internal constant GAS_FEES_LENGTH = 3; diff --git a/noir-projects/aztec-nr/aztec/src/deploy.nr b/noir-projects/aztec-nr/aztec/src/deploy.nr index 60f7fef0620e..53fda2bee032 100644 --- a/noir-projects/aztec-nr/aztec/src/deploy.nr +++ b/noir-projects/aztec-nr/aztec/src/deploy.nr @@ -20,9 +20,8 @@ pub fn deploy_contract(context: &mut PrivateContext, target: AztecAddress) { serialized_args[0] = instance.salt; serialized_args[1] = instance.contract_class_id.to_field(); serialized_args[2] = instance.initialization_hash; - serialized_args[3] = instance.portal_contract_address.to_field(); - serialized_args[4] = instance.public_keys_hash.to_field(); - serialized_args[5] = universal_deploy as Field; + serialized_args[3] = instance.public_keys_hash.to_field(); + serialized_args[4] = universal_deploy as Field; let _call_result = context.call_private_function( AztecAddress::from_field(DEPLOYER_CONTRACT_ADDRESS), diff --git a/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr index 10a02855db5e..f3f6cce19486 100644 --- a/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr @@ -24,6 +24,7 @@ contract AvmTest { global big_field_136_bits: Field = 0x991234567890abcdef1234567890abcdef; // Libs + use dep::aztec::protocol_types::constants::CONTRACT_INSTANCE_LENGTH; use dep::aztec::prelude::{Map, Deserialize}; use dep::aztec::state_vars::PublicMutable; use dep::aztec::protocol_types::{address::{AztecAddress, EthAddress}, constants::L1_TO_L2_MESSAGE_LENGTH}; @@ -172,14 +173,14 @@ contract AvmTest { #[aztec(public-vm)] fn test_get_contract_instance_raw() { let fields = get_contract_instance_internal_avm(context.this_address()); - assert(fields.len() == 7); + // The values here should match those in `avm_simulator.test.ts>Contract>GETCONTRACTINSTANCE deserializes correctly` + assert(fields.len() == CONTRACT_INSTANCE_LENGTH + 1); assert(fields[0] == 0x1); assert(fields[1] == 0x123); assert(fields[2] == 0x456); assert(fields[3] == 0x789); assert(fields[4] == 0x101112); - assert(fields[5] == 0x131415); - assert(fields[6] == 0x161718); + assert(fields[5] == 0x161718); } #[aztec(public-vm)] diff --git a/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/events/instance_deployed.nr b/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/events/instance_deployed.nr index 0438fef4ca60..638a08db001e 100644 --- a/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/events/instance_deployed.nr +++ b/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/events/instance_deployed.nr @@ -11,12 +11,11 @@ struct ContractInstanceDeployed { salt: Field, contract_class_id: ContractClassId, initialization_hash: Field, - portal_contract_address: EthAddress, public_keys_hash: PublicKeysHash, deployer: AztecAddress, } -global CONTRACT_INSTANCE_DEPLOYED_SERIALIZED_SIZE: Field = 9; +global CONTRACT_INSTANCE_DEPLOYED_SERIALIZED_SIZE: Field = 8; impl Serialize for ContractInstanceDeployed { fn serialize(self: Self) -> [Field; CONTRACT_INSTANCE_DEPLOYED_SERIALIZED_SIZE] { @@ -27,7 +26,6 @@ impl Serialize for ContractInstanceD self.salt, self.contract_class_id.to_field(), self.initialization_hash, - self.portal_contract_address.to_field(), self.public_keys_hash.to_field(), self.deployer.to_field(), ] diff --git a/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/main.nr b/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/main.nr index 3363324acff7..be72d82acbd8 100644 --- a/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/main.nr @@ -16,7 +16,6 @@ contract ContractInstanceDeployer { salt: Field, contract_class_id: ContractClassId, initialization_hash: Field, - portal_contract_address: EthAddress, public_keys_hash: PublicKeysHash, universal_deploy: bool ) { @@ -28,13 +27,7 @@ contract ContractInstanceDeployer { context.msg_sender() }; - let partial_address = PartialAddress::compute( - contract_class_id, - salt, - initialization_hash, - portal_contract_address, - deployer - ); + let partial_address = PartialAddress::compute(contract_class_id, salt, initialization_hash, deployer); let address = AztecAddress::compute(public_keys_hash, partial_address); @@ -42,16 +35,7 @@ contract ContractInstanceDeployer { context.push_new_nullifier(address.to_field(), 0); // Broadcast the event - let event = ContractInstanceDeployed { - contract_class_id, - address, - public_keys_hash, - portal_contract_address, - initialization_hash, - salt, - deployer, - version: 1 - }; + let event = ContractInstanceDeployed { contract_class_id, address, public_keys_hash, initialization_hash, salt, deployer, version: 1 }; let event_payload = event.serialize(); dep::aztec::oracle::debug_log::debug_log_array_with_prefix("ContractInstanceDeployed", event_payload); emit_unencrypted_log_from_private(&mut context, event_payload); diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_app_logic.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_app_logic.nr index dda4e888bdca..116db77755e1 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_app_logic.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_app_logic.nr @@ -268,7 +268,7 @@ mod tests { let mut builder = PublicKernelAppLogicCircuitPrivateInputsBuilder::new(); let contract_address = builder.public_call.contract_address; - let portal_contract_address = builder.public_call.portal_contract_address; + let portal_contract_address = EthAddress::from_field(0xdead); // Setup 1 new l2 to l1 message on the previous kernel. let previous = [12345]; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/call_context.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/call_context.nr index 870e4b80df5d..ad5c2db528b5 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/call_context.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/call_context.nr @@ -9,7 +9,6 @@ use crate::{ struct CallContext { msg_sender : AztecAddress, storage_contract_address : AztecAddress, - portal_contract_address : EthAddress, function_selector : FunctionSelector, gas_left: Gas, @@ -51,7 +50,6 @@ impl Serialize for CallContext { serialized.push(self.msg_sender.to_field()); serialized.push(self.storage_contract_address.to_field()); - serialized.push(self.portal_contract_address.to_field()); serialized.push(self.function_selector.to_field()); serialized.extend_from_array(self.gas_left.serialize()); serialized.push(self.is_delegate_call as Field); @@ -70,7 +68,6 @@ impl Deserialize for CallContext { CallContext { msg_sender: AztecAddress::from_field(reader.read()), storage_contract_address: AztecAddress::from_field(reader.read()), - portal_contract_address: EthAddress::from_field(reader.read()), function_selector: FunctionSelector::from_field(reader.read()), gas_left: reader.read_struct(Gas::deserialize), is_delegate_call: reader.read() as bool, @@ -87,7 +84,6 @@ impl Empty for CallContext { CallContext { msg_sender: AztecAddress::empty(), storage_contract_address: AztecAddress::empty(), - portal_contract_address: EthAddress::empty(), function_selector: FunctionSelector::empty(), gas_left: Gas::empty(), is_delegate_call: false, diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel/private_call_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel/private_call_data.nr index 40ffa87a975b..21f918449599 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel/private_call_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel/private_call_data.nr @@ -27,6 +27,5 @@ struct PrivateCallData { note_hash_read_request_membership_witnesses: [NoteHashReadRequestMembershipWitness; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL], - portal_contract_address: EthAddress, acir_hash: Field, } diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_call_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_call_data.nr index 8d762839c99b..2509462b6cea 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_call_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_call_data.nr @@ -8,6 +8,5 @@ struct PublicCallData { call_stack_item: PublicCallStackItem, public_call_stack: [CallRequest; MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL], proof: Proof, - portal_contract_address: EthAddress, bytecode_hash: Field, } diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/address/aztec_address.nr b/noir-projects/noir-protocol-circuits/crates/types/src/address/aztec_address.nr index 86a1fb4549db..7396f63c7eed 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/address/aztec_address.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/address/aztec_address.nr @@ -58,18 +58,11 @@ impl AztecAddress { contract_class_id: ContractClassId, salt: Field, initialization_hash: Field, - portal_contract_address: EthAddress, deployer: AztecAddress ) -> AztecAddress { AztecAddress::compute( PublicKeysHash::compute(pub_key), - PartialAddress::compute( - contract_class_id, - salt, - initialization_hash, - portal_contract_address, - deployer - ) + PartialAddress::compute(contract_class_id, salt, initialization_hash, deployer) ) } @@ -102,15 +95,13 @@ fn compute_address() { let contract_address_salt = 3; let contract_class_id = ContractClassId::from_field(4); let initialization_hash = 5; - let portal_contract_address = EthAddress::from_field(6); - let deployer = AztecAddress::from_field(7); + let deployer = AztecAddress::from_field(6); let address = AztecAddress::compute_from_public_key( point, contract_class_id, contract_address_salt, initialization_hash, - portal_contract_address, deployer ); diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/address/partial_address.nr b/noir-projects/noir-protocol-circuits/crates/types/src/address/partial_address.nr index 359fae794ba8..3829d951a8d7 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/address/partial_address.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/address/partial_address.nr @@ -41,12 +41,11 @@ impl PartialAddress { contract_class_id: ContractClassId, salt: Field, initialization_hash: Field, - portal_contract_address: EthAddress, deployer: AztecAddress ) -> Self { PartialAddress::compute_from_salted_initialization_hash( contract_class_id, - SaltedInitializationHash::compute(salt, initialization_hash, portal_contract_address, deployer) + SaltedInitializationHash::compute(salt, initialization_hash, deployer) ) } diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/address/salted_initialization_hash.nr b/noir-projects/noir-protocol-circuits/crates/types/src/address/salted_initialization_hash.nr index 88af664b86b4..ca916f85ac75 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/address/salted_initialization_hash.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/address/salted_initialization_hash.nr @@ -19,19 +19,13 @@ impl SaltedInitializationHash { Self { inner: field } } - pub fn compute( - salt: Field, - initialization_hash: Field, - portal_contract_address: EthAddress, - deployer: AztecAddress - ) -> Self { + pub fn compute(salt: Field, initialization_hash: Field, deployer: AztecAddress) -> Self { SaltedInitializationHash::from_field( pedersen_hash( [ salt, initialization_hash, - deployer.to_field(), - portal_contract_address.to_field() + deployer.to_field() ], GENERATOR_INDEX__PARTIAL_ADDRESS ) diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr b/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr index e8e5f1cf2ee7..642f702001f1 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr @@ -126,7 +126,7 @@ global REGISTERER_UNCONSTRAINED_FUNCTION_BROADCASTED_MAGIC_VALUE = 0xe7af8166354 // CONTRACT INSTANCE CONSTANTS // sha224sum 'struct ContractInstanceDeployed' global DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_MAGIC_VALUE = 0x85864497636cf755ae7bde03f267ce01a520981c21c3682aaf82a631; -global DEPLOYER_CONTRACT_ADDRESS = 0x1b5ecf3d26907648cf737f4304759b8c5850478e839e72f8ce1f5791b286e8f2; +global DEPLOYER_CONTRACT_ADDRESS = 0x24d36d8806d145ee074d1a71502afa0452f9a202e6061d8324573387dab2220f; // LENGTH OF STRUCTS SERIALIZED TO FIELDS global AZTEC_ADDRESS_LENGTH = 1; @@ -134,9 +134,9 @@ global DIMENSION_GAS_SETTINGS_LENGTH: u64 = 3; global GAS_FEES_LENGTH: u64 = 3; global GAS_LENGTH: u64 = 3; global GAS_SETTINGS_LENGTH: u64 = 1 + 3 * DIMENSION_GAS_SETTINGS_LENGTH; -global CALL_CONTEXT_LENGTH: u64 = 8 + GAS_SETTINGS_LENGTH + GAS_LENGTH; +global CALL_CONTEXT_LENGTH: u64 = 7 + GAS_SETTINGS_LENGTH + GAS_LENGTH; global CONTENT_COMMITMENT_LENGTH: u64 = 4; -global CONTRACT_INSTANCE_LENGTH: u64 = 6; +global CONTRACT_INSTANCE_LENGTH: u64 = 5; global CONTRACT_STORAGE_READ_LENGTH: u64 = 2; global CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH: u64 = 2; global ETH_ADDRESS_LENGTH = 1; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/contract_instance.nr b/noir-projects/noir-protocol-circuits/crates/types/src/contract_instance.nr index 9e7fc39d8bc8..1780cbd12abd 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/contract_instance.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/contract_instance.nr @@ -13,7 +13,6 @@ struct ContractInstance { deployer: AztecAddress, contract_class_id : ContractClassId, initialization_hash : Field, - portal_contract_address : EthAddress, public_keys_hash : PublicKeysHash, } @@ -22,8 +21,7 @@ impl Eq for ContractInstance { self.public_keys_hash.eq(other.public_keys_hash) & self.initialization_hash.eq(other.initialization_hash) & self.contract_class_id.eq(other.contract_class_id) & - self.salt.eq(other.salt) & - self.portal_contract_address.eq(other.portal_contract_address) + self.salt.eq(other.salt) } } @@ -34,7 +32,6 @@ impl Serialize for ContractInstance { self.deployer.to_field(), self.contract_class_id.to_field(), self.initialization_hash, - self.portal_contract_address.to_field(), self.public_keys_hash.to_field() ] } @@ -47,8 +44,7 @@ impl Deserialize for ContractInstance { deployer: AztecAddress::from_field(serialized[1]), contract_class_id: ContractClassId::from_field(serialized[2]), initialization_hash: serialized[3], - portal_contract_address: EthAddress::from_field(serialized[4]), - public_keys_hash: PublicKeysHash::from_field(serialized[5]), + public_keys_hash: PublicKeysHash::from_field(serialized[4]), } } } @@ -67,7 +63,6 @@ impl ContractInstance { self.contract_class_id, self.salt, self.initialization_hash, - self.portal_contract_address, self.deployer ) ) diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/contracts.nr b/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/contracts.nr index 6aa8598dc168..9d3cd0d01ded 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/contracts.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/contracts.nr @@ -7,7 +7,6 @@ struct ContractData { artifact_hash: Field, contract_address_salt: Field, contract_class_id: ContractClassId, - portal_contract_address: EthAddress, private_functions_root: Field, public_bytecode_commitment: Field, public_keys_hash: PublicKeysHash, @@ -24,7 +23,6 @@ global default_contract = ContractData { private_functions_root: 0x19a3cc0b714976fb35d58b684ba36e86f82bac8b87517904a2727e5113fb4cba, address: AztecAddress { inner: 0x25de5f29a6d515e67d0ac85f399098acd03c5d4a4884b8c560aee68014715ef1 }, partial_address: PartialAddress { inner: 0x1420f3a4c4a589be4ea00c0a131dc00127d566725b21dcd1fb421a724710e66b }, - portal_contract_address: EthAddress { inner: 0x0000000000000000000000000000000000005ba0 }, contract_class_id: ContractClassId { inner: 0x0ce2a998337b1e6da1ac1d802a8bb9e10b7d705d210e61efb9642855009814a6 }, public_keys_hash: PublicKeysHash { inner: 0x000000000000000000000000000000000000000000000000000000000000b26e }, salted_initialization_hash: SaltedInitializationHash { inner: 0x2003637d02f08887d36dc2f27dd961f51f17e0a8a43dc0268dfcefcd96efc3a4 }, @@ -39,7 +37,6 @@ global parent_contract = ContractData { private_functions_root: 0x2c1c949cb226995de94b7b8b5aeaab440739f2dfeb06d358441f60932cf243a7, address: AztecAddress { inner: 0x178916e52e64b3880e7f837ab30e58222b2971f0150cbc16060bb3589fd96e23 }, partial_address: PartialAddress { inner: 0x009a6e74b3cebfe0351ceec448d722aa973c1c9da63bbf9f902f1896f3fa1832 }, - portal_contract_address: EthAddress { inner: 0x0000000000000000000000000000000000000913 }, contract_class_id: ContractClassId { inner: 0x1f1f963a350e2c883cc6730c19fc5d5b47a40694d805cbb0720fa76fe295df90 }, public_keys_hash: PublicKeysHash { inner: 0x00000000000000000000000000000000000000000000000000000000000011c1 }, salted_initialization_hash: SaltedInitializationHash { inner: 0x275e153c147f9cb61a5e7b354e81484696d6a54ffc251dcf4ed8276ab24868d2 }, diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/tests/private_call_data_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/tests/private_call_data_builder.nr index bceb7f0fbba5..be22067b4cc0 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/tests/private_call_data_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/tests/private_call_data_builder.nr @@ -37,7 +37,6 @@ struct PrivateCallDataBuilder { contract_class_public_bytecode_commitment: Field, function_leaf_membership_witness: FunctionLeafMembershipWitness, note_hash_read_request_membership_witnesses: BoundedVec, - portal_contract_address: EthAddress, acir_hash: Field, gas_settings: GasSettings, } @@ -65,7 +64,6 @@ impl PrivateCallDataBuilder { contract_class_artifact_hash: contract_data.artifact_hash, contract_class_public_bytecode_commitment: contract_data.public_bytecode_commitment, note_hash_read_request_membership_witnesses: BoundedVec::new(), - portal_contract_address: public_inputs.call_context.portal_contract_address, acir_hash: contract_function.acir_hash, gas_settings: public_inputs.call_context.gas_settings } @@ -74,7 +72,6 @@ impl PrivateCallDataBuilder { pub fn is_delegate_call(&mut self) -> Self { self.public_inputs.call_context.is_delegate_call = true; self.public_inputs.call_context.storage_contract_address = fixtures::contracts::parent_contract.address; - self.public_inputs.call_context.portal_contract_address = fixtures::contracts::parent_contract.portal_contract_address; self.public_inputs.call_context.msg_sender = fixtures::MSG_SENDER; *self } @@ -201,7 +198,6 @@ impl PrivateCallDataBuilder { contract_class_artifact_hash: self.contract_class_artifact_hash, contract_class_public_bytecode_commitment: self.contract_class_public_bytecode_commitment, note_hash_read_request_membership_witnesses: self.note_hash_read_request_membership_witnesses.storage, - portal_contract_address: self.portal_contract_address, acir_hash: self.acir_hash } } diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/tests/private_circuit_public_inputs_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/tests/private_circuit_public_inputs_builder.nr index e72d8ee686ea..c4c45120452b 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/tests/private_circuit_public_inputs_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/tests/private_circuit_public_inputs_builder.nr @@ -13,9 +13,9 @@ use crate::{ MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_NEW_NOTE_HASHES_PER_CALL, MAX_NEW_NULLIFIERS_PER_CALL, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, - MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, MAX_NEW_L2_TO_L1_MSGS_PER_CALL, - MAX_ENCRYPTED_LOGS_PER_CALL, MAX_UNENCRYPTED_LOGS_PER_CALL - }, + MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, MAX_NEW_L2_TO_L1_MSGS_PER_CALL, MAX_ENCRYPTED_LOGS_PER_CALL, + MAX_UNENCRYPTED_LOGS_PER_CALL +}, traits::Empty }; @@ -59,7 +59,6 @@ impl PrivateCircuitPublicInputsBuilder { let args_hash = 0; let contract_data = fixtures::contracts::default_contract; - let portal_contract_address = contract_data.portal_contract_address; let contract_function = fixtures::contract_functions::default_private_function; let function_data = contract_function.data; @@ -69,7 +68,6 @@ impl PrivateCircuitPublicInputsBuilder { let call_context = CallContext { msg_sender: fixtures::contracts::parent_contract.address, storage_contract_address: contract_address, - portal_contract_address, function_selector: function_data.selector, is_delegate_call: false, is_static_call: false, diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/tests/public_call_data_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/tests/public_call_data_builder.nr index 262a2dd4c546..92e928712fc2 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/tests/public_call_data_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/tests/public_call_data_builder.nr @@ -21,7 +21,6 @@ struct PublicCallDataBuilder { function_data: FunctionData, public_call_stack: BoundedVec, proof: Proof, - portal_contract_address: EthAddress, bytecode_hash: Field, } @@ -29,7 +28,6 @@ impl PublicCallDataBuilder { pub fn new() -> Self { let contract_data = fixtures::contracts::default_contract; let contract_address = contract_data.address; - let portal_contract_address = contract_data.portal_contract_address; let contract_function = fixtures::contract_functions::default_public_function; let function_data = contract_function.data; @@ -39,7 +37,6 @@ impl PublicCallDataBuilder { public_inputs.call_context = CallContext { msg_sender: fixtures::contracts::parent_contract.address, storage_contract_address: contract_address, - portal_contract_address, function_selector: function_data.selector, is_delegate_call: false, is_static_call: false, @@ -56,7 +53,6 @@ impl PublicCallDataBuilder { function_data, public_call_stack: BoundedVec::new(), proof: Proof {}, - portal_contract_address, bytecode_hash: contract_function.acir_hash } } @@ -64,7 +60,6 @@ impl PublicCallDataBuilder { pub fn is_delegate_call(&mut self) -> Self { self.public_inputs.call_context.is_delegate_call = true; self.public_inputs.call_context.storage_contract_address = fixtures::contracts::parent_contract.address; - self.public_inputs.call_context.portal_contract_address = fixtures::contracts::parent_contract.portal_contract_address; self.public_inputs.call_context.msg_sender = fixtures::MSG_SENDER; *self } @@ -168,7 +163,6 @@ impl PublicCallDataBuilder { }, public_call_stack: self.public_call_stack.storage, proof: self.proof, - portal_contract_address: self.portal_contract_address, bytecode_hash: self.bytecode_hash } } diff --git a/yarn-project/aztec.js/src/contract/contract.ts b/yarn-project/aztec.js/src/contract/contract.ts index 36b4c831a4bd..7c5c272cd8b2 100644 --- a/yarn-project/aztec.js/src/contract/contract.ts +++ b/yarn-project/aztec.js/src/contract/contract.ts @@ -20,7 +20,6 @@ export class Contract extends ContractBase { * @param address - The deployed contract's address. * @param artifact - Build artifact of the contract. * @param wallet - The wallet to use when interacting with the contract. - * @param portalContract - The portal contract address on L1, if any. * @returns A promise that resolves to a new Contract instance. */ public static async at(address: AztecAddress, artifact: ContractArtifact, wallet: Wallet): Promise { diff --git a/yarn-project/aztec.js/src/contract/deploy_method.ts b/yarn-project/aztec.js/src/contract/deploy_method.ts index 214e83c7d0e6..06520d3b017a 100644 --- a/yarn-project/aztec.js/src/contract/deploy_method.ts +++ b/yarn-project/aztec.js/src/contract/deploy_method.ts @@ -23,7 +23,7 @@ import { DeploySentTx } from './deploy_sent_tx.js'; /** * Options for deploying a contract on the Aztec network. - * Allows specifying a portal contract, contract address salt, and additional send method options. + * Allows specifying a contract address salt, and additional send method options. */ export type DeployOptions = { /** An optional salt value used to deterministically calculate the contract address. */ @@ -74,7 +74,7 @@ export class DeployMethod extends Bas * the transaction for deployment. The resulting signed transaction can be * later sent using the `send()` method. * - * @param options - An object containing optional deployment settings, including portalContract, contractAddressSalt, and from. + * @param options - An object containing optional deployment settings, contractAddressSalt, and from. * @returns A Promise resolving to an object containing the signed transaction data and other relevant information. */ public async create(options: DeployOptions = {}): Promise { @@ -184,7 +184,7 @@ export class DeployMethod extends Bas * This function extends the 'send' method from the ContractFunctionInteraction class, * allowing us to send a transaction specifically for contract deployment. * - * @param options - An object containing various deployment options such as portalContract, contractAddressSalt, and from. + * @param options - An object containing various deployment options such as contractAddressSalt and from. * @returns A SentTx object that returns the receipt and the deployed contract instance. */ public override send(options: DeployOptions = {}): DeploySentTx { diff --git a/yarn-project/aztec.js/src/deployment/deploy_instance.ts b/yarn-project/aztec.js/src/deployment/deploy_instance.ts index c6ff64a99920..fe8ec9ae42d8 100644 --- a/yarn-project/aztec.js/src/deployment/deploy_instance.ts +++ b/yarn-project/aztec.js/src/deployment/deploy_instance.ts @@ -11,7 +11,7 @@ import { getDeployerContract } from './protocol_contracts.js'; */ export function deployInstance(wallet: Wallet, instance: ContractInstanceWithAddress): ContractFunctionInteraction { const deployerContract = getDeployerContract(wallet); - const { salt, contractClassId, portalContractAddress, publicKeysHash, deployer } = instance; + const { salt, contractClassId, publicKeysHash, deployer } = instance; const isUniversalDeploy = deployer.isZero(); if (!isUniversalDeploy && !wallet.getAddress().equals(deployer)) { throw new Error( @@ -22,7 +22,6 @@ export function deployInstance(wallet: Wallet, instance: ContractInstanceWithAdd salt, contractClassId, instance.initializationHash, - portalContractAddress, publicKeysHash, isUniversalDeploy, ); diff --git a/yarn-project/circuit-types/src/interfaces/pxe.ts b/yarn-project/circuit-types/src/interfaces/pxe.ts index ab72749fe784..9c5ac6a8c697 100644 --- a/yarn-project/circuit-types/src/interfaces/pxe.ts +++ b/yarn-project/circuit-types/src/interfaces/pxe.ts @@ -297,7 +297,7 @@ export interface PXE { getSyncStatus(): Promise; /** - * Returns a Contact Instance given its address, which includes the contract class identifier, portal address, + * Returns a Contact Instance given its address, which includes the contract class identifier, * initialization hash, deployment salt, and public keys hash. * TODO(@spalladino): Should we return the public keys in plain as well here? * @param address - Deployment address of the contract. diff --git a/yarn-project/circuits.js/src/constants.gen.ts b/yarn-project/circuits.js/src/constants.gen.ts index 6441113ed89e..2f5533f765b1 100644 --- a/yarn-project/circuits.js/src/constants.gen.ts +++ b/yarn-project/circuits.js/src/constants.gen.ts @@ -74,15 +74,15 @@ export const REGISTERER_UNCONSTRAINED_FUNCTION_BROADCASTED_MAGIC_VALUE = 0xe7af816635466f128568edb04c9fa024f6c87fb9010fdbffa68b3d99n; export const DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_MAGIC_VALUE = 0x85864497636cf755ae7bde03f267ce01a520981c21c3682aaf82a631n; -export const DEPLOYER_CONTRACT_ADDRESS = 0x1b5ecf3d26907648cf737f4304759b8c5850478e839e72f8ce1f5791b286e8f2n; +export const DEPLOYER_CONTRACT_ADDRESS = 0x24d36d8806d145ee074d1a71502afa0452f9a202e6061d8324573387dab2220fn; export const AZTEC_ADDRESS_LENGTH = 1; export const DIMENSION_GAS_SETTINGS_LENGTH = 3; export const GAS_FEES_LENGTH = 3; export const GAS_LENGTH = 3; export const GAS_SETTINGS_LENGTH = 1 + 3 * DIMENSION_GAS_SETTINGS_LENGTH; -export const CALL_CONTEXT_LENGTH = 8 + GAS_SETTINGS_LENGTH + GAS_LENGTH; +export const CALL_CONTEXT_LENGTH = 7 + GAS_SETTINGS_LENGTH + GAS_LENGTH; export const CONTENT_COMMITMENT_LENGTH = 4; -export const CONTRACT_INSTANCE_LENGTH = 6; +export const CONTRACT_INSTANCE_LENGTH = 5; export const CONTRACT_STORAGE_READ_LENGTH = 2; export const CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH = 2; export const ETH_ADDRESS_LENGTH = 1; diff --git a/yarn-project/circuits.js/src/contract/__snapshots__/contract_address.test.ts.snap b/yarn-project/circuits.js/src/contract/__snapshots__/contract_address.test.ts.snap index cef9ff11261d..ab204be1aaf2 100644 --- a/yarn-project/circuits.js/src/contract/__snapshots__/contract_address.test.ts.snap +++ b/yarn-project/circuits.js/src/contract/__snapshots__/contract_address.test.ts.snap @@ -4,10 +4,10 @@ exports[`ContractAddress Address from partial matches Noir 1`] = `"0x0447f893197 exports[`ContractAddress Public key hash matches Noir 1`] = `"0x1923a6246e305720b6aaf751fde0342613e93c82e455c3831e28375c16dd40d8"`; -exports[`ContractAddress computeContractAddressFromInstance 1`] = `"0x027ea2b41ced2ec9a98305984e96dd28518536a4628883ccdc06e38aa8997220"`; +exports[`ContractAddress computeContractAddressFromInstance 1`] = `"0x199b282e646810bcb33c5b334a21c63de8904e27ddb89ef450c8ae38dd72a19c"`; exports[`ContractAddress computeInitializationHash 1`] = `Fr<0x109865e4b959adba34b722e72a69baaf9ee78e31bb1042318f0d91006ed86780>`; exports[`ContractAddress computePartialAddress 1`] = `Fr<0x1923a6246e305720b6aaf751fde0342613e93c82e455c3831e28375c16dd40d8>`; -exports[`ContractAddress computeSaltedInitializationHash 1`] = `Fr<0x25e70e2b5cf1171b74aa1ab4bf1973859a65949a4c83a5365d71434d2062b2b4>`; +exports[`ContractAddress computeSaltedInitializationHash 1`] = `Fr<0x15cf30c8f37df5115e0cafbccce8f46a86e5e76487d7d9be48e0fd641c46e77c>`; diff --git a/yarn-project/circuits.js/src/contract/contract_address.test.ts b/yarn-project/circuits.js/src/contract/contract_address.test.ts index 47a98c800715..f24ce0a12338 100644 --- a/yarn-project/circuits.js/src/contract/contract_address.test.ts +++ b/yarn-project/circuits.js/src/contract/contract_address.test.ts @@ -2,7 +2,7 @@ import { ABIParameterVisibility, type FunctionAbi, FunctionType } from '@aztec/f import { Fr, Point } from '@aztec/foundation/fields'; import { setupCustomSnapshotSerializers, updateInlineTestData } from '@aztec/foundation/testing'; -import { AztecAddress, EthAddress } from '../index.js'; +import { AztecAddress } from '../index.js'; import { computeContractAddressFromInstance, computeContractAddressFromPartial, @@ -27,7 +27,6 @@ describe('ContractAddress', () => { const mockInstance = { initializationHash: new Fr(1), salt: new Fr(2), - portalContractAddress: EthAddress.fromField(new Fr(3)), deployer: AztecAddress.fromField(new Fr(4)), }; const result = computeSaltedInitializationHash(mockInstance); @@ -58,7 +57,6 @@ describe('ContractAddress', () => { const salt = new Fr(3n); const contractClassId = new Fr(4n); const initializationHash = new Fr(5n); - const portalContractAddress = EthAddress.fromField(new Fr(6n)); const deployer = AztecAddress.fromField(new Fr(7)); const address = computeContractAddressFromInstance({ @@ -66,7 +64,6 @@ describe('ContractAddress', () => { salt, contractClassId, initializationHash, - portalContractAddress, deployer, version: 1, }).toString(); diff --git a/yarn-project/circuits.js/src/contract/contract_address.ts b/yarn-project/circuits.js/src/contract/contract_address.ts index 695ef983a543..971f2f29e06f 100644 --- a/yarn-project/circuits.js/src/contract/contract_address.ts +++ b/yarn-project/circuits.js/src/contract/contract_address.ts @@ -13,7 +13,7 @@ import { type PublicKey } from '../types/public_key.js'; /** * Returns the deployment address for a given contract instance as defined on the [Protocol Specs](../../../../docs/docs/protocol-specs/addresses-and-keys/specification.md). * ``` - * salted_initialization_hash = pedersen([salt, initialization_hash, deployer, portal_contract_address as Field], GENERATOR__SALTED_INITIALIZATION_HASH) + * salted_initialization_hash = pedersen([salt, initialization_hash, deployer], GENERATOR__SALTED_INITIALIZATION_HASH) * partial_address = pedersen([contract_class_id, salted_initialization_hash], GENERATOR__CONTRACT_PARTIAL_ADDRESS_V1) * address = pedersen([public_keys_hash, partial_address], GENERATOR__CONTRACT_ADDRESS_V1) * ``` @@ -35,7 +35,7 @@ export function computeContractAddressFromInstance( */ export function computePartialAddress( instance: - | Pick + | Pick | { contractClassId: Fr; saltedInitializationHash: Fr }, ): Fr { const saltedInitializationHash = @@ -47,16 +47,13 @@ export function computePartialAddress( } /** - * Computes the salted initialization hash for an address, defined as the hash of the salt, initialization hash, and portal address. + * Computes the salted initialization hash for an address, defined as the hash of the salt and initialization hash. * @param instance - Contract instance for which to compute the salted initialization hash. */ export function computeSaltedInitializationHash( - instance: Pick, + instance: Pick, ): Fr { - return pedersenHash( - [instance.salt, instance.initializationHash, instance.deployer, instance.portalContractAddress], - GeneratorIndex.PARTIAL_ADDRESS, - ); + return pedersenHash([instance.salt, instance.initializationHash, instance.deployer], GeneratorIndex.PARTIAL_ADDRESS); } /** diff --git a/yarn-project/circuits.js/src/contract/contract_instance.ts b/yarn-project/circuits.js/src/contract/contract_instance.ts index 853eff04949c..67f8e700d4f2 100644 --- a/yarn-project/circuits.js/src/contract/contract_instance.ts +++ b/yarn-project/circuits.js/src/contract/contract_instance.ts @@ -32,8 +32,6 @@ export function getContractInstanceFromDeployParams( const args = opts.constructorArgs ?? []; const salt = opts.salt ?? Fr.random(); const publicKey = opts.publicKey ?? Point.ZERO; - // @todo @LHerskind purge - const portalContractAddress = EthAddress.ZERO; const constructorArtifact = getConstructorArtifact(artifact, opts.constructorArtifact); const deployer = opts.deployer ?? AztecAddress.ZERO; @@ -45,7 +43,6 @@ export function getContractInstanceFromDeployParams( const instance: ContractInstance = { contractClassId, initializationHash, - portalContractAddress, publicKeysHash, salt, deployer, diff --git a/yarn-project/circuits.js/src/contract/events/contract_instance_deployed_event.ts b/yarn-project/circuits.js/src/contract/events/contract_instance_deployed_event.ts index 19de6205fc68..d2e4dd4b18fa 100644 --- a/yarn-project/circuits.js/src/contract/events/contract_instance_deployed_event.ts +++ b/yarn-project/circuits.js/src/contract/events/contract_instance_deployed_event.ts @@ -15,7 +15,6 @@ export class ContractInstanceDeployedEvent { public readonly salt: Fr, public readonly contractClassId: Fr, public readonly initializationHash: Fr, - public readonly portalContractAddress: EthAddress, public readonly publicKeysHash: Fr, public readonly deployer: AztecAddress, ) {} @@ -42,7 +41,6 @@ export class ContractInstanceDeployedEvent { const salt = reader.readObject(Fr); const contractClassId = reader.readObject(Fr); const initializationHash = reader.readObject(Fr); - const portalContractAddress = EthAddress.fromField(reader.readObject(Fr)); const publicKeysHash = reader.readObject(Fr); const deployer = reader.readObject(AztecAddress); @@ -52,7 +50,6 @@ export class ContractInstanceDeployedEvent { salt, contractClassId, initializationHash, - portalContractAddress, publicKeysHash, deployer, ); @@ -68,7 +65,6 @@ export class ContractInstanceDeployedEvent { version: this.version, contractClassId: this.contractClassId, initializationHash: this.initializationHash, - portalContractAddress: this.portalContractAddress, publicKeysHash: this.publicKeysHash, salt: this.salt, deployer: this.deployer, diff --git a/yarn-project/circuits.js/src/structs/__snapshots__/private_call_stack_item.test.ts.snap b/yarn-project/circuits.js/src/structs/__snapshots__/private_call_stack_item.test.ts.snap index 46d4e2bf80d5..0d8bdba89a2b 100644 --- a/yarn-project/circuits.js/src/structs/__snapshots__/private_call_stack_item.test.ts.snap +++ b/yarn-project/circuits.js/src/structs/__snapshots__/private_call_stack_item.test.ts.snap @@ -1,5 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`PrivateCallStackItem computes empty item hash 1`] = `Fr<0x24185d8e88fe796dec6e400f3d6c7572cefd85cea80591f268f08a9350992c48>`; +exports[`PrivateCallStackItem computes empty item hash 1`] = `Fr<0x2d6f5f49069d729642011bb55bd9e050a858bf4b91bda713b74f5c8396396547>`; -exports[`PrivateCallStackItem computes hash 1`] = `Fr<0x2e5307580ef277146cc3c6a9d9210c6e317d9b6a033755f509e6161d0eaf576a>`; +exports[`PrivateCallStackItem computes hash 1`] = `Fr<0x22e0e53ad59d07c9f671820a5dba7c15bed99a64dfa4d98bb400ef8bf3f82da2>`; diff --git a/yarn-project/circuits.js/src/structs/__snapshots__/private_circuit_public_inputs.test.ts.snap b/yarn-project/circuits.js/src/structs/__snapshots__/private_circuit_public_inputs.test.ts.snap index 4e423c22442c..43bebd4c6af5 100644 --- a/yarn-project/circuits.js/src/structs/__snapshots__/private_circuit_public_inputs.test.ts.snap +++ b/yarn-project/circuits.js/src/structs/__snapshots__/private_circuit_public_inputs.test.ts.snap @@ -1,5 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`PrivateCircuitPublicInputs computes empty inputs hash 1`] = `Fr<0x24ea9ab3fc039778bef8e7212f6a09feec1019db19b449333b523a08b812ee88>`; +exports[`PrivateCircuitPublicInputs computes empty inputs hash 1`] = `Fr<0x048912d56248af479f8d7ecedbba7092d27741b10075a989e040f8e3242a7a3f>`; -exports[`PrivateCircuitPublicInputs hash matches snapshot 1`] = `Fr<0x144c861f88d1ba68fc7e72f7a578546207bbf785e4a23278601662d85cd25d12>`; +exports[`PrivateCircuitPublicInputs hash matches snapshot 1`] = `Fr<0x1c090517b606c3439bdc91ad3a7b680a328b2b511c0142f5f424edc83b7a395d>`; diff --git a/yarn-project/circuits.js/src/structs/__snapshots__/public_call_stack_item.test.ts.snap b/yarn-project/circuits.js/src/structs/__snapshots__/public_call_stack_item.test.ts.snap index 230870d273c9..4673db84692e 100644 --- a/yarn-project/circuits.js/src/structs/__snapshots__/public_call_stack_item.test.ts.snap +++ b/yarn-project/circuits.js/src/structs/__snapshots__/public_call_stack_item.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`PublicCallStackItem Computes a callstack item hash 1`] = `"0x0c0d60d424315af5f106a802b250c27c613a9ec1c0f583c6ad806cf22fe66a13"`; +exports[`PublicCallStackItem Computes a callstack item hash 1`] = `"0x2d70bf7513d49591c2eed7e0753430f8bb279fa104ff90e21146e5cb673d0b28"`; -exports[`PublicCallStackItem Computes a callstack item request hash 1`] = `"0x134d01b778664dbc1ffa953008ce28f72b0cb258533776f10df59a59d791e972"`; +exports[`PublicCallStackItem Computes a callstack item request hash 1`] = `"0x29a826a3db50807ab493addc36d60d4cf15028e5585d06907fff731810cc5acf"`; -exports[`PublicCallStackItem computes hash 1`] = `Fr<0x2c7d4c31cdb4762c88686417968228c7d102e205e89cb157a34365eef5bfb15c>`; +exports[`PublicCallStackItem computes hash 1`] = `Fr<0x11ef2920204f44a21779a69fc42e4405238ce0e22f63305fda91616d71b8a01d>`; diff --git a/yarn-project/circuits.js/src/structs/__snapshots__/public_circuit_public_inputs.test.ts.snap b/yarn-project/circuits.js/src/structs/__snapshots__/public_circuit_public_inputs.test.ts.snap index 057d7b9aeac2..78af6e0ba913 100644 --- a/yarn-project/circuits.js/src/structs/__snapshots__/public_circuit_public_inputs.test.ts.snap +++ b/yarn-project/circuits.js/src/structs/__snapshots__/public_circuit_public_inputs.test.ts.snap @@ -1,5 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`PublicCircuitPublicInputs computes empty item hash 1`] = `Fr<0x1092820bc987359300ff136abf020d58218e1b3484e03d756c76e81ac56ccbf7>`; +exports[`PublicCircuitPublicInputs computes empty item hash 1`] = `Fr<0x02e09d8c4897d560bd4caf05ab45fa22e1d4a251bf5b5e0448310a7f40f7a0b8>`; -exports[`PublicCircuitPublicInputs hash matches snapshot 1`] = `Fr<0x251dcf0ab2afb050857487a1545e99cc12ddd7655154f89b8aab1d7872845173>`; +exports[`PublicCircuitPublicInputs hash matches snapshot 1`] = `Fr<0x1bda15ae1ec139e92a3036ace0a09ca4f16a302a88d87d4c23cc9a83577610ed>`; diff --git a/yarn-project/circuits.js/src/structs/call_context.ts b/yarn-project/circuits.js/src/structs/call_context.ts index b63c0667115d..c6f79ab01d2d 100644 --- a/yarn-project/circuits.js/src/structs/call_context.ts +++ b/yarn-project/circuits.js/src/structs/call_context.ts @@ -1,6 +1,5 @@ import { FunctionSelector } from '@aztec/foundation/abi'; import { AztecAddress } from '@aztec/foundation/aztec-address'; -import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize'; import { type FieldsOf } from '@aztec/foundation/types'; @@ -9,8 +8,6 @@ import { CALL_CONTEXT_LENGTH } from '../constants.gen.js'; import { Gas } from './gas.js'; import { GasSettings } from './gas_settings.js'; -// @todo @lherskind Purge the portalContractAddress in here - /** * Call context. */ @@ -26,10 +23,6 @@ export class CallContext { * modified. */ public storageContractAddress: AztecAddress, - /** - * Address of the portal contract to the storage contract. - */ - public portalContractAddress: EthAddress, /** * Function selector of the function being called. */ @@ -57,14 +50,13 @@ export class CallContext { ) {} /** - * Returns a new instance of CallContext with zero msg sender, storage contract address and portal contract address. - * @returns A new instance of CallContext with zero msg sender, storage contract address and portal contract address. + * Returns a new instance of CallContext with zero msg sender, storage contract address. + * @returns A new instance of CallContext with zero msg sender, storage contract address. */ public static empty(): CallContext { return new CallContext( AztecAddress.ZERO, AztecAddress.ZERO, - EthAddress.ZERO, FunctionSelector.empty(), Gas.empty(), false, @@ -79,7 +71,6 @@ export class CallContext { return ( this.msgSender.isZero() && this.storageContractAddress.isZero() && - this.portalContractAddress.isZero() && this.functionSelector.isEmpty() && this.gasLeft.isEmpty() && Fr.ZERO && @@ -96,7 +87,6 @@ export class CallContext { return [ fields.msgSender, fields.storageContractAddress, - fields.portalContractAddress, fields.functionSelector, fields.gasLeft, fields.isDelegateCall, @@ -135,7 +125,6 @@ export class CallContext { return new CallContext( reader.readObject(AztecAddress), reader.readObject(AztecAddress), - reader.readObject(EthAddress), reader.readObject(FunctionSelector), reader.readObject(Gas), reader.readBoolean(), @@ -151,7 +140,6 @@ export class CallContext { return new CallContext( reader.readObject(AztecAddress), reader.readObject(AztecAddress), - reader.readObject(EthAddress), reader.readObject(FunctionSelector), reader.readObject(Gas), reader.readBoolean(), @@ -166,7 +154,6 @@ export class CallContext { return ( callContext.msgSender.equals(this.msgSender) && callContext.storageContractAddress.equals(this.storageContractAddress) && - callContext.portalContractAddress.equals(this.portalContractAddress) && callContext.functionSelector.equals(this.functionSelector) && callContext.gasLeft.equals(this.gasLeft) && callContext.isDelegateCall === this.isDelegateCall && diff --git a/yarn-project/circuits.js/src/structs/kernel/private_call_data.ts b/yarn-project/circuits.js/src/structs/kernel/private_call_data.ts index 7026461a9976..475b927725ce 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_call_data.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_call_data.ts @@ -67,10 +67,6 @@ export class PrivateCallData { NoteHashReadRequestMembershipWitness, typeof MAX_NOTE_HASH_READ_REQUESTS_PER_CALL >, - /** - * The address of the portal contract corresponding to the contract on which the function is being invoked. - */ - public portalContractAddress: Fr, /** * The hash of the ACIR of the function being invoked. */ @@ -95,7 +91,6 @@ export class PrivateCallData { fields.saltedInitializationHash, fields.functionLeafMembershipWitness, fields.noteHashReadRequestMembershipWitnesses, - fields.portalContractAddress, fields.acirHash, ] as const; } @@ -132,7 +127,6 @@ export class PrivateCallData { reader.readObject(MembershipWitness.deserializer(FUNCTION_TREE_HEIGHT)), reader.readArray(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, NoteHashReadRequestMembershipWitness), reader.readObject(Fr), - reader.readObject(Fr), ); } } diff --git a/yarn-project/circuits.js/src/structs/kernel/public_call_data.ts b/yarn-project/circuits.js/src/structs/kernel/public_call_data.ts index 249bd3fa1a88..3afdf41d3c7c 100644 --- a/yarn-project/circuits.js/src/structs/kernel/public_call_data.ts +++ b/yarn-project/circuits.js/src/structs/kernel/public_call_data.ts @@ -23,10 +23,6 @@ export class PublicCallData { * Proof of the call stack item execution. */ public readonly proof: Proof, - /** - * Address of the corresponding portal contract. - */ - public readonly portalContractAddress: Fr, /** * Hash of the L2 contract bytecode. */ @@ -34,13 +30,7 @@ export class PublicCallData { ) {} toBuffer() { - return serializeToBuffer( - this.callStackItem, - this.publicCallStack, - this.proof, - this.portalContractAddress, - this.bytecodeHash, - ); + return serializeToBuffer(this.callStackItem, this.publicCallStack, this.proof, this.bytecodeHash); } static fromBuffer(buffer: BufferReader | Buffer) { @@ -53,7 +43,6 @@ export class PublicCallData { ), reader.readObject(Proof), reader.readObject(Fr), - reader.readObject(Fr), ); } } diff --git a/yarn-project/circuits.js/src/tests/factories.ts b/yarn-project/circuits.js/src/tests/factories.ts index d6d99d49a5a0..d42c2824dd99 100644 --- a/yarn-project/circuits.js/src/tests/factories.ts +++ b/yarn-project/circuits.js/src/tests/factories.ts @@ -410,7 +410,6 @@ export function makeCallContext(seed = 0, overrides: Partial', - 'Optional L1 portal address to link the contract to.', - parseEthereumAddress, - ) .option( '-s, --salt ', 'Optional deployment salt as a hex string for generating the deployment address.', @@ -179,29 +174,23 @@ export function getProgram(log: LogFn, debugLogger: DebugLogger): Command { // `options.wait` is default true. Passing `--no-wait` will set it to false. // https://github.com/tj/commander.js#other-option-types-negatable-boolean-and-booleanvalue .option('--no-wait', 'Skip waiting for the contract to be deployed. Print the hash of deployment transaction') - .action( - async ( + .action(async (artifactPath, { json, rpcUrl, publicKey, args: rawArgs, salt, wait, privateKey, initializer }) => { + const { deploy } = await import('./cmds/deploy.js'); + await deploy( artifactPath, - { json, rpcUrl, publicKey, args: rawArgs, portalAddress, salt, wait, privateKey, initializer }, - ) => { - const { deploy } = await import('./cmds/deploy.js'); - await deploy( - artifactPath, - json, - rpcUrl, - publicKey, - rawArgs, - portalAddress, - salt, - privateKey, - initializer, - wait, - debugLogger, - log, - logJson, - ); - }, - ); + json, + rpcUrl, + publicKey, + rawArgs, + salt, + privateKey, + initializer, + wait, + debugLogger, + log, + logJson, + ); + }); program .command('check-deploy') @@ -230,7 +219,6 @@ export function getProgram(log: LogFn, debugLogger: DebugLogger): Command { .requiredOption('--init-hash ', 'Initialization hash', parseFieldFromHexString) .option('--salt ', 'Optional deployment salt', parseFieldFromHexString) .option('-p, --public-key ', 'Optional public key for this contract', parsePublicKey) - .option('--portal-address
', 'Optional address to a portal contract on L1', parseEthereumAddress) .option('--deployer-address
', 'Optional address of the contract deployer', parseAztecAddress) .addOption(pxeOption) .action(async options => { @@ -242,7 +230,6 @@ export function getProgram(log: LogFn, debugLogger: DebugLogger): Command { options.initHash, options.salt ?? Fr.ZERO, options.publicKey, - options.portalContract, options.deployerAddress, debugLogger, log, diff --git a/yarn-project/end-to-end/src/e2e_blacklist_token_contract.test.ts b/yarn-project/end-to-end/src/e2e_blacklist_token_contract.test.ts index 592240844530..023fafb8cd12 100644 --- a/yarn-project/end-to-end/src/e2e_blacklist_token_contract.test.ts +++ b/yarn-project/end-to-end/src/e2e_blacklist_token_contract.test.ts @@ -401,7 +401,6 @@ describe('e2e_blacklist_token_contract', () => { }); it('mint u128', async () => { - // @todo @LHerskind this one don't make sense. It fails because of total supply overflowing. const amount = 2n ** 128n - tokenSim.balanceOfPrivate(wallets[0].getAddress()); expect(amount).toBeLessThan(2n ** 128n); await expect(asset.methods.mint_private(amount, secretHash).prove()).rejects.toThrow(U128_OVERFLOW_ERROR); diff --git a/yarn-project/end-to-end/src/flakey_e2e_deploy_contract/contract_class_registration.test.ts b/yarn-project/end-to-end/src/flakey_e2e_deploy_contract/contract_class_registration.test.ts index e1ad4e07dab0..ac5c67d947d0 100644 --- a/yarn-project/end-to-end/src/flakey_e2e_deploy_contract/contract_class_registration.test.ts +++ b/yarn-project/end-to-end/src/flakey_e2e_deploy_contract/contract_class_registration.test.ts @@ -140,7 +140,6 @@ describe('e2e_deploy_contract contract class registration', () => { expect(deployed!.address).toEqual(instance.address); expect(deployed!.contractClassId).toEqual(contractClass.id); expect(deployed!.initializationHash).toEqual(instance.initializationHash); - expect(deployed!.portalContractAddress).toEqual(instance.portalContractAddress); expect(deployed!.publicKeysHash).toEqual(instance.publicKeysHash); expect(deployed!.salt).toEqual(instance.salt); expect(deployed!.deployer).toEqual(instance.deployer); diff --git a/yarn-project/end-to-end/src/flakey_e2e_deploy_contract/legacy.test.ts b/yarn-project/end-to-end/src/flakey_e2e_deploy_contract/legacy.test.ts index b46128b7995f..d920d5913384 100644 --- a/yarn-project/end-to-end/src/flakey_e2e_deploy_contract/legacy.test.ts +++ b/yarn-project/end-to-end/src/flakey_e2e_deploy_contract/legacy.test.ts @@ -85,18 +85,6 @@ describe('e2e_deploy_contract legacy', () => { await expect(deployer.deploy().send({ contractAddressSalt }).wait()).rejects.toThrow(/dropped/); }, 60_000); - it('should deploy a contract connected to a portal contract', async () => { - const deployer = new ContractDeployer(TestContractArtifact, wallet); - const portalContract = EthAddress.random(); - - // ContractDeployer was instantiated with wallet so we don't have to pass it to wait(...) - const receipt = await deployer.deploy().send().wait(); - const address = receipt.contract.address; - - const expectedPortal = portalContract.toString(); - expect((await pxe.getContractInstance(address))?.portalContractAddress.toString()).toEqual(expectedPortal); - }, 60_000); - it('should not deploy a contract which failed the public part of the execution', async () => { // This test requires at least another good transaction to go through in the same block as the bad one. const artifact = TokenContractArtifact; diff --git a/yarn-project/noir-protocol-circuits-types/src/__snapshots__/noir_test_gen.test.ts.snap b/yarn-project/noir-protocol-circuits-types/src/__snapshots__/noir_test_gen.test.ts.snap index cd7b3714098d..76cb749adc98 100644 --- a/yarn-project/noir-protocol-circuits-types/src/__snapshots__/noir_test_gen.test.ts.snap +++ b/yarn-project/noir-protocol-circuits-types/src/__snapshots__/noir_test_gen.test.ts.snap @@ -4366,12 +4366,11 @@ exports[`Data generation for noir tests Computes contract info for defaultContra artifact_hash: 0x0000000000000000000000000000000000000000000000000000000000003039, public_bytecode_commitment: 0x129a3438653fe147133b2c274757920e37896305e7664c8c1eb380be3efd5fed, private_functions_root: 0x19a3cc0b714976fb35d58b684ba36e86f82bac8b87517904a2727e5113fb4cba, - address: AztecAddress { inner: 0x17f7ff235e2548b437b7ef33cdf96c99346753b27d22787c1aa5287cdbad39ee }, - partial_address: PartialAddress { inner: 0x23a6933a485200a8d34b9929d61868c9635793f878d67ce86a1b1355c0ab0d47 }, - portal_contract_address: EthAddress { inner: 0x0000000000000000000000000000000000005ba0 }, + address: AztecAddress { inner: 0x016d0a88aab5771406776bd76d91bdbb53b6b5f08d462fbe1c253b9b80ed9a49 }, + partial_address: PartialAddress { inner: 0x30248868d815221789c5f173462ee99637ac9748000d31c5f311dbc3d996eb71 }, contract_class_id: ContractClassId { inner: 0x0ce2a998337b1e6da1ac1d802a8bb9e10b7d705d210e61efb9642855009814a6 }, public_keys_hash: PublicKeysHash { inner: 0x000000000000000000000000000000000000000000000000000000000000b26e }, - salted_initialization_hash: SaltedInitializationHash { inner: 0x0b095458845137ebf1e6061c8c0ba1d907241a3b56dc1d3e73d2fea78f04a036 }, + salted_initialization_hash: SaltedInitializationHash { inner: 0x25765504545d2cdaaa6544eb24bc78a3e20384452f2525669f196a1a42f45906 }, deployer: AztecAddress { inner: 0x0000000000000000000000000000000000000000000000000000000000000000 } }" `; @@ -4382,12 +4381,11 @@ exports[`Data generation for noir tests Computes contract info for parentContrac artifact_hash: 0x00000000000000000000000000000000000000000000000000000000000004bc, public_bytecode_commitment: 0x1435ed970b275bebf95de3df53f23f3d2e97c9b54cf442bb03a3fa17a0ee3cd7, private_functions_root: 0x2c1c949cb226995de94b7b8b5aeaab440739f2dfeb06d358441f60932cf243a7, - address: AztecAddress { inner: 0x1a20abed0eeb77fbcf0dd6ba6e9d9fd18b649277b9aea88014e1e9e39646b1b3 }, - partial_address: PartialAddress { inner: 0x127bbd73a3cf497fb2d85342571695d894985b449a9343eec55485e9cbc514f8 }, - portal_contract_address: EthAddress { inner: 0x0000000000000000000000000000000000000913 }, + address: AztecAddress { inner: 0x20d7d91c4a7ccea4fdf3cfcdf23e08d392d6fa6e2ef450e7b904307b814bc83b }, + partial_address: PartialAddress { inner: 0x20ac96f5da24137797077661d4222c8caf97d2d3fdeadbf4cad8f529a96eb610 }, contract_class_id: ContractClassId { inner: 0x1f1f963a350e2c883cc6730c19fc5d5b47a40694d805cbb0720fa76fe295df90 }, public_keys_hash: PublicKeysHash { inner: 0x00000000000000000000000000000000000000000000000000000000000011c1 }, - salted_initialization_hash: SaltedInitializationHash { inner: 0x04643e65513869350552499ed3412df59540dffe3cd698203deee8900b53bcec }, + salted_initialization_hash: SaltedInitializationHash { inner: 0x0b1d457cdacb66e76eccb29a4e34dff5ae10b9d3d2f0d85b59aa8cf68bd1cf86 }, deployer: AztecAddress { inner: 0x0000000000000000000000000000000000000000000000000000000000000000 } }" `; diff --git a/yarn-project/noir-protocol-circuits-types/src/noir_test_gen.test.ts b/yarn-project/noir-protocol-circuits-types/src/noir_test_gen.test.ts index 6453b0313e0e..39fa16abc551 100644 --- a/yarn-project/noir-protocol-circuits-types/src/noir_test_gen.test.ts +++ b/yarn-project/noir-protocol-circuits-types/src/noir_test_gen.test.ts @@ -22,12 +22,11 @@ describe('Data generation for noir tests', () => { setupCustomSnapshotSerializers(expect); type FixtureContractData = Omit & - Pick & + Pick & Pick & { toString: () => string }; const defaultContract: FixtureContractData = { artifactHash: new Fr(12345), - portalContractAddress: EthAddress.fromField(new Fr(23456)), packedBytecode: Buffer.from([3, 4, 5, 6, 7]), publicKeysHash: new Fr(45678), salt: new Fr(56789), @@ -40,7 +39,6 @@ describe('Data generation for noir tests', () => { const parentContract: FixtureContractData = { artifactHash: new Fr(1212), - portalContractAddress: EthAddress.fromField(new Fr(2323)), packedBytecode: Buffer.from([3, 4, 3, 4]), publicKeysHash: new Fr(4545), salt: new Fr(5656), @@ -75,7 +73,6 @@ describe('Data generation for noir tests', () => { private_functions_root: privateFunctionsRoot.toString(), address: `AztecAddress { inner: ${address.toString()} }`, partial_address: `PartialAddress { inner: ${partialAddress.toString()} }`, - portal_contract_address: `EthAddress { inner: ${contract.portalContractAddress.toString()} }`, contract_class_id: `ContractClassId { inner: ${contractClassId.toString()} }`, public_keys_hash: `PublicKeysHash { inner: ${contract.publicKeysHash.toString()} }`, salted_initialization_hash: `SaltedInitializationHash { inner: ${saltedInitializationHash.toString()} }`, diff --git a/yarn-project/noir-protocol-circuits-types/src/type_conversion.ts b/yarn-project/noir-protocol-circuits-types/src/type_conversion.ts index d69b24594e0d..a20cd0ba705b 100644 --- a/yarn-project/noir-protocol-circuits-types/src/type_conversion.ts +++ b/yarn-project/noir-protocol-circuits-types/src/type_conversion.ts @@ -431,7 +431,6 @@ export function mapCallContextFromNoir(callContext: CallContextNoir): CallContex return new CallContext( mapAztecAddressFromNoir(callContext.msg_sender), mapAztecAddressFromNoir(callContext.storage_contract_address), - mapEthAddressFromNoir(callContext.portal_contract_address), mapFunctionSelectorFromNoir(callContext.function_selector), mapGasFromNoir(callContext.gas_left), callContext.is_delegate_call, @@ -451,7 +450,6 @@ export function mapCallContextToNoir(callContext: CallContext): CallContextNoir return { msg_sender: mapAztecAddressToNoir(callContext.msgSender), storage_contract_address: mapAztecAddressToNoir(callContext.storageContractAddress), - portal_contract_address: mapEthAddressToNoir(callContext.portalContractAddress), function_selector: mapFunctionSelectorToNoir(callContext.functionSelector), gas_left: mapGasToNoir(callContext.gasLeft), is_delegate_call: callContext.isDelegateCall, @@ -821,8 +819,6 @@ export function mapPrivateCallDataToNoir(privateCallData: PrivateCallData): Priv contract_class_public_bytecode_commitment: mapFieldToNoir(privateCallData.contractClassPublicBytecodeCommitment), public_keys_hash: mapWrappedFieldToNoir(privateCallData.publicKeysHash), salted_initialization_hash: mapWrappedFieldToNoir(privateCallData.saltedInitializationHash), - //TODO this seems like the wrong type in circuits.js - portal_contract_address: mapEthAddressToNoir(EthAddress.fromField(privateCallData.portalContractAddress)), acir_hash: mapFieldToNoir(privateCallData.acirHash), }; } @@ -1648,7 +1644,6 @@ export function mapPublicCallDataToNoir(publicCall: PublicCallData): PublicCallD call_stack_item: mapPublicCallStackItemToNoir(publicCall.callStackItem), public_call_stack: mapTuple(publicCall.publicCallStack, mapCallRequestToNoir), proof: {}, - portal_contract_address: mapEthAddressToNoir(EthAddress.fromField(publicCall.portalContractAddress)), bytecode_hash: mapFieldToNoir(publicCall.bytecodeHash), }; } diff --git a/yarn-project/pxe/src/contract_data_oracle/index.ts b/yarn-project/pxe/src/contract_data_oracle/index.ts index eaf53cb9be6f..4dbf3ebcdec3 100644 --- a/yarn-project/pxe/src/contract_data_oracle/index.ts +++ b/yarn-project/pxe/src/contract_data_oracle/index.ts @@ -52,20 +52,6 @@ export class ContractDataOracle { return tree.getArtifact(); } - /** - * Retrieve the portal contract address associated with the given contract address. - * This function searches for the corresponding contract tree in the local cache and returns the portal contract address. - * If the contract tree is not found in the cache, it fetches the contract data from the database and creates a new ContractTree instance. - * Throws an error if the contract address is not found in the database. - * - * @param contractAddress - The AztecAddress of the contract whose portal contract address needs to be retrieved. - * @returns A Promise that resolves to the portal contract address. - */ - public async getPortalContractAddress(contractAddress: AztecAddress) { - const instance = await this.getContractInstance(contractAddress); - return instance.portalContractAddress; - } - /** * Retrieves the artifact of a specified function within a given contract. * The function is identified by its selector, which is a unique code generated from the function's signature. diff --git a/yarn-project/pxe/src/kernel_prover/kernel_prover.ts b/yarn-project/pxe/src/kernel_prover/kernel_prover.ts index 1632ebc31643..c2292f638bc5 100644 --- a/yarn-project/pxe/src/kernel_prover/kernel_prover.ts +++ b/yarn-project/pxe/src/kernel_prover/kernel_prover.ts @@ -208,7 +208,6 @@ export class KernelProver { noteHashReadRequestMembershipWitnesses: NoteHashReadRequestMembershipWitness[], ) { const { contractAddress, functionData, publicInputs } = callStackItem; - const { portalContractAddress } = publicInputs.callContext; // Pad with empty items to reach max/const length expected by circuit. const privateCallStack = padArrayEnd( @@ -251,7 +250,6 @@ export class KernelProver { i => noteHashReadRequestMembershipWitnesses[i], 0, ), - portalContractAddress: portalContractAddress.toField(), acirHash, }); } diff --git a/yarn-project/pxe/src/pxe_service/pxe_service.ts b/yarn-project/pxe/src/pxe_service/pxe_service.ts index 8d0e08d76f96..f98e08209223 100644 --- a/yarn-project/pxe/src/pxe_service/pxe_service.ts +++ b/yarn-project/pxe/src/pxe_service/pxe_service.ts @@ -518,10 +518,10 @@ export class PXEService implements PXE { /** * Retrieves the simulation parameters required to run an ACIR simulation. - * This includes the contract address, function artifact, portal contract address, and historical tree roots. + * This includes the contract address, function artifact, and historical tree roots. * * @param execRequest - The transaction request object containing details of the contract call. - * @returns An object containing the contract address, function artifact, portal contract address, and historical tree roots. + * @returns An object containing the contract address, function artifact, and historical tree roots. */ async #getSimulationParameters(execRequest: FunctionCall | TxExecutionRequest) { const contractAddress = (execRequest as FunctionCall).to ?? (execRequest as TxExecutionRequest).origin; @@ -533,16 +533,13 @@ export class PXEService implements PXE { contractAddress, execRequest.functionData.selector, ); - // @todo @LHerskind purge - const portalContract = await this.contractDataOracle.getPortalContractAddress(contractAddress); return { contractAddress, functionArtifact: { ...functionArtifact, debug, - }, - portalContract, + } }; } diff --git a/yarn-project/pxe/src/simulator_oracle/index.ts b/yarn-project/pxe/src/simulator_oracle/index.ts index d5ba6c1a032d..918f90079329 100644 --- a/yarn-project/pxe/src/simulator_oracle/index.ts +++ b/yarn-project/pxe/src/simulator_oracle/index.ts @@ -118,10 +118,6 @@ export class SimulatorOracle implements DBOracle { return artifact && getFunctionArtifactWithDebugMetadata(artifact, functionName); } - async getPortalContractAddress(contractAddress: AztecAddress): Promise { - return await this.contractDataOracle.getPortalContractAddress(contractAddress); - } - /** * Fetches a message from the db, given its key. * @param contractAddress - Address of a contract by which the message was emitted. diff --git a/yarn-project/simulator/src/acvm/oracle/oracle.ts b/yarn-project/simulator/src/acvm/oracle/oracle.ts index 2b967a7c98bd..2e79154c2348 100644 --- a/yarn-project/simulator/src/acvm/oracle/oracle.ts +++ b/yarn-project/simulator/src/acvm/oracle/oracle.ts @@ -67,7 +67,6 @@ export class Oracle { instance.deployer, instance.contractClassId, instance.initializationHash, - instance.portalContractAddress, instance.publicKeysHash, ].map(toACVMField); } diff --git a/yarn-project/simulator/src/avm/avm_execution_environment.ts b/yarn-project/simulator/src/avm/avm_execution_environment.ts index def966f15ed2..3d26ff7a1757 100644 --- a/yarn-project/simulator/src/avm/avm_execution_environment.ts +++ b/yarn-project/simulator/src/avm/avm_execution_environment.ts @@ -1,7 +1,6 @@ import { FunctionSelector, type GasSettings, type GlobalVariables, type Header } from '@aztec/circuits.js'; import { computeVarArgsHash } from '@aztec/circuits.js/hash'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; -import { type EthAddress } from '@aztec/foundation/eth-address'; import { type Fr } from '@aztec/foundation/fields'; export class AvmContextInputs { @@ -24,7 +23,6 @@ export class AvmExecutionEnvironment { public readonly address: AztecAddress, public readonly storageAddress: AztecAddress, public readonly sender: AztecAddress, - public readonly portal: EthAddress, public readonly feePerL1Gas: Fr, public readonly feePerL2Gas: Fr, public readonly feePerDaGas: Fr, @@ -57,7 +55,6 @@ export class AvmExecutionEnvironment { targetAddress, /*storageAddress=*/ targetAddress, this.address, - this.portal, this.feePerL1Gas, this.feePerL2Gas, this.feePerDaGas, @@ -82,7 +79,6 @@ export class AvmExecutionEnvironment { address, /*storageAddress=*/ address, this.sender, - this.portal, this.feePerL1Gas, this.feePerL2Gas, this.feePerDaGas, @@ -107,7 +103,6 @@ export class AvmExecutionEnvironment { address, this.storageAddress, this.sender, - this.portal, this.feePerL1Gas, this.feePerL2Gas, this.feePerDaGas, diff --git a/yarn-project/simulator/src/avm/avm_gas.ts b/yarn-project/simulator/src/avm/avm_gas.ts index 77ee61739966..5d7bae105141 100644 --- a/yarn-project/simulator/src/avm/avm_gas.ts +++ b/yarn-project/simulator/src/avm/avm_gas.ts @@ -79,7 +79,6 @@ export const GasCosts: Record = { [Opcode.ADDRESS]: TemporaryDefaultGasCost, [Opcode.STORAGEADDRESS]: TemporaryDefaultGasCost, [Opcode.SENDER]: TemporaryDefaultGasCost, - [Opcode.PORTAL]: TemporaryDefaultGasCost, [Opcode.FEEPERL1GAS]: TemporaryDefaultGasCost, [Opcode.FEEPERL2GAS]: TemporaryDefaultGasCost, [Opcode.FEEPERDAGAS]: TemporaryDefaultGasCost, diff --git a/yarn-project/simulator/src/avm/avm_simulator.test.ts b/yarn-project/simulator/src/avm/avm_simulator.test.ts index 1bfdb707250d..3a5ee2743319 100644 --- a/yarn-project/simulator/src/avm/avm_simulator.test.ts +++ b/yarn-project/simulator/src/avm/avm_simulator.test.ts @@ -767,7 +767,6 @@ describe('AVM simulator: transpiled Noir contracts', () => { deployer: AztecAddress.fromBigInt(0x456n), contractClassId: new Fr(0x789), initializationHash: new Fr(0x101112), - portalContractAddress: EthAddress.fromField(new Fr(0x131415)), publicKeysHash: new Fr(0x161718), }; diff --git a/yarn-project/simulator/src/avm/fixtures/index.ts b/yarn-project/simulator/src/avm/fixtures/index.ts index ef9233bb686f..2800a605bb32 100644 --- a/yarn-project/simulator/src/avm/fixtures/index.ts +++ b/yarn-project/simulator/src/avm/fixtures/index.ts @@ -56,7 +56,6 @@ export function initExecutionEnvironment(overrides?: Partial { salt: new Fr(20), contractClassId: new Fr(30), initializationHash: new Fr(40), - portalContractAddress: EthAddress.random(), publicKeysHash: new Fr(50), deployer: AztecAddress.random(), }; @@ -56,14 +55,13 @@ describe('Contract opcodes', () => { await new GetContractInstance(/*indirect=*/ 0, /*addressOffset=*/ 0, /*dstOffset=*/ 1).execute(context); - const actual = context.machineState.memory.getSlice(1, 7); + const actual = context.machineState.memory.getSlice(1, 6); expect(actual).toEqual([ new Field(1), // found new Field(contractInstance.salt), new Field(contractInstance.deployer), new Field(contractInstance.contractClassId), new Field(contractInstance.initializationHash), - new Field(contractInstance.portalContractAddress.toField()), new Field(contractInstance.publicKeysHash), ]); }); @@ -74,7 +72,7 @@ describe('Contract opcodes', () => { await new GetContractInstance(/*indirect=*/ 0, /*addressOffset=*/ 0, /*dstOffset=*/ 1).execute(context); - const actual = context.machineState.memory.getSlice(1, 7); + const actual = context.machineState.memory.getSlice(1, 6); expect(actual).toEqual([ new Field(0), // found new Field(0), @@ -82,7 +80,6 @@ describe('Contract opcodes', () => { new Field(0), new Field(0), new Field(0), - new Field(0), ]); }); }); diff --git a/yarn-project/simulator/src/avm/opcodes/contract.ts b/yarn-project/simulator/src/avm/opcodes/contract.ts index 5e24dcf0d508..a0b41705bfd9 100644 --- a/yarn-project/simulator/src/avm/opcodes/contract.ts +++ b/yarn-project/simulator/src/avm/opcodes/contract.ts @@ -39,7 +39,6 @@ export class GetContractInstance extends Instruction { new Field(0), new Field(0), new Field(0), - new Field(0), ] : [ new Fr(1), // found @@ -47,7 +46,6 @@ export class GetContractInstance extends Instruction { instance.deployer.toField(), instance.contractClassId, instance.initializationHash, - instance.portalContractAddress.toField(), instance.publicKeysHash, ].map(f => new Field(f)); diff --git a/yarn-project/simulator/src/avm/opcodes/environment_getters.test.ts b/yarn-project/simulator/src/avm/opcodes/environment_getters.test.ts index 96818cd7a71c..7eaff3e408d2 100644 --- a/yarn-project/simulator/src/avm/opcodes/environment_getters.test.ts +++ b/yarn-project/simulator/src/avm/opcodes/environment_getters.test.ts @@ -8,7 +8,6 @@ import { FeePerDAGas, FeePerL1Gas, FeePerL2Gas, - Portal, Sender, StorageAddress, Timestamp, @@ -16,7 +15,6 @@ import { } from './environment_getters.js'; type EnvInstruction = - | typeof Portal | typeof FeePerL1Gas | typeof FeePerL2Gas | typeof FeePerDAGas @@ -24,7 +22,6 @@ type EnvInstruction = | typeof StorageAddress | typeof Address; describe.each([ - [Portal, 'portal'], [FeePerL1Gas, 'feePerL1Gas'], [FeePerL2Gas, 'feePerL2Gas'], [FeePerDAGas, 'feePerDaGas'], diff --git a/yarn-project/simulator/src/avm/opcodes/environment_getters.ts b/yarn-project/simulator/src/avm/opcodes/environment_getters.ts index b105fd20d776..d9316c03ca82 100644 --- a/yarn-project/simulator/src/avm/opcodes/environment_getters.ts +++ b/yarn-project/simulator/src/avm/opcodes/environment_getters.ts @@ -68,15 +68,6 @@ export class FeePerDAGas extends EnvironmentGetterInstruction { } } -export class Portal extends EnvironmentGetterInstruction { - static type: string = 'PORTAL'; - static readonly opcode: Opcode = Opcode.PORTAL; - - protected getEnvironmentValue(env: AvmExecutionEnvironment) { - return env.portal.toField(); - } -} - export class ChainId extends EnvironmentGetterInstruction { static type: string = 'CHAINID'; static readonly opcode: Opcode = Opcode.CHAINID; diff --git a/yarn-project/simulator/src/avm/serialization/bytecode_serialization.ts b/yarn-project/simulator/src/avm/serialization/bytecode_serialization.ts index 6a95dac7fed4..d3245a24d5bd 100644 --- a/yarn-project/simulator/src/avm/serialization/bytecode_serialization.ts +++ b/yarn-project/simulator/src/avm/serialization/bytecode_serialization.ts @@ -33,7 +33,6 @@ import { NoteHashExists, NullifierExists, Or, - Portal, Return, Revert, SLoad, @@ -82,7 +81,6 @@ const INSTRUCTION_SET = () => [Address.opcode, Address], [StorageAddress.opcode, StorageAddress], [Sender.opcode, Sender], - [Portal.opcode, Portal], [FeePerL1Gas.opcode, FeePerL1Gas], [FeePerL2Gas.opcode, FeePerL2Gas], [FeePerDAGas.opcode, FeePerDAGas], diff --git a/yarn-project/simulator/src/avm/serialization/instruction_serialization.ts b/yarn-project/simulator/src/avm/serialization/instruction_serialization.ts index 6f5bb70eb41b..6dcc877194d1 100644 --- a/yarn-project/simulator/src/avm/serialization/instruction_serialization.ts +++ b/yarn-project/simulator/src/avm/serialization/instruction_serialization.ts @@ -27,7 +27,6 @@ export enum Opcode { ADDRESS, STORAGEADDRESS, SENDER, - PORTAL, FEEPERL1GAS, FEEPERL2GAS, FEEPERDAGAS, diff --git a/yarn-project/simulator/src/client/client_execution_context.ts b/yarn-project/simulator/src/client/client_execution_context.ts index 5d7d33375b47..c76b1699a4f2 100644 --- a/yarn-project/simulator/src/client/client_execution_context.ts +++ b/yarn-project/simulator/src/client/client_execution_context.ts @@ -12,6 +12,7 @@ import { } from '@aztec/circuit-types'; import { CallContext, + EthAddress, FunctionData, FunctionSelector, type Header, @@ -385,7 +386,7 @@ export class ClientExecutionContext extends ViewDataOracle { const derivedTxContext = new TxContext(false, false, this.txContext.chainId, this.txContext.version); - const derivedCallContext = await this.deriveCallContext( + const derivedCallContext = this.deriveCallContext( targetContractAddress, targetArtifact, sideEffectCounter, @@ -446,7 +447,7 @@ export class ClientExecutionContext extends ViewDataOracle { isStaticCall = isStaticCall || this.callContext.isStaticCall; const targetArtifact = await this.db.getFunctionArtifact(targetContractAddress, functionSelector); - const derivedCallContext = await this.deriveCallContext( + const derivedCallContext = this.deriveCallContext( targetContractAddress, targetArtifact, sideEffectCounter, @@ -484,18 +485,16 @@ export class ClientExecutionContext extends ViewDataOracle { * @param isStaticCall - Whether the call is a static call. * @returns The derived call context. */ - private async deriveCallContext( + private deriveCallContext( targetContractAddress: AztecAddress, targetArtifact: FunctionArtifact, startSideEffectCounter: number, isDelegateCall = false, isStaticCall = false, ) { - const portalContractAddress = await this.db.getPortalContractAddress(targetContractAddress); return new CallContext( isDelegateCall ? this.callContext.msgSender : this.contractAddress, isDelegateCall ? this.contractAddress : targetContractAddress, - portalContractAddress, FunctionSelector.fromNameAndParameters(targetArtifact.name, targetArtifact.parameters), this.callContext.gasLeft, // TODO(palla/gas): We should deduct DA and L1 gas used for the derived context isDelegateCall, diff --git a/yarn-project/simulator/src/client/db_oracle.ts b/yarn-project/simulator/src/client/db_oracle.ts index 4338f4c3a9b8..61e3e6dbd27c 100644 --- a/yarn-project/simulator/src/client/db_oracle.ts +++ b/yarn-project/simulator/src/client/db_oracle.ts @@ -115,15 +115,6 @@ export interface DBOracle extends CommitmentsDB { functionName: string, ): Promise; - /** - * Retrieves the portal contract address associated with the given contract address. - * Throws an error if the input contract address is not found or invalid. - * - * @param contractAddress - The address of the contract whose portal address is to be fetched. - * @returns A Promise that resolves to an EthAddress instance, representing the portal contract address. - */ - getPortalContractAddress(contractAddress: AztecAddress): Promise; - /** * Gets the index of a nullifier in the nullifier tree. * @param nullifier - The nullifier. diff --git a/yarn-project/simulator/src/client/private_execution.test.ts b/yarn-project/simulator/src/client/private_execution.test.ts index 288af6d5f452..27fd1903fead 100644 --- a/yarn-project/simulator/src/client/private_execution.test.ts +++ b/yarn-project/simulator/src/client/private_execution.test.ts @@ -277,8 +277,6 @@ describe('Private Execution test suite', () => { oracle.getFunctionArtifact.mockImplementation((_, selector: FunctionSelector) => Promise.resolve(getFunctionArtifact(StatefulTestContractArtifact, selector)), ); - - oracle.getPortalContractAddress.mockResolvedValue(EthAddress.ZERO); }); it('should have a constructor with arguments that inserts notes', async () => { @@ -442,7 +440,6 @@ describe('Private Execution test suite', () => { const childSelector = FunctionSelector.fromNameAndParameters(childArtifact.name, childArtifact.parameters); oracle.getFunctionArtifact.mockImplementation(() => Promise.resolve(childArtifact)); - oracle.getPortalContractAddress.mockImplementation(() => Promise.resolve(EthAddress.ZERO)); logger.info(`Parent deployed at ${parentAddress.toShortString()}`); logger.info(`Calling child function ${childSelector.toString()} at ${childAddress.toShortString()}`); @@ -453,7 +450,6 @@ describe('Private Execution test suite', () => { expect(result.returnValues).toEqual([new Fr(privateIncrement)]); expect(oracle.getFunctionArtifact.mock.calls[0]).toEqual([childAddress, childSelector]); - expect(oracle.getPortalContractAddress.mock.calls[0]).toEqual([childAddress]); expect(result.nestedExecutions).toHaveLength(1); expect(result.nestedExecutions[0].returnValues).toEqual([new Fr(privateIncrement)]); @@ -496,7 +492,6 @@ describe('Private Execution test suite', () => { ); oracle.getFunctionArtifact.mockResolvedValue(testCodeGenArtifact); - oracle.getPortalContractAddress.mockResolvedValue(EthAddress.ZERO); logger.info(`Calling importer main function`); const args = [testAddress]; @@ -504,7 +499,6 @@ describe('Private Execution test suite', () => { expect(result.returnValues).toEqual([argsHash]); expect(oracle.getFunctionArtifact.mock.calls[0]).toEqual([testAddress, testCodeGenSelector]); - expect(oracle.getPortalContractAddress.mock.calls[0]).toEqual([testAddress]); expect(result.nestedExecutions).toHaveLength(1); expect(result.nestedExecutions[0].returnValues).toEqual([argsHash]); }); @@ -770,14 +764,12 @@ describe('Private Execution test suite', () => { const childContractArtifact = ChildContractArtifact.functions.find(fn => fn.name === 'pub_set_value')!; expect(childContractArtifact).toBeDefined(); const childAddress = AztecAddress.random(); - const childPortalContractAddress = EthAddress.random(); const childSelector = FunctionSelector.fromNameAndParameters( childContractArtifact.name, childContractArtifact.parameters, ); const parentAddress = AztecAddress.random(); - oracle.getPortalContractAddress.mockImplementation(() => Promise.resolve(childPortalContractAddress)); oracle.getFunctionArtifact.mockImplementation(() => Promise.resolve({ ...childContractArtifact, isInternal })); const args = [childAddress, childSelector, 42n]; @@ -802,7 +794,6 @@ describe('Private Execution test suite', () => { callContext: CallContext.from({ msgSender: parentAddress, storageContractAddress: childAddress, - portalContractAddress: childPortalContractAddress, functionSelector: childSelector, gasLeft, isDelegateCall: false, @@ -814,7 +805,6 @@ describe('Private Execution test suite', () => { parentCallContext: CallContext.from({ msgSender: parentAddress, storageContractAddress: parentAddress, - portalContractAddress: EthAddress.ZERO, functionSelector: FunctionSelector.fromNameAndParameters(parentArtifact.name, parentArtifact.parameters), gasLeft, isDelegateCall: false, @@ -929,8 +919,6 @@ describe('Private Execution test suite', () => { getThenNullifyArtifact.parameters, ); - oracle.getPortalContractAddress.mockImplementation(() => Promise.resolve(EthAddress.ZERO)); - const args = [amountToTransfer, owner, insertFnSelector.toField(), getThenNullifyFnSelector.toField()]; const result = await runSimulator({ args: args, diff --git a/yarn-project/simulator/src/client/simulator.ts b/yarn-project/simulator/src/client/simulator.ts index 6dc74a84091c..109852ec10f5 100644 --- a/yarn-project/simulator/src/client/simulator.ts +++ b/yarn-project/simulator/src/client/simulator.ts @@ -61,7 +61,6 @@ export class AcirSimulator { * @param request - The transaction request. * @param entryPointArtifact - The artifact of the entry point function. * @param contractAddress - The address of the contract (should match request.origin) - * @param portalContractAddress - The address of the portal contract. * @param msgSender - The address calling the function. This can be replaced to simulate a call from another contract or a specific account. * @returns The result of the execution. */ @@ -88,14 +87,10 @@ export class AcirSimulator { // reserve the first side effect for the tx hash (inserted by the private kernel) const startSideEffectCounter = 1; - // @todo @lherskind Purge the portalContractAddress in here - const portalContractAddress = EthAddress.ZERO; - const transactionFee = Fr.ZERO; const callContext = new CallContext( msgSender, contractAddress, - portalContractAddress, FunctionSelector.fromNameAndParameters(entryPointArtifact.name, entryPointArtifact.parameters), request.gasSettings.getInitialAvailable(), false, diff --git a/yarn-project/simulator/src/mocks/fixtures.ts b/yarn-project/simulator/src/mocks/fixtures.ts index 96d2c9cc39e9..9b008c70a53a 100644 --- a/yarn-project/simulator/src/mocks/fixtures.ts +++ b/yarn-project/simulator/src/mocks/fixtures.ts @@ -70,7 +70,6 @@ export class PublicExecutionResultBuilder { callContext: new CallContext( from, tx.to, - EthAddress.ZERO, tx.functionData.selector, Gas.test(), false, diff --git a/yarn-project/simulator/src/public/abstract_phase_manager.ts b/yarn-project/simulator/src/public/abstract_phase_manager.ts index 2f62dd004d4f..c0c86deb4683 100644 --- a/yarn-project/simulator/src/public/abstract_phase_manager.ts +++ b/yarn-project/simulator/src/public/abstract_phase_manager.ts @@ -447,8 +447,7 @@ export abstract class AbstractPhaseManager { c.toCallRequest(callStackItem.publicInputs.callContext), ); const publicCallStack = padArrayEnd(publicCallRequests, CallRequest.empty(), MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL); - const portalContractAddress = result.execution.callContext.portalContractAddress.toField(); - return new PublicCallData(callStackItem, publicCallStack, makeEmptyProof(), portalContractAddress, bytecodeHash); + return new PublicCallData(callStackItem, publicCallStack, makeEmptyProof(), bytecodeHash); } } diff --git a/yarn-project/simulator/src/public/avm_executor.test.ts b/yarn-project/simulator/src/public/avm_executor.test.ts index 43c1dc7663c3..72de9cf522e3 100644 --- a/yarn-project/simulator/src/public/avm_executor.test.ts +++ b/yarn-project/simulator/src/public/avm_executor.test.ts @@ -29,7 +29,6 @@ describe('AVM WitGen and Proof Generation', () => { const callContext = CallContext.from({ msgSender: AztecAddress.random(), storageContractAddress: AztecAddress.random(), - portalContractAddress: EthAddress.random(), functionSelector: FunctionSelector.empty(), gasLeft: Gas.test(), isDelegateCall: false, diff --git a/yarn-project/simulator/src/public/db.ts b/yarn-project/simulator/src/public/db.ts index 68e08315d6b7..ea39de04f155 100644 --- a/yarn-project/simulator/src/public/db.ts +++ b/yarn-project/simulator/src/public/db.ts @@ -61,13 +61,6 @@ export interface PublicContractsDB { */ getBytecode(address: AztecAddress, selector: FunctionSelector): Promise; - /** - * Returns the portal contract address for an L2 address. - * @param address - The L2 contract address. - * @returns The portal contract address or undefined if not found. - */ - getPortalContractAddress(address: AztecAddress): Promise; - /** * Returns a publicly deployed contract instance. * @param address - Address of the contract. diff --git a/yarn-project/simulator/src/public/index.test.ts b/yarn-project/simulator/src/public/index.test.ts index bf742a3e52d8..f6b9e34f9ab2 100644 --- a/yarn-project/simulator/src/public/index.test.ts +++ b/yarn-project/simulator/src/public/index.test.ts @@ -94,7 +94,6 @@ describe('ACIR public execution simulator', () => { storageContractAddress, msgSender: AztecAddress.random(), gasLeft, - portalContractAddress: EthAddress.random(), functionSelector: FunctionSelector.empty(), isDelegateCall: false, isStaticCall: false, @@ -433,10 +432,7 @@ describe('ACIR public execution simulator', () => { crossChainMsgSender ?? preimage.sender.sender, ]); - const computeCallContext = () => - makeCallContext(contractAddress, { - portalContractAddress: crossChainMsgSender ?? preimage.sender.sender, - }); + const computeCallContext = () => makeCallContext(contractAddress); const computeGlobalVariables = () => new GlobalVariables( diff --git a/yarn-project/simulator/src/public/public_execution_context.ts b/yarn-project/simulator/src/public/public_execution_context.ts index adf3e893484e..8baf970973d8 100644 --- a/yarn-project/simulator/src/public/public_execution_context.ts +++ b/yarn-project/simulator/src/public/public_execution_context.ts @@ -194,13 +194,11 @@ export class PublicExecutionContext extends TypedOracle { `Public function call: addr=${targetContractAddress} selector=${functionSelector} args=${args.join(',')}`, ); - const portalAddress = (await this.contractsDb.getPortalContractAddress(targetContractAddress)) ?? EthAddress.ZERO; const functionData = new FunctionData(functionSelector, /*isPrivate=*/ false); const { transactionFee, gasSettings, gasLeft } = this.execution.callContext; const callContext = CallContext.from({ msgSender: isDelegateCall ? this.execution.callContext.msgSender : this.execution.contractAddress, storageContractAddress: isDelegateCall ? this.execution.contractAddress : targetContractAddress, - portalContractAddress: portalAddress, functionSelector, gasLeft, // Propagate the same gas left as when we started since ACVM public functions don't have any metering isDelegateCall, diff --git a/yarn-project/simulator/src/public/public_executor.ts b/yarn-project/simulator/src/public/public_executor.ts index c40a815732b6..9d0fb764b6b0 100644 --- a/yarn-project/simulator/src/public/public_executor.ts +++ b/yarn-project/simulator/src/public/public_executor.ts @@ -95,11 +95,6 @@ export class ContractsDataSourcePublicDB implements PublicContractsDB { } return contractClass.publicFunctions.find(f => f.selector.equals(selector))?.bytecode; } - - async getPortalContractAddress(address: AztecAddress): Promise { - const contract = await this.getContractInstance(address); - return contract?.portalContractAddress; - } } /** diff --git a/yarn-project/simulator/src/public/transitional_adaptors.ts b/yarn-project/simulator/src/public/transitional_adaptors.ts index 81cd68ebab09..a5d44aaa93de 100644 --- a/yarn-project/simulator/src/public/transitional_adaptors.ts +++ b/yarn-project/simulator/src/public/transitional_adaptors.ts @@ -42,7 +42,6 @@ export function createAvmExecutionEnvironment( current.contractAddress, current.callContext.storageContractAddress, current.callContext.msgSender, - current.callContext.portalContractAddress, globalVariables.gasFees.feePerL1Gas, globalVariables.gasFees.feePerL2Gas, globalVariables.gasFees.feePerDaGas, @@ -63,7 +62,6 @@ export function createPublicExecutionContext(avmContext: AvmContext, calldata: F const callContext = CallContext.from({ msgSender: avmContext.environment.sender, storageContractAddress: avmContext.environment.storageAddress, - portalContractAddress: avmContext.environment.portal, functionSelector: avmContext.environment.temporaryFunctionSelector, gasLeft: Gas.from(avmContext.machineState.gasLeft), isDelegateCall: avmContext.environment.isDelegateCall, diff --git a/yarn-project/simulator/src/test/utils.ts b/yarn-project/simulator/src/test/utils.ts index 5b611e846022..56231284d8ef 100644 --- a/yarn-project/simulator/src/test/utils.ts +++ b/yarn-project/simulator/src/test/utils.ts @@ -23,7 +23,5 @@ export const buildL1ToL2Message = ( const content = sha256ToField([selectorBuf, ...contentPreimage]); const secretHash = computeMessageSecretHash(secret); - // Eventually the kernel will need to prove the kernel portal pair exists within the contract tree, - // EthAddress.random() will need to be replaced when this happens return new L1ToL2Message(new L1Actor(EthAddress.random(), 1), new L2Actor(targetContract, 1), content, secretHash); }; diff --git a/yarn-project/types/src/contracts/contract_instance.ts b/yarn-project/types/src/contracts/contract_instance.ts index f8b6b022c564..1a46d2027af9 100644 --- a/yarn-project/types/src/contracts/contract_instance.ts +++ b/yarn-project/types/src/contracts/contract_instance.ts @@ -1,5 +1,4 @@ import { AztecAddress } from '@aztec/foundation/aztec-address'; -import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, numToUInt8, serializeToBuffer } from '@aztec/foundation/serialize'; import { type FieldsOf } from '@aztec/foundation/types'; @@ -16,8 +15,6 @@ export interface ContractInstance { contractClassId: Fr; /** Hash of the selector and arguments to the constructor. */ initializationHash: Fr; - /** Optional address of the L1 portal contract. */ - portalContractAddress: EthAddress; // @todo @LHerskind Purge /** Optional hash of the struct of public keys used for encryption and nullifying by this contract. */ publicKeysHash: Fr; /** Optional deployer address or zero if this was a universal deploy. */ @@ -31,7 +28,6 @@ export class SerializableContractInstance { public readonly salt: Fr; public readonly contractClassId: Fr; public readonly initializationHash: Fr; - public readonly portalContractAddress: EthAddress; public readonly publicKeysHash: Fr; public readonly deployer: AztecAddress; @@ -42,7 +38,6 @@ export class SerializableContractInstance { this.salt = instance.salt; this.contractClassId = instance.contractClassId; this.initializationHash = instance.initializationHash; - this.portalContractAddress = instance.portalContractAddress; this.publicKeysHash = instance.publicKeysHash; this.deployer = instance.deployer; } @@ -53,7 +48,6 @@ export class SerializableContractInstance { this.salt, this.contractClassId, this.initializationHash, - this.portalContractAddress, this.publicKeysHash, this.deployer, ); @@ -71,7 +65,6 @@ export class SerializableContractInstance { salt: reader.readObject(Fr), contractClassId: reader.readObject(Fr), initializationHash: reader.readObject(Fr), - portalContractAddress: reader.readObject(EthAddress), publicKeysHash: reader.readObject(Fr), deployer: reader.readObject(AztecAddress), }); @@ -83,7 +76,6 @@ export class SerializableContractInstance { salt: Fr.random(), contractClassId: Fr.random(), initializationHash: Fr.random(), - portalContractAddress: EthAddress.random(), publicKeysHash: Fr.random(), deployer: AztecAddress.random(), ...opts,