From f4ab996adc6700c272ec148ba32e35b3c6c03f91 Mon Sep 17 00:00:00 2001 From: Bo Wu Date: Thu, 21 Nov 2024 14:34:13 -0800 Subject: [PATCH] update tests --- .../src/components/feature_flags.rs | 8 ++- .../aptos_test_harness/borrow_in_loop.exp | 4 +- .../aptos_test_harness/borrow_in_loop.v2_exp | 4 +- .../aptos_test_harness/diamond_clicker.exp | 2 +- aptos-move/aptos-vm-types/src/output.rs | 11 +--- aptos-move/aptos-vm-types/src/tests/utils.rs | 3 +- aptos-move/aptos-vm/src/aptos_vm.rs | 19 ++----- .../user_transaction_sessions/epilogue.rs | 4 +- aptos-move/e2e-move-tests/src/harness.rs | 14 ++--- .../src/tests/code_publishing.rs | 15 ++---- aptos-move/e2e-move-tests/src/tests/vm.rs | 11 +--- ...__tests__data_store__borrow_after_move.exp | 26 +--------- ...__tests__data_store__change_after_move.exp | 39 ++------------ ...s__data_store__move_from_across_blocks.exp | 52 ++----------------- ...__scripts__script_bad_sig_function_dep.exp | 15 ++---- ...sts__scripts__script_code_unverifiable.exp | 15 ++---- ...ed_type_argument_module_does_not_exist.exp | 15 ++---- ...ipts__script_non_existing_function_dep.exp | 15 ++---- ...ripts__script_none_existing_module_dep.exp | 15 ++---- ...pt_type_argument_module_does_not_exist.exp | 15 ++---- ...y_txn__test_arbitrary_script_execution.exp | 15 ++---- ...t_script_dependency_fails_verification.exp | 15 ++---- ...ansitive_dependency_fails_verification.exp | 15 ++---- ...type_tag_dependency_fails_verification.exp | 15 ++---- ...ansitive_dependency_fails_verification.exp | 15 ++---- aptos-move/e2e-tests/src/executor.rs | 6 +-- execution/executor-benchmark/src/lib.rs | 6 +-- .../src/native/native_vm.rs | 3 +- types/src/on_chain_config/aptos_features.rs | 6 +-- types/src/proptest_types.rs | 3 +- types/src/transaction/mod.rs | 22 ++------ 31 files changed, 90 insertions(+), 333 deletions(-) diff --git a/aptos-move/aptos-release-builder/src/components/feature_flags.rs b/aptos-move/aptos-release-builder/src/components/feature_flags.rs index b980063aa1fd7..dc71091298b85 100644 --- a/aptos-move/aptos-release-builder/src/components/feature_flags.rs +++ b/aptos-move/aptos-release-builder/src/components/feature_flags.rs @@ -285,7 +285,9 @@ impl From for AptosFeatureFlag { FeatureFlag::ReconfigureWithDkg => AptosFeatureFlag::_DEPRECATED_RECONFIGURE_WITH_DKG, FeatureFlag::KeylessAccounts => AptosFeatureFlag::KEYLESS_ACCOUNTS, FeatureFlag::KeylessButZklessAccounts => AptosFeatureFlag::KEYLESS_BUT_ZKLESS_ACCOUNTS, - FeatureFlag::RemoveDetailedError => AptosFeatureFlag::REMOVE_DETAILED_ERROR_FROM_HASH, + FeatureFlag::RemoveDetailedError => { + AptosFeatureFlag::_DEPRECATED_REMOVE_DETAILED_ERROR_FROM_HASH + }, FeatureFlag::JwkConsensus => AptosFeatureFlag::JWK_CONSENSUS, FeatureFlag::ConcurrentFungibleAssets => AptosFeatureFlag::CONCURRENT_FUNGIBLE_ASSETS, FeatureFlag::RefundableBytes => AptosFeatureFlag::REFUNDABLE_BYTES, @@ -430,7 +432,9 @@ impl From for FeatureFlag { AptosFeatureFlag::_DEPRECATED_RECONFIGURE_WITH_DKG => FeatureFlag::ReconfigureWithDkg, AptosFeatureFlag::KEYLESS_ACCOUNTS => FeatureFlag::KeylessAccounts, AptosFeatureFlag::KEYLESS_BUT_ZKLESS_ACCOUNTS => FeatureFlag::KeylessButZklessAccounts, - AptosFeatureFlag::REMOVE_DETAILED_ERROR_FROM_HASH => FeatureFlag::RemoveDetailedError, + AptosFeatureFlag::_DEPRECATED_REMOVE_DETAILED_ERROR_FROM_HASH => { + FeatureFlag::RemoveDetailedError + }, AptosFeatureFlag::JWK_CONSENSUS => FeatureFlag::JwkConsensus, AptosFeatureFlag::CONCURRENT_FUNGIBLE_ASSETS => FeatureFlag::ConcurrentFungibleAssets, AptosFeatureFlag::REFUNDABLE_BYTES => FeatureFlag::RefundableBytes, diff --git a/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/borrow_in_loop.exp b/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/borrow_in_loop.exp index 69a5b16b8f367..f7386474fbc02 100644 --- a/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/borrow_in_loop.exp +++ b/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/borrow_in_loop.exp @@ -4,7 +4,7 @@ task 1 'publish'. lines 4-26: Error: VMError with status STLOC_UNSAFE_TO_DESTROY_ERROR at location Module ModuleId { address: f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb6, name: Identifier("m") } at index 0 for function definition at code offset 11 in function definition 0 task 2 'run'. lines 28-28: -Error: Failed to execute transaction. ExecutionStatus: MiscellaneousError(None) +Error: Failed to execute transaction. ExecutionStatus: MiscellaneousError(Some(LINKER_ERROR)) task 3 'run'. lines 30-44: -Error: Failed to execute transaction. ExecutionStatus: MiscellaneousError(None) +Error: Failed to execute transaction. ExecutionStatus: MiscellaneousError(Some(STLOC_UNSAFE_TO_DESTROY_ERROR)) diff --git a/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/borrow_in_loop.v2_exp b/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/borrow_in_loop.v2_exp index 69a5b16b8f367..f7386474fbc02 100644 --- a/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/borrow_in_loop.v2_exp +++ b/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/borrow_in_loop.v2_exp @@ -4,7 +4,7 @@ task 1 'publish'. lines 4-26: Error: VMError with status STLOC_UNSAFE_TO_DESTROY_ERROR at location Module ModuleId { address: f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb6, name: Identifier("m") } at index 0 for function definition at code offset 11 in function definition 0 task 2 'run'. lines 28-28: -Error: Failed to execute transaction. ExecutionStatus: MiscellaneousError(None) +Error: Failed to execute transaction. ExecutionStatus: MiscellaneousError(Some(LINKER_ERROR)) task 3 'run'. lines 30-44: -Error: Failed to execute transaction. ExecutionStatus: MiscellaneousError(None) +Error: Failed to execute transaction. ExecutionStatus: MiscellaneousError(Some(STLOC_UNSAFE_TO_DESTROY_ERROR)) diff --git a/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/diamond_clicker.exp b/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/diamond_clicker.exp index 85b58331f150d..2ad9de1be64e9 100644 --- a/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/diamond_clicker.exp +++ b/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/diamond_clicker.exp @@ -73,4 +73,4 @@ bug: BYTECODE VERIFICATION FAILED task 3 'run'. lines 70-70: -Error: Failed to execute transaction. ExecutionStatus: MiscellaneousError(None) +Error: Failed to execute transaction. ExecutionStatus: MiscellaneousError(Some(LINKER_ERROR)) diff --git a/aptos-move/aptos-vm-types/src/output.rs b/aptos-move/aptos-vm-types/src/output.rs index df477b1b1c33e..d8c4ace6d7aaa 100644 --- a/aptos-move/aptos-vm-types/src/output.rs +++ b/aptos-move/aptos-vm-types/src/output.rs @@ -34,7 +34,6 @@ pub struct VMOutput { module_write_set: ModuleWriteSet, fee_statement: FeeStatement, status: TransactionStatus, - auxiliary_data: TransactionAuxiliaryData, } impl VMOutput { @@ -43,14 +42,12 @@ impl VMOutput { module_write_set: ModuleWriteSet, fee_statement: FeeStatement, status: TransactionStatus, - auxiliary_data: TransactionAuxiliaryData, ) -> Self { Self { change_set, module_write_set, fee_statement, status, - auxiliary_data, } } @@ -60,7 +57,6 @@ impl VMOutput { module_write_set: ModuleWriteSet::empty(), fee_statement: FeeStatement::zero(), status, - auxiliary_data: TransactionAuxiliaryData::default(), } } @@ -102,10 +98,6 @@ impl VMOutput { &self.status } - pub fn auxiliary_data(&self) -> &TransactionAuxiliaryData { - &self.auxiliary_data - } - pub fn materialized_size(&self) -> u64 { let mut size = 0; for (state_key, write_size) in self @@ -179,7 +171,6 @@ impl VMOutput { module_write_set, fee_statement, status, - auxiliary_data, } = self; let (write_set, events) = change_set .try_combine_into_storage_change_set(module_write_set)? @@ -189,7 +180,7 @@ impl VMOutput { events, fee_statement.gas_used(), status, - auxiliary_data, + TransactionAuxiliaryData::default(), )) } diff --git a/aptos-move/aptos-vm-types/src/tests/utils.rs b/aptos-move/aptos-vm-types/src/tests/utils.rs index 2cd4fbb5b4a4e..71bee8d9ead3f 100644 --- a/aptos-move/aptos-vm-types/src/tests/utils.rs +++ b/aptos-move/aptos-vm-types/src/tests/utils.rs @@ -16,7 +16,7 @@ use aptos_types::{ fee_statement::FeeStatement, on_chain_config::CurrentTimeMicroseconds, state_store::{state_key::StateKey, state_value::StateValueMetadata}, - transaction::{ExecutionStatus, TransactionAuxiliaryData, TransactionStatus}, + transaction::{ExecutionStatus, TransactionStatus}, write_set::WriteOp, }; use move_binary_format::errors::PartialVMResult; @@ -252,7 +252,6 @@ pub(crate) fn build_vm_output( ModuleWriteSet::new(false, module_write_set.into_iter().collect()), FeeStatement::new(GAS_USED, GAS_USED, 0, 0, 0), STATUS, - TransactionAuxiliaryData::default(), ) } diff --git a/aptos-move/aptos-vm/src/aptos_vm.rs b/aptos-move/aptos-vm/src/aptos_vm.rs index 30251e439bc62..1b469bcd82c9a 100644 --- a/aptos-move/aptos-vm/src/aptos_vm.rs +++ b/aptos-move/aptos-vm/src/aptos_vm.rs @@ -70,8 +70,8 @@ use aptos_types::{ authenticator::AnySignature, signature_verified_transaction::SignatureVerifiedTransaction, BlockOutput, EntryFunction, ExecutionError, ExecutionStatus, ModuleBundle, Multisig, MultisigTransactionPayload, Script, SignedTransaction, Transaction, TransactionArgument, - TransactionAuxiliaryData, TransactionOutput, TransactionPayload, TransactionStatus, - VMValidatorResult, ViewFunctionOutput, WriteSetPayload, + TransactionOutput, TransactionPayload, TransactionStatus, VMValidatorResult, + ViewFunctionOutput, WriteSetPayload, }, vm_status::{AbortLocation, StatusCode, VMStatus}, }; @@ -186,7 +186,6 @@ pub(crate) fn get_system_transaction_output( ModuleWriteSet::empty(), FeeStatement::zero(), TransactionStatus::Keep(ExecutionStatus::Success), - TransactionAuxiliaryData::default(), )) } @@ -471,7 +470,7 @@ impl AptosVM { } } - let (txn_status, txn_aux_data) = TransactionStatus::from_vm_status( + let txn_status = TransactionStatus::from_vm_status( error_vm_status.clone(), self.features() .is_enabled(FeatureFlag::CHARGE_INVARIANT_VIOLATION), @@ -493,7 +492,6 @@ impl AptosVM { resolver, module_storage, status, - txn_aux_data, log_context, change_set_configs, traversal_context, @@ -541,7 +539,6 @@ impl AptosVM { resolver: &impl AptosMoveResolver, module_storage: &impl AptosModuleStorage, status: ExecutionStatus, - txn_aux_data: TransactionAuxiliaryData, log_context: &AdapterLogSchema, change_set_configs: &ChangeSetConfigs, traversal_context: &mut TraversalContext, @@ -672,13 +669,7 @@ impl AptosVM { ) })?; - epilogue_session.finish( - fee_statement, - status, - txn_aux_data, - change_set_configs, - module_storage, - ) + epilogue_session.finish(fee_statement, status, change_set_configs, module_storage) } fn success_transaction_cleanup( @@ -728,7 +719,6 @@ impl AptosVM { let output = epilogue_session.finish( fee_statement, ExecutionStatus::Success, - TransactionAuxiliaryData::default(), change_set_configs, module_storage, )?; @@ -2307,7 +2297,6 @@ impl AptosVM { module_write_set, FeeStatement::zero(), TransactionStatus::Keep(ExecutionStatus::Success), - TransactionAuxiliaryData::default(), ); Ok((VMStatus::Executed, output)) } diff --git a/aptos-move/aptos-vm/src/move_vm_ext/session/user_transaction_sessions/epilogue.rs b/aptos-move/aptos-vm/src/move_vm_ext/session/user_transaction_sessions/epilogue.rs index 0d1c4e19d04e5..673941f5f876e 100644 --- a/aptos-move/aptos-vm/src/move_vm_ext/session/user_transaction_sessions/epilogue.rs +++ b/aptos-move/aptos-vm/src/move_vm_ext/session/user_transaction_sessions/epilogue.rs @@ -17,7 +17,7 @@ use crate::{ use aptos_gas_algebra::Fee; use aptos_types::{ fee_statement::FeeStatement, - transaction::{ExecutionStatus, TransactionAuxiliaryData, TransactionStatus}, + transaction::{ExecutionStatus, TransactionStatus}, }; use aptos_vm_types::{ change_set::VMChangeSet, module_and_script_storage::module_storage::AptosModuleStorage, @@ -104,7 +104,6 @@ impl<'r, 'l> EpilogueSession<'r, 'l> { self, fee_statement: FeeStatement, execution_status: ExecutionStatus, - txn_aux_data: TransactionAuxiliaryData, change_set_configs: &ChangeSetConfigs, module_storage: &impl AptosModuleStorage, ) -> Result { @@ -135,7 +134,6 @@ impl<'r, 'l> EpilogueSession<'r, 'l> { module_write_set, fee_statement, TransactionStatus::Keep(execution_status), - txn_aux_data, )) } } diff --git a/aptos-move/e2e-move-tests/src/harness.rs b/aptos-move/e2e-move-tests/src/harness.rs index eff6c4bde5845..c549d5b1efa61 100644 --- a/aptos-move/e2e-move-tests/src/harness.rs +++ b/aptos-move/e2e-move-tests/src/harness.rs @@ -196,12 +196,11 @@ impl MoveHarness { /// Runs a signed transaction. On success, applies the write set. pub fn run_raw(&mut self, txn: SignedTransaction) -> TransactionOutput { - let mut output = self.executor.execute_transaction(txn); + let output = self.executor.execute_transaction(txn); if matches!(output.status(), TransactionStatus::Keep(_)) { self.executor.apply_write_set(output.write_set()); self.executor.append_events(output.events().to_vec()); } - output.fill_error_status(); output } @@ -239,12 +238,11 @@ impl MoveHarness { &mut self, txn_block: Vec, ) -> Vec { - let mut result = assert_ok!(self.executor.execute_block(txn_block)); - for output in &mut result { + let result = assert_ok!(self.executor.execute_block(txn_block)); + for output in &result { if matches!(output.status(), TransactionStatus::Keep(_)) { self.executor.apply_write_set(output.write_set()); } - output.fill_error_status(); } result } @@ -979,11 +977,7 @@ impl MoveHarness { offset, txns.len() ); - let mut outputs = harness.run_block_get_output(txns); - let _ = outputs - .iter_mut() - .map(|t| t.fill_error_status()) - .collect::>(); + let outputs = harness.run_block_get_output(txns); for (idx, (error, output)) in errors.into_iter().zip(outputs.iter()).enumerate() { if error == SUCCESS { assert_success!( diff --git a/aptos-move/e2e-move-tests/src/tests/code_publishing.rs b/aptos-move/e2e-move-tests/src/tests/code_publishing.rs index b2be91feeff8e..ff14ee00287af 100644 --- a/aptos-move/e2e-move-tests/src/tests/code_publishing.rs +++ b/aptos-move/e2e-move-tests/src/tests/code_publishing.rs @@ -242,17 +242,10 @@ fn code_publishing_upgrade_loader_cache_consistency() { |_| {}, ), ]; - let result = h.run_block_get_output(txns); - assert_success!(result[0].status().to_owned()); - assert_success!(result[1].status().to_owned()); - assert_eq!( - result[2] - .auxiliary_data() - .get_detail_error_message() - .unwrap() - .status_code(), - StatusCode::BACKWARD_INCOMPATIBLE_MODULE_UPDATE - ) + let result = h.run_block(txns); + assert_success!(result[0]); + assert_success!(result[1]); + assert_vm_status!(result[2], StatusCode::BACKWARD_INCOMPATIBLE_MODULE_UPDATE) } #[test] diff --git a/aptos-move/e2e-move-tests/src/tests/vm.rs b/aptos-move/e2e-move-tests/src/tests/vm.rs index a7fea434e5571..ea5736d11faad 100644 --- a/aptos-move/e2e-move-tests/src/tests/vm.rs +++ b/aptos-move/e2e-move-tests/src/tests/vm.rs @@ -41,15 +41,6 @@ fn failed_transaction_cleanup_charges_gas(status_code: StatusCode) { balance, ) .1; - - assert_eq!( - output - .auxiliary_data() - .get_detail_error_message() - .unwrap() - .status_code(), - status_code - ); let write_set: Vec<(&StateKey, &WriteOp)> = output .concrete_write_set_iter() .map(|(k, v)| (k, assert_some!(v))) @@ -59,6 +50,6 @@ fn failed_transaction_cleanup_charges_gas(status_code: StatusCode) { assert!(!output.status().is_discarded()); assert_ok_eq!( output.status().as_kept_status(), - ExecutionStatus::MiscellaneousError(None) + ExecutionStatus::MiscellaneousError(Some(status_code)) ); } diff --git a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__borrow_after_move.exp b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__borrow_after_move.exp index 2a0a37866f8fc..9629e1dada5c4 100644 --- a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__borrow_after_move.exp +++ b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__borrow_after_move.exp @@ -21,18 +21,7 @@ Ok( code_offset: 2, }, ), - auxiliary_data: V1( - TransactionAuxiliaryDataV1 { - detail_error_message: Some( - VMErrorDetail { - status_code: MISSING_DATA, - message: Some( - "Failed to move resource from f5b9d6f01a99e74c790e2f330c092fa05455a8193f1dfc1b113ecc54d067afe1", - ), - }, - ), - }, - ), + auxiliary_data: None, }, ], ) @@ -126,18 +115,7 @@ Ok( code_offset: 2, }, ), - auxiliary_data: V1( - TransactionAuxiliaryDataV1 { - detail_error_message: Some( - VMErrorDetail { - status_code: MISSING_DATA, - message: Some( - "Failed to borrow global resource from f5b9d6f01a99e74c790e2f330c092fa05455a8193f1dfc1b113ecc54d067afe1", - ), - }, - ), - }, - ), + auxiliary_data: None, }, ], ) diff --git a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__change_after_move.exp b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__change_after_move.exp index 181f5c40a26ea..8abe2916afb35 100644 --- a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__change_after_move.exp +++ b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__change_after_move.exp @@ -21,18 +21,7 @@ Ok( code_offset: 2, }, ), - auxiliary_data: V1( - TransactionAuxiliaryDataV1 { - detail_error_message: Some( - VMErrorDetail { - status_code: MISSING_DATA, - message: Some( - "Failed to move resource from f5b9d6f01a99e74c790e2f330c092fa05455a8193f1dfc1b113ecc54d067afe1", - ), - }, - ), - }, - ), + auxiliary_data: None, }, ], ) @@ -126,18 +115,7 @@ Ok( code_offset: 2, }, ), - auxiliary_data: V1( - TransactionAuxiliaryDataV1 { - detail_error_message: Some( - VMErrorDetail { - status_code: MISSING_DATA, - message: Some( - "Failed to borrow global resource from f5b9d6f01a99e74c790e2f330c092fa05455a8193f1dfc1b113ecc54d067afe1", - ), - }, - ), - }, - ), + auxiliary_data: None, }, ], ) @@ -164,18 +142,7 @@ Ok( code_offset: 2, }, ), - auxiliary_data: V1( - TransactionAuxiliaryDataV1 { - detail_error_message: Some( - VMErrorDetail { - status_code: MISSING_DATA, - message: Some( - "Failed to borrow global resource from f5b9d6f01a99e74c790e2f330c092fa05455a8193f1dfc1b113ecc54d067afe1", - ), - }, - ), - }, - ), + auxiliary_data: None, }, ], ) diff --git a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__move_from_across_blocks.exp b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__move_from_across_blocks.exp index f1dda7b2d2b86..2b72d7c65c94b 100644 --- a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__move_from_across_blocks.exp +++ b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__data_store__move_from_across_blocks.exp @@ -21,18 +21,7 @@ Ok( code_offset: 2, }, ), - auxiliary_data: V1( - TransactionAuxiliaryDataV1 { - detail_error_message: Some( - VMErrorDetail { - status_code: MISSING_DATA, - message: Some( - "Failed to move resource from f5b9d6f01a99e74c790e2f330c092fa05455a8193f1dfc1b113ecc54d067afe1", - ), - }, - ), - }, - ), + auxiliary_data: None, }, ], ) @@ -130,18 +119,7 @@ Ok( code_offset: 2, }, ), - auxiliary_data: V1( - TransactionAuxiliaryDataV1 { - detail_error_message: Some( - VMErrorDetail { - status_code: MISSING_DATA, - message: Some( - "Failed to move resource from f5b9d6f01a99e74c790e2f330c092fa05455a8193f1dfc1b113ecc54d067afe1", - ), - }, - ), - }, - ), + auxiliary_data: None, }, ], ) @@ -168,18 +146,7 @@ Ok( code_offset: 2, }, ), - auxiliary_data: V1( - TransactionAuxiliaryDataV1 { - detail_error_message: Some( - VMErrorDetail { - status_code: MISSING_DATA, - message: Some( - "Failed to borrow global resource from f5b9d6f01a99e74c790e2f330c092fa05455a8193f1dfc1b113ecc54d067afe1", - ), - }, - ), - }, - ), + auxiliary_data: None, }, ], ) @@ -250,18 +217,7 @@ Ok( code_offset: 2, }, ), - auxiliary_data: V1( - TransactionAuxiliaryDataV1 { - detail_error_message: Some( - VMErrorDetail { - status_code: MISSING_DATA, - message: Some( - "Failed to move resource from f5b9d6f01a99e74c790e2f330c092fa05455a8193f1dfc1b113ecc54d067afe1", - ), - }, - ), - }, - ), + auxiliary_data: None, }, ], ) diff --git a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_bad_sig_function_dep.exp b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_bad_sig_function_dep.exp index 9aa3663a3fdc9..989537f9dbb13 100644 --- a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_bad_sig_function_dep.exp +++ b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_bad_sig_function_dep.exp @@ -18,19 +18,12 @@ Ok( gas_used: 3, status: Keep( MiscellaneousError( - None, - ), - ), - auxiliary_data: V1( - TransactionAuxiliaryDataV1 { - detail_error_message: Some( - VMErrorDetail { - status_code: TYPE_MISMATCH, - message: None, - }, + Some( + TYPE_MISMATCH, ), - }, + ), ), + auxiliary_data: None, }, ], ) diff --git a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_code_unverifiable.exp b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_code_unverifiable.exp index 0716e44bde3af..817ad9fc21919 100644 --- a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_code_unverifiable.exp +++ b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_code_unverifiable.exp @@ -18,19 +18,12 @@ Ok( gas_used: 3, status: Keep( MiscellaneousError( - None, - ), - ), - auxiliary_data: V1( - TransactionAuxiliaryDataV1 { - detail_error_message: Some( - VMErrorDetail { - status_code: NEGATIVE_STACK_SIZE_WITHIN_BLOCK, - message: None, - }, + Some( + NEGATIVE_STACK_SIZE_WITHIN_BLOCK, ), - }, + ), ), + auxiliary_data: None, }, ], ) diff --git a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_nested_type_argument_module_does_not_exist.exp b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_nested_type_argument_module_does_not_exist.exp index c383918b5692e..d0bb49a891939 100644 --- a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_nested_type_argument_module_does_not_exist.exp +++ b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_nested_type_argument_module_does_not_exist.exp @@ -18,19 +18,12 @@ Ok( gas_used: 3, status: Keep( MiscellaneousError( - None, - ), - ), - auxiliary_data: V1( - TransactionAuxiliaryDataV1 { - detail_error_message: Some( - VMErrorDetail { - status_code: LINKER_ERROR, - message: None, - }, + Some( + LINKER_ERROR, ), - }, + ), ), + auxiliary_data: None, }, ], ) diff --git a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_non_existing_function_dep.exp b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_non_existing_function_dep.exp index 69cc92770c691..4a5c55d23776c 100644 --- a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_non_existing_function_dep.exp +++ b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_non_existing_function_dep.exp @@ -18,19 +18,12 @@ Ok( gas_used: 3, status: Keep( MiscellaneousError( - None, - ), - ), - auxiliary_data: V1( - TransactionAuxiliaryDataV1 { - detail_error_message: Some( - VMErrorDetail { - status_code: LOOKUP_FAILED, - message: None, - }, + Some( + LOOKUP_FAILED, ), - }, + ), ), + auxiliary_data: None, }, ], ) diff --git a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_none_existing_module_dep.exp b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_none_existing_module_dep.exp index c383918b5692e..d0bb49a891939 100644 --- a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_none_existing_module_dep.exp +++ b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_none_existing_module_dep.exp @@ -18,19 +18,12 @@ Ok( gas_used: 3, status: Keep( MiscellaneousError( - None, - ), - ), - auxiliary_data: V1( - TransactionAuxiliaryDataV1 { - detail_error_message: Some( - VMErrorDetail { - status_code: LINKER_ERROR, - message: None, - }, + Some( + LINKER_ERROR, ), - }, + ), ), + auxiliary_data: None, }, ], ) diff --git a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_type_argument_module_does_not_exist.exp b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_type_argument_module_does_not_exist.exp index c383918b5692e..d0bb49a891939 100644 --- a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_type_argument_module_does_not_exist.exp +++ b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__scripts__script_type_argument_module_does_not_exist.exp @@ -18,19 +18,12 @@ Ok( gas_used: 3, status: Keep( MiscellaneousError( - None, - ), - ), - auxiliary_data: V1( - TransactionAuxiliaryDataV1 { - detail_error_message: Some( - VMErrorDetail { - status_code: LINKER_ERROR, - message: None, - }, + Some( + LINKER_ERROR, ), - }, + ), ), + auxiliary_data: None, }, ], ) diff --git a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_arbitrary_script_execution.exp b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_arbitrary_script_execution.exp index 08b93c02d50db..f2512b3dbe34c 100644 --- a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_arbitrary_script_execution.exp +++ b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_arbitrary_script_execution.exp @@ -18,19 +18,12 @@ Ok( gas_used: 3, status: Keep( MiscellaneousError( - None, - ), - ), - auxiliary_data: V1( - TransactionAuxiliaryDataV1 { - detail_error_message: Some( - VMErrorDetail { - status_code: CODE_DESERIALIZATION_ERROR, - message: None, - }, + Some( + CODE_DESERIALIZATION_ERROR, ), - }, + ), ), + auxiliary_data: None, }, ], ) diff --git a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_script_dependency_fails_verification.exp b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_script_dependency_fails_verification.exp index 9d508c1e4da5e..ff35250c565a1 100644 --- a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_script_dependency_fails_verification.exp +++ b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_script_dependency_fails_verification.exp @@ -18,19 +18,12 @@ Ok( gas_used: 3, status: Keep( MiscellaneousError( - None, - ), - ), - auxiliary_data: V1( - TransactionAuxiliaryDataV1 { - detail_error_message: Some( - VMErrorDetail { - status_code: UNEXPECTED_VERIFIER_ERROR, - message: None, - }, + Some( + UNEXPECTED_VERIFIER_ERROR, ), - }, + ), ), + auxiliary_data: None, }, ], ) diff --git a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_script_transitive_dependency_fails_verification.exp b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_script_transitive_dependency_fails_verification.exp index 9d508c1e4da5e..ff35250c565a1 100644 --- a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_script_transitive_dependency_fails_verification.exp +++ b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_script_transitive_dependency_fails_verification.exp @@ -18,19 +18,12 @@ Ok( gas_used: 3, status: Keep( MiscellaneousError( - None, - ), - ), - auxiliary_data: V1( - TransactionAuxiliaryDataV1 { - detail_error_message: Some( - VMErrorDetail { - status_code: UNEXPECTED_VERIFIER_ERROR, - message: None, - }, + Some( + UNEXPECTED_VERIFIER_ERROR, ), - }, + ), ), + auxiliary_data: None, }, ], ) diff --git a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_type_tag_dependency_fails_verification.exp b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_type_tag_dependency_fails_verification.exp index 9d508c1e4da5e..ff35250c565a1 100644 --- a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_type_tag_dependency_fails_verification.exp +++ b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_type_tag_dependency_fails_verification.exp @@ -18,19 +18,12 @@ Ok( gas_used: 3, status: Keep( MiscellaneousError( - None, - ), - ), - auxiliary_data: V1( - TransactionAuxiliaryDataV1 { - detail_error_message: Some( - VMErrorDetail { - status_code: UNEXPECTED_VERIFIER_ERROR, - message: None, - }, + Some( + UNEXPECTED_VERIFIER_ERROR, ), - }, + ), ), + auxiliary_data: None, }, ], ) diff --git a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_type_tag_transitive_dependency_fails_verification.exp b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_type_tag_transitive_dependency_fails_verification.exp index 9d508c1e4da5e..ff35250c565a1 100644 --- a/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_type_tag_transitive_dependency_fails_verification.exp +++ b/aptos-move/e2e-tests/goldens/language_e2e_testsuite__tests__verify_txn__test_type_tag_transitive_dependency_fails_verification.exp @@ -18,19 +18,12 @@ Ok( gas_used: 3, status: Keep( MiscellaneousError( - None, - ), - ), - auxiliary_data: V1( - TransactionAuxiliaryDataV1 { - detail_error_message: Some( - VMErrorDetail { - status_code: UNEXPECTED_VERIFIER_ERROR, - message: None, - }, + Some( + UNEXPECTED_VERIFIER_ERROR, ), - }, + ), ), + auxiliary_data: None, }, ], ) diff --git a/aptos-move/e2e-tests/src/executor.rs b/aptos-move/e2e-tests/src/executor.rs index c510477791f99..2d3b78221b400 100644 --- a/aptos-move/e2e-tests/src/executor.rs +++ b/aptos-move/e2e-tests/src/executor.rs @@ -805,11 +805,9 @@ impl FakeExecutor { let mut outputs = self .execute_block(txn_block) .expect("The VM should not fail to startup"); - let mut txn_output = outputs + outputs .pop() - .expect("A block with one transaction should have one output"); - txn_output.fill_error_status(); - txn_output + .expect("A block with one transaction should have one output") } pub fn execute_transaction_with_gas_profiler( diff --git a/execution/executor-benchmark/src/lib.rs b/execution/executor-benchmark/src/lib.rs index 88a2267acb89a..649281b784ab7 100644 --- a/execution/executor-benchmark/src/lib.rs +++ b/execution/executor-benchmark/src/lib.rs @@ -44,7 +44,7 @@ use aptos_transaction_generator_lib::{ create_txn_generator_creator, AlwaysApproveRootAccountHandle, TransactionGeneratorCreator, TransactionType::{self, CoinTransfer}, }; -use aptos_types::on_chain_config::{FeatureFlag, Features}; +use aptos_types::on_chain_config::Features; use aptos_vm::{aptos_vm::AptosVMBlockExecutor, VMBlockExecutor}; use db_reliable_submitter::DbReliableTransactionSubmitter; use metrics::TIMER; @@ -59,9 +59,7 @@ use std::{ use tokio::runtime::Runtime; pub fn default_benchmark_features() -> Features { - let mut init_features = Features::default(); - init_features.disable(FeatureFlag::REMOVE_DETAILED_ERROR_FROM_HASH); - init_features + Features::default() } pub fn init_db(config: &NodeConfig) -> DbReaderWriter { diff --git a/execution/executor-benchmark/src/native/native_vm.rs b/execution/executor-benchmark/src/native/native_vm.rs index 0621aebfc8648..39679672be476 100644 --- a/execution/executor-benchmark/src/native/native_vm.rs +++ b/execution/executor-benchmark/src/native/native_vm.rs @@ -41,7 +41,7 @@ use aptos_types::{ state_store::{state_key::StateKey, state_value::StateValueMetadata, StateView}, transaction::{ signature_verified_transaction::SignatureVerifiedTransaction, BlockOutput, Transaction, - TransactionAuxiliaryData, TransactionOutput, TransactionStatus, WriteSetPayload, + TransactionOutput, TransactionStatus, WriteSetPayload, }, write_set::WriteOp, AptosCoinType, @@ -162,7 +162,6 @@ impl ExecutorTask for NativeVMExecutorTask { ModuleWriteSet::empty(), FeeStatement::new(gas_units, gas_units, 0, 0, 0), TransactionStatus::Keep(aptos_types::transaction::ExecutionStatus::Success), - TransactionAuxiliaryData::default(), ))), Err(_) => ExecutionStatus::SpeculativeExecutionAbortError("something".to_string()), } diff --git a/types/src/on_chain_config/aptos_features.rs b/types/src/on_chain_config/aptos_features.rs index 4b4faa2f2dd6e..70bc4f18aa546 100644 --- a/types/src/on_chain_config/aptos_features.rs +++ b/types/src/on_chain_config/aptos_features.rs @@ -64,7 +64,7 @@ pub enum FeatureFlag { _DEPRECATED_RECONFIGURE_WITH_DKG = 45, KEYLESS_ACCOUNTS = 46, KEYLESS_BUT_ZKLESS_ACCOUNTS = 47, - REMOVE_DETAILED_ERROR_FROM_HASH = 48, + _DEPRECATED_REMOVE_DETAILED_ERROR_FROM_HASH = 48, // This feature is not used JWK_CONSENSUS = 49, CONCURRENT_FUNGIBLE_ASSETS = 50, REFUNDABLE_BYTES = 51, @@ -306,10 +306,6 @@ impl Features { self.is_enabled(FeatureFlag::FEDERATED_KEYLESS) } - pub fn is_remove_detailed_error_from_hash_enabled(&self) -> bool { - self.is_enabled(FeatureFlag::REMOVE_DETAILED_ERROR_FROM_HASH) - } - pub fn is_refundable_bytes_enabled(&self) -> bool { self.is_enabled(FeatureFlag::REFUNDABLE_BYTES) } diff --git a/types/src/proptest_types.rs b/types/src/proptest_types.rs index 8c3c0180ff718..7de8ebf1b4e10 100644 --- a/types/src/proptest_types.rs +++ b/types/src/proptest_types.rs @@ -497,8 +497,7 @@ impl TransactionPayload { prop_compose! { fn arb_transaction_status()(vm_status in any::()) -> TransactionStatus { - let (txn_status, _) = TransactionStatus::from_vm_status(vm_status, true); - txn_status + TransactionStatus::from_vm_status(vm_status, true) } } diff --git a/types/src/transaction/mod.rs b/types/src/transaction/mod.rs index dabdae0acba76..138dd8e81496c 100644 --- a/types/src/transaction/mod.rs +++ b/types/src/transaction/mod.rs @@ -962,14 +962,10 @@ impl TransactionStatus { } } - pub fn from_vm_status( - vm_status: VMStatus, - charge_invariant_violation: bool, - ) -> (Self, TransactionAuxiliaryData) { + pub fn from_vm_status(vm_status: VMStatus, charge_invariant_violation: bool) -> Self { let status_code = vm_status.status_code(); - let txn_aux = TransactionAuxiliaryData::from_vm_status(&vm_status); // TODO: keep_or_discard logic should be deprecated from Move repo and refactored into here. - let status = match vm_status.keep_or_discard() { + match vm_status.keep_or_discard() { Ok(recorded) => match recorded { // TODO(bowu):status code should be removed from transaction status KeptVMStatus::MiscellaneousError => { @@ -986,8 +982,7 @@ impl TransactionStatus { TransactionStatus::Discard(code) } }, - }; - (status, txn_aux) + } } pub fn from_executed_vm_status(vm_status: VMStatus) -> Self { @@ -1234,17 +1229,6 @@ impl TransactionOutput { (write_set, events, gas_used, status, auxiliary_data) } - // This function is supposed to be called in various tests only - pub fn fill_error_status(&mut self) { - if let TransactionStatus::Keep(ExecutionStatus::MiscellaneousError(None)) = self.status { - if let Some(detail) = self.auxiliary_data.get_detail_error_message() { - self.status = TransactionStatus::Keep(ExecutionStatus::MiscellaneousError(Some( - detail.status_code(), - ))); - } - } - } - pub fn ensure_match_transaction_info( &self, version: Version,