Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rahxephon89 committed Nov 4, 2024
1 parent 2834ed5 commit 23b51cf
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
14 changes: 5 additions & 9 deletions aptos-move/aptos-e2e-comparison-testing/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use aptos_types::{
use aptos_validator_interface::AptosValidatorInterface;
use clap::ValueEnum;
use itertools::Itertools;
use move_binary_format::file_format_common::VERSION_6;
use move_binary_format::file_format_common::VERSION_DEFAULT;
use move_core_types::{account_address::AccountAddress, language_storage::ModuleId};
use move_model::metadata::CompilerVersion;
use std::{cmp, collections::HashMap, env, path::PathBuf, sync::Arc};
Expand Down Expand Up @@ -123,7 +123,7 @@ impl Execution {
Self {
input_path,
execution_mode,
bytecode_version: VERSION_6,
bytecode_version: VERSION_DEFAULT,
skip_ref_packages,
}
}
Expand Down Expand Up @@ -397,11 +397,9 @@ impl Execution {

// Update features if needed to the correct binary format used by V2 compiler.
let mut features = Features::fetch_config(&state).unwrap_or_default();
features.enable(FeatureFlag::VM_BINARY_FORMAT_V7);
if v2_flag {
features.enable(FeatureFlag::VM_BINARY_FORMAT_V7);
} else {
features.disable(FeatureFlag::VM_BINARY_FORMAT_V7);
features.enable(FeatureFlag::VM_BINARY_FORMAT_V6);
features.enable(FeatureFlag::FAKE_FEATURE_FOR_COMPARISON_TESTING);
}
state.set_features(features);

Expand Down Expand Up @@ -514,9 +512,7 @@ impl Execution {
(Ok((res_1, txn_status_1, gas_used_1)), Ok((res_2, txn_status_2, gas_used_2))) => {
// compare txn status
if txn_status_1 != txn_status_2 {
println!("txn status is different at version: {}", cur_version);
println!("status from V1:{:?}", txn_status_1);
println!("status from V2:{:?}", txn_status_2);
self.output_result_str(format!("txn status is different at version: {}, status from V1:{:?}, gas used:{}, status from V2:{:?}, gas used:{}", cur_version, txn_status_1, gas_used_1, txn_status_2, gas_used_2));
return;
}
// compare events
Expand Down
14 changes: 14 additions & 0 deletions aptos-move/aptos-release-builder/src/components/feature_flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ pub enum FeatureFlag {
TransactionSimulationEnhancement,
CollectionOwner,
EnableLoaderV2,
TransactionContextHashFunctionUpdate,
FakeFeatureForComparisonTesting,
}

fn generate_features_blob(writer: &CodeWriter, data: &[u64]) {
Expand Down Expand Up @@ -349,6 +351,12 @@ impl From<FeatureFlag> for AptosFeatureFlag {
},
FeatureFlag::CollectionOwner => AptosFeatureFlag::COLLECTION_OWNER,
FeatureFlag::EnableLoaderV2 => AptosFeatureFlag::ENABLE_LOADER_V2,
FeatureFlag::TransactionContextHashFunctionUpdate => {
AptosFeatureFlag::TRANSACTION_CONTEXT_HASH_FUNCTION_UPDATE
},
FeatureFlag::FakeFeatureForComparisonTesting => {
AptosFeatureFlag::FAKE_FEATURE_FOR_COMPARISON_TESTING
},
}
}
}
Expand Down Expand Up @@ -493,6 +501,12 @@ impl From<AptosFeatureFlag> for FeatureFlag {
},
AptosFeatureFlag::COLLECTION_OWNER => FeatureFlag::CollectionOwner,
AptosFeatureFlag::ENABLE_LOADER_V2 => FeatureFlag::EnableLoaderV2,
AptosFeatureFlag::TRANSACTION_CONTEXT_HASH_FUNCTION_UPDATE => {
FeatureFlag::TransactionContextHashFunctionUpdate
},
AptosFeatureFlag::FAKE_FEATURE_FOR_COMPARISON_TESTING => {
FeatureFlag::FakeFeatureForComparisonTesting
},
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions aptos-move/e2e-tests/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ use aptos_types::{
signature_verified_transaction::{
into_signature_verified_block, SignatureVerifiedTransaction,
},
BlockOutput, EntryFunction, ExecutionStatus, SignedTransaction, Transaction,
TransactionOutput, TransactionPayload, TransactionStatus, VMValidatorResult,
ViewFunctionOutput,
BlockOutput, ExecutionStatus, SignedTransaction, Transaction, TransactionOutput,
TransactionPayload, TransactionStatus, VMValidatorResult, ViewFunctionOutput,
},
vm_status::VMStatus,
write_set::{WriteOp, WriteSet, WriteSetMut},
Expand Down
2 changes: 2 additions & 0 deletions types/src/on_chain_config/aptos_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ pub enum FeatureFlag {
TRANSACTION_SIMULATION_ENHANCEMENT = 78,
COLLECTION_OWNER = 79,
ENABLE_LOADER_V2 = 81,
TRANSACTION_CONTEXT_HASH_FUNCTION_UPDATE = 80,
FAKE_FEATURE_FOR_COMPARISON_TESTING = 1000,
}

impl FeatureFlag {
Expand Down

0 comments on commit 23b51cf

Please sign in to comment.