From 23b51cf76d543b550c170244c231e40dfc31d4dc Mon Sep 17 00:00:00 2001 From: Teng Zhang Date: Fri, 25 Oct 2024 16:33:25 -0700 Subject: [PATCH] fix --- .../aptos-e2e-comparison-testing/src/execution.rs | 14 +++++--------- .../src/components/feature_flags.rs | 14 ++++++++++++++ aptos-move/e2e-tests/src/executor.rs | 5 ++--- types/src/on_chain_config/aptos_features.rs | 2 ++ 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/aptos-move/aptos-e2e-comparison-testing/src/execution.rs b/aptos-move/aptos-e2e-comparison-testing/src/execution.rs index 9722383e1a634..7a3c3023f453e 100644 --- a/aptos-move/aptos-e2e-comparison-testing/src/execution.rs +++ b/aptos-move/aptos-e2e-comparison-testing/src/execution.rs @@ -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}; @@ -123,7 +123,7 @@ impl Execution { Self { input_path, execution_mode, - bytecode_version: VERSION_6, + bytecode_version: VERSION_DEFAULT, skip_ref_packages, } } @@ -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); @@ -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 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 4cd1b2a9db29d..7cb15f212de9f 100644 --- a/aptos-move/aptos-release-builder/src/components/feature_flags.rs +++ b/aptos-move/aptos-release-builder/src/components/feature_flags.rs @@ -132,6 +132,8 @@ pub enum FeatureFlag { TransactionSimulationEnhancement, CollectionOwner, EnableLoaderV2, + TransactionContextHashFunctionUpdate, + FakeFeatureForComparisonTesting, } fn generate_features_blob(writer: &CodeWriter, data: &[u64]) { @@ -349,6 +351,12 @@ impl From 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 + }, } } } @@ -493,6 +501,12 @@ impl From 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 + }, } } } diff --git a/aptos-move/e2e-tests/src/executor.rs b/aptos-move/e2e-tests/src/executor.rs index 4fd7abfc3c5d2..3c1e333d431ad 100644 --- a/aptos-move/e2e-tests/src/executor.rs +++ b/aptos-move/e2e-tests/src/executor.rs @@ -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}, diff --git a/types/src/on_chain_config/aptos_features.rs b/types/src/on_chain_config/aptos_features.rs index d1297014ad21f..2ad7be45a6d4c 100644 --- a/types/src/on_chain_config/aptos_features.rs +++ b/types/src/on_chain_config/aptos_features.rs @@ -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 {