Skip to content

Commit

Permalink
remove error detail from default feature list
Browse files Browse the repository at this point in the history
  • Loading branch information
areshand committed Nov 23, 2024
1 parent 516f32e commit 666f8f1
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 43 deletions.
1 change: 0 additions & 1 deletion aptos-move/aptos-vm/src/aptos_vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ impl AptosVM {
error_vm_status.clone(),
self.features()
.is_enabled(FeatureFlag::CHARGE_INVARIANT_VIOLATION),
self.features(),
);

match txn_status {
Expand Down
7 changes: 1 addition & 6 deletions storage/aptosdb/src/db/include/aptosdb_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -489,6 +483,7 @@ impl AptosDB {
Ok(root_hash)
}

#[allow(dead_code)]
fn commit_transaction_auxiliary_data<'a>(
&self,
first_version: Version,
Expand Down
1 change: 0 additions & 1 deletion types/src/on_chain_config/aptos_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions types/src/proptest_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
transaction::{
Expand Down Expand Up @@ -497,7 +497,7 @@ impl TransactionPayload {

prop_compose! {
fn arb_transaction_status()(vm_status in any::<VMStatus>()) -> 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
}
}
Expand Down
34 changes: 1 addition & 33 deletions types/src/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
transaction::authenticator::{
AccountAuthenticator, AnyPublicKey, AnySignature, SingleKeyAuthenticator,
Expand Down Expand Up @@ -914,22 +913,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
Expand Down Expand Up @@ -982,7 +965,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);
Expand All @@ -1005,21 +987,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 {
Expand Down

0 comments on commit 666f8f1

Please sign in to comment.