diff --git a/noir-projects/aztec-nr/authwit/src/account.nr b/noir-projects/aztec-nr/authwit/src/account.nr index 0bc16963e25..2e33c4a0823 100644 --- a/noir-projects/aztec-nr/authwit/src/account.nr +++ b/noir-projects/aztec-nr/authwit/src/account.nr @@ -70,16 +70,6 @@ impl AccountActions { } // docs:end:entrypoint - pub fn pay_init_fee(self, fee_payload: FeePayload) { - let valid_fn = self.is_valid_impl; - let mut private_context = self.context.private.unwrap(); - - let fee_hash = fee_payload.hash(); - assert(valid_fn(private_context, fee_hash)); - fee_payload.execute_calls(private_context); - private_context.capture_min_revertible_side_effect_counter(); - } - // docs:start:spend_private_authwit pub fn spend_private_authwit(self, inner_hash: Field) -> Field { let context = self.context.private.unwrap(); diff --git a/noir-projects/aztec-nr/aztec/src/context/private_context.nr b/noir-projects/aztec-nr/aztec/src/context/private_context.nr index 3c8398ffb61..48e4824521f 100644 --- a/noir-projects/aztec-nr/aztec/src/context/private_context.nr +++ b/noir-projects/aztec-nr/aztec/src/context/private_context.nr @@ -28,7 +28,8 @@ use dep::protocol_types::{ }, contrakt::{storage_read::StorageRead, storage_update_request::StorageUpdateRequest}, grumpkin_private_key::GrumpkinPrivateKey, header::Header, - messaging::l2_to_l1_message::L2ToL1Message, utils::reader::Reader, traits::{is_empty, Deserialize, Empty} + messaging::l2_to_l1_message::L2ToL1Message, utils::reader::Reader, + traits::{is_empty, Deserialize, Empty} }; // TODO(https://github.com/AztecProtocol/aztec-packages/issues/1165) @@ -189,6 +190,7 @@ impl PrivateContext { chain_id: self.inputs.private_global_variables.chain_id, version: self.inputs.private_global_variables.version }; + priv_circuit_pub_inputs } @@ -387,8 +389,6 @@ impl PrivateContext { ); } - // crate::oracle::debug_log::debug_log_array_with_prefix("Private call stack item", item.serialize()); - self.private_call_stack_hashes.push(item.hash()); PackedReturns::new(item.public_inputs.returns_hash) diff --git a/noir-projects/noir-contracts/contracts/ecdsa_account_contract/src/main.nr b/noir-projects/noir-contracts/contracts/ecdsa_account_contract/src/main.nr index e0cd1cdaf90..30fb2737fc8 100644 --- a/noir-projects/noir-contracts/contracts/ecdsa_account_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/ecdsa_account_contract/src/main.nr @@ -39,13 +39,6 @@ contract EcdsaAccount { actions.entrypoint(app_payload, fee_payload); } - #[aztec(private)] - #[aztec(noinitcheck)] - fn pay_init_fee(fee_payload: pub FeePayload) { - let actions = AccountActions::private(&mut context, ACCOUNT_ACTIONS_STORAGE_SLOT, is_valid_impl); - actions.pay_init_fee(fee_payload); - } - #[aztec(private)] #[aztec(noinitcheck)] fn spend_private_authwit(inner_hash: Field) -> Field { diff --git a/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/main.nr b/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/main.nr index f0b3f2c8ddd..1ec2152e7c3 100644 --- a/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/main.nr @@ -48,17 +48,6 @@ contract SchnorrAccount { actions.entrypoint(app_payload, fee_payload); } - #[aztec(private)] - #[aztec(noinitcheck)] - fn pay_init_fee(fee_payload: pub FeePayload) { - let actions = AccountActions::private( - &mut context, - storage.approved_actions.storage_slot, - is_valid_impl - ); - actions.pay_init_fee(fee_payload); - } - #[aztec(private)] #[aztec(noinitcheck)] fn spend_private_authwit(inner_hash: Field) -> Field { diff --git a/noir-projects/noir-contracts/contracts/schnorr_hardcoded_account_contract/src/main.nr b/noir-projects/noir-contracts/contracts/schnorr_hardcoded_account_contract/src/main.nr index 134a820b058..a660670a2a5 100644 --- a/noir-projects/noir-contracts/contracts/schnorr_hardcoded_account_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/schnorr_hardcoded_account_contract/src/main.nr @@ -21,12 +21,6 @@ contract SchnorrHardcodedAccount { actions.entrypoint(app_payload, fee_payload); } - #[aztec(private)] - fn pay_init_fee(fee_payload: pub FeePayload) { - let actions = AccountActions::private(&mut context, ACCOUNT_ACTIONS_STORAGE_SLOT, is_valid_impl); - actions.pay_init_fee(fee_payload); - } - #[aztec(private)] fn spend_private_authwit(inner_hash: Field) -> Field { let actions = AccountActions::private(&mut context, ACCOUNT_ACTIONS_STORAGE_SLOT, is_valid_impl); diff --git a/noir-projects/noir-contracts/contracts/schnorr_single_key_account_contract/src/main.nr b/noir-projects/noir-contracts/contracts/schnorr_single_key_account_contract/src/main.nr index 2a8678ce778..9803ed4f15e 100644 --- a/noir-projects/noir-contracts/contracts/schnorr_single_key_account_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/schnorr_single_key_account_contract/src/main.nr @@ -17,12 +17,6 @@ contract SchnorrSingleKeyAccount { actions.entrypoint(app_payload, fee_payload); } - #[aztec(private)] - fn pay_init_fee(fee_payload: pub FeePayload) { - let actions = AccountActions::private(&mut context, ACCOUNT_ACTIONS_STORAGE_SLOT, is_valid_impl); - actions.pay_init_fee(fee_payload); - } - #[aztec(private)] fn spend_private_authwit(inner_hash: Field) -> Field { let actions = AccountActions::private(&mut context, ACCOUNT_ACTIONS_STORAGE_SLOT, is_valid_impl); diff --git a/yarn-project/aztec.js/src/account_manager/deploy_account_method.ts b/yarn-project/aztec.js/src/account_manager/deploy_account_method.ts index 75a2c6bd0d1..0534790e935 100644 --- a/yarn-project/aztec.js/src/account_manager/deploy_account_method.ts +++ b/yarn-project/aztec.js/src/account_manager/deploy_account_method.ts @@ -51,18 +51,21 @@ export class DeployAccountMethod extends DeployMethod { if (options.fee && this.#feePaymentArtifact) { const { address } = this.getInstance(); + const emptyAppPayload = EntrypointPayload.fromAppExecution([]); const feePayload = await EntrypointPayload.fromFeeOptions(options?.fee); exec.calls.push({ to: address, - args: encodeArguments(this.#feePaymentArtifact, [feePayload]), + args: encodeArguments(this.#feePaymentArtifact, [emptyAppPayload, feePayload]), functionData: FunctionData.fromAbi(this.#feePaymentArtifact), }); exec.authWitnesses ??= []; exec.packedArguments ??= []; + exec.authWitnesses.push(await this.#authWitnessProvider.createAuthWit(emptyAppPayload.hash())); exec.authWitnesses.push(await this.#authWitnessProvider.createAuthWit(feePayload.hash())); + exec.packedArguments.push(...emptyAppPayload.packedArguments); exec.packedArguments.push(...feePayload.packedArguments); } diff --git a/yarn-project/aztec.js/src/account_manager/index.ts b/yarn-project/aztec.js/src/account_manager/index.ts index 43fb28a5b23..251e7d40bb3 100644 --- a/yarn-project/aztec.js/src/account_manager/index.ts +++ b/yarn-project/aztec.js/src/account_manager/index.ts @@ -148,7 +148,7 @@ export class AccountManager { this.accountContract.getContractArtifact(), args, 'constructor', - 'pay_init_fee', + 'entrypoint', ); } return this.deployMethod;