diff --git a/crates/blockifier/src/blockifier/stateful_validator.rs b/crates/blockifier/src/blockifier/stateful_validator.rs index dd70cc6a7c..c3be53dba2 100644 --- a/crates/blockifier/src/blockifier/stateful_validator.rs +++ b/crates/blockifier/src/blockifier/stateful_validator.rs @@ -56,13 +56,12 @@ impl StatefulValidator { &mut self, tx: AccountTransaction, skip_validate: bool, - charge_fee: bool, ) -> StatefulValidatorResult<()> { // Deploy account transactions should be fully executed, since the constructor must run // before `__validate_deploy__`. The execution already includes all necessary validations, // so they are skipped here. if let AccountTransaction::DeployAccount(_) = tx { - self.execute(tx, charge_fee)?; + self.execute(tx)?; return Ok(()); } @@ -84,8 +83,8 @@ impl StatefulValidator { Ok(()) } - fn execute(&mut self, tx: AccountTransaction, charge_fee: bool) -> StatefulValidatorResult<()> { - self.tx_executor.execute(&Transaction::AccountTransaction(tx), charge_fee)?; + fn execute(&mut self, tx: AccountTransaction) -> StatefulValidatorResult<()> { + self.tx_executor.execute(&Transaction::AccountTransaction(tx), true)?; Ok(()) } @@ -98,7 +97,7 @@ impl StatefulValidator { // Run pre-validation in charge fee mode to perform fee and balance related checks. // TODO (Meshi, 1/10/2024): When resource bound is supported in FaultyAccountTxCreatorArgs // Change charge_fee to true. - let charge_fee = tx_context.tx_info.enforce_fee().unwrap(); + let charge_fee = true; tx.perform_pre_validation_stage( self.tx_executor.block_state.as_mut().expect(BLOCK_STATE_ACCESS_ERR), tx_context, diff --git a/crates/blockifier/src/blockifier/stateful_validator_test.rs b/crates/blockifier/src/blockifier/stateful_validator_test.rs index 11c7a30fc5..eddc136d88 100644 --- a/crates/blockifier/src/blockifier/stateful_validator_test.rs +++ b/crates/blockifier/src/blockifier/stateful_validator_test.rs @@ -72,7 +72,7 @@ fn test_transaction_validator( // Test the stateful validator. let mut stateful_validator = StatefulValidator::create(state, block_context); - let result = stateful_validator.perform_validations(tx, false, true); + let result = stateful_validator.perform_validations(tx, false); assert!(result.is_ok(), "Validation failed: {:?}", result.unwrap_err()); } @@ -96,6 +96,6 @@ fn test_transaction_validator_skip_validate(max_resource_bounds: ResourceBoundsM let mut stateful_validator = StatefulValidator::create(state, block_context); // The transaction validations should be skipped and the function should return Ok. - let result = stateful_validator.perform_validations(tx, true, true); + let result = stateful_validator.perform_validations(tx, true); assert_matches!(result, Ok(())); } diff --git a/crates/gateway/src/stateful_transaction_validator.rs b/crates/gateway/src/stateful_transaction_validator.rs index 4468aa9250..6e140f1cf5 100644 --- a/crates/gateway/src/stateful_transaction_validator.rs +++ b/crates/gateway/src/stateful_transaction_validator.rs @@ -52,7 +52,7 @@ impl StatefulTransactionValidatorTrait for BlockifierStatefulValidator { account_tx: AccountTransaction, skip_validate: bool, ) -> BlockifierStatefulValidatorResult<()> { - self.perform_validations(account_tx, skip_validate, true) + self.perform_validations(account_tx, skip_validate) } fn get_nonce( diff --git a/crates/native_blockifier/src/py_validator.rs b/crates/native_blockifier/src/py_validator.rs index 4031186a10..8398e48c1a 100644 --- a/crates/native_blockifier/src/py_validator.rs +++ b/crates/native_blockifier/src/py_validator.rs @@ -73,7 +73,7 @@ impl PyValidator { // processed. let skip_validate = self .skip_validate_due_to_unprocessed_deploy_account(&account_tx, deploy_account_tx_hash)?; - self.stateful_validator.perform_validations(account_tx, skip_validate, true)?; + self.stateful_validator.perform_validations(account_tx, skip_validate)?; Ok(()) }