From 0f9c1d0223e8993e688128a5d653ac75716f2b9f Mon Sep 17 00:00:00 2001 From: Bo Wu Date: Wed, 20 Nov 2024 09:19:22 -0800 Subject: [PATCH] remove error detail from default feature list --- aptos-move/aptos-vm/src/aptos_vm.rs | 1 - .../aptosdb/src/db/include/aptosdb_writer.rs | 7 +--- types/src/on_chain_config/aptos_features.rs | 1 - types/src/proptest_types.rs | 4 +-- types/src/transaction/mod.rs | 34 +------------------ 5 files changed, 4 insertions(+), 43 deletions(-) diff --git a/aptos-move/aptos-vm/src/aptos_vm.rs b/aptos-move/aptos-vm/src/aptos_vm.rs index cc94c805c21aa..1622b461330a5 100644 --- a/aptos-move/aptos-vm/src/aptos_vm.rs +++ b/aptos-move/aptos-vm/src/aptos_vm.rs @@ -475,7 +475,6 @@ impl AptosVM { error_vm_status.clone(), self.features() .is_enabled(FeatureFlag::CHARGE_INVARIANT_VIOLATION), - self.features(), ); match txn_status { diff --git a/storage/aptosdb/src/db/include/aptosdb_writer.rs b/storage/aptosdb/src/db/include/aptosdb_writer.rs index 71a35d21a5ab9..b977f818dce40 100644 --- a/storage/aptosdb/src/db/include/aptosdb_writer.rs +++ b/storage/aptosdb/src/db/include/aptosdb_writer.rs @@ -309,12 +309,6 @@ impl AptosDB { .commit_transaction_accumulator(chunk.first_version, chunk.transaction_infos) .unwrap() }); - s.spawn(|_| { - self.commit_transaction_auxiliary_data( - chunk.first_version, - chunk.transaction_outputs.iter().map(TransactionOutput::auxiliary_data)) - .unwrap() - }); }); Ok(new_root_hash) @@ -489,6 +483,7 @@ impl AptosDB { Ok(root_hash) } + #[allow(dead_code)] fn commit_transaction_auxiliary_data<'a>( &self, first_version: Version, diff --git a/types/src/on_chain_config/aptos_features.rs b/types/src/on_chain_config/aptos_features.rs index 905c907b7df4e..4b4faa2f2dd6e 100644 --- a/types/src/on_chain_config/aptos_features.rs +++ b/types/src/on_chain_config/aptos_features.rs @@ -163,7 +163,6 @@ impl FeatureFlag { FeatureFlag::COIN_TO_FUNGIBLE_ASSET_MIGRATION, FeatureFlag::OBJECT_NATIVE_DERIVED_ADDRESS, FeatureFlag::DISPATCHABLE_FUNGIBLE_ASSET, - FeatureFlag::REMOVE_DETAILED_ERROR_FROM_HASH, FeatureFlag::CONCURRENT_FUNGIBLE_ASSETS, FeatureFlag::AGGREGATOR_V2_IS_AT_LEAST_API, FeatureFlag::CONCURRENT_FUNGIBLE_BALANCE, diff --git a/types/src/proptest_types.rs b/types/src/proptest_types.rs index 33765c9c2e460..6ecd73ef8d6ac 100644 --- a/types/src/proptest_types.rs +++ b/types/src/proptest_types.rs @@ -19,7 +19,7 @@ use crate::{ epoch_state::EpochState, event::{EventHandle, EventKey}, ledger_info::{generate_ledger_info_with_sig, LedgerInfo, LedgerInfoWithSignatures}, - on_chain_config::{Features, ValidatorSet}, + on_chain_config::ValidatorSet, proof::TransactionInfoListWithProof, state_store::{state_key::StateKey, state_value::StateValue}, transaction::{ @@ -499,7 +499,7 @@ impl TransactionPayload { prop_compose! { fn arb_transaction_status()(vm_status in any::()) -> TransactionStatus { - let (txn_status, _) = TransactionStatus::from_vm_status(vm_status, true, &Features::default()); + let (txn_status, _) = TransactionStatus::from_vm_status(vm_status, true); txn_status } } diff --git a/types/src/transaction/mod.rs b/types/src/transaction/mod.rs index b557dfc00e877..dbd4d7ba9721c 100644 --- a/types/src/transaction/mod.rs +++ b/types/src/transaction/mod.rs @@ -11,7 +11,6 @@ use crate::{ contract_event::{ContractEvent, FEE_STATEMENT_EVENT_TYPE}, keyless::{KeylessPublicKey, KeylessSignature}, ledger_info::LedgerInfo, - on_chain_config::{FeatureFlag, Features}, proof::{TransactionInfoListWithProof, TransactionInfoWithProof}, state_store::ShardedStateUpdates, transaction::authenticator::{ @@ -912,22 +911,6 @@ impl ExecutionStatus { _ => ExecutionStatus::MiscellaneousError(None), } } - - pub fn remove_error_detail(self) -> Self { - match self { - ExecutionStatus::MoveAbort { - location, - code, - info: _, - } => ExecutionStatus::MoveAbort { - location, - code, - info: None, - }, - ExecutionStatus::MiscellaneousError(_) => ExecutionStatus::MiscellaneousError(None), - _ => self, - } - } } /// The status of executing a transaction. The VM decides whether or not we should `Keep` the @@ -980,7 +963,6 @@ impl TransactionStatus { pub fn from_vm_status( vm_status: VMStatus, charge_invariant_violation: bool, - features: &Features, ) -> (Self, TransactionAuxiliaryData) { let status_code = vm_status.status_code(); let txn_aux = TransactionAuxiliaryData::from_vm_status(&vm_status); @@ -1003,21 +985,7 @@ impl TransactionStatus { } }, }; - - if features.is_enabled(FeatureFlag::REMOVE_DETAILED_ERROR_FROM_HASH) { - (status.remove_error_detail(), txn_aux) - } else { - (status, txn_aux) - } - } - - pub fn remove_error_detail(self) -> Self { - match self { - TransactionStatus::Keep(status) => { - TransactionStatus::Keep(status.remove_error_detail()) - }, - _ => self, - } + (status, txn_aux) } pub fn from_executed_vm_status(vm_status: VMStatus) -> Self {