From f90f3222f7fc136803ec841e6fad71dbe56ea8a4 Mon Sep 17 00:00:00 2001 From: George Mitenkov Date: Thu, 27 Jun 2024 01:32:38 +0100 Subject: [PATCH] [move] Enable type size limit (#13793) --- .../e2e-move-tests/src/tests/access_path_test.rs | 2 +- aptos-move/e2e-tests/src/executor.rs | 12 ++++++------ types/src/on_chain_config/aptos_features.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/aptos-move/e2e-move-tests/src/tests/access_path_test.rs b/aptos-move/e2e-move-tests/src/tests/access_path_test.rs index 895c38c1c52ba..b4917624d5a61 100644 --- a/aptos-move/e2e-move-tests/src/tests/access_path_test.rs +++ b/aptos-move/e2e-move-tests/src/tests/access_path_test.rs @@ -22,7 +22,7 @@ use move_core_types::{identifier::Identifier, vm_status::StatusCode}; fn access_path_panic() { // github.com/aptos-labs/aptos-core/security/advisories/GHSA-rpw2-84hq-48jj let mut ty = SignatureToken::Bool; - for _ in 0..20 { + for _ in 0..18 { ty = SignatureToken::StructInstantiation(StructHandleIndex(0), vec![ty]); } diff --git a/aptos-move/e2e-tests/src/executor.rs b/aptos-move/e2e-tests/src/executor.rs index fc55c091ae7f8..ece654e35b19f 100644 --- a/aptos-move/e2e-tests/src/executor.rs +++ b/aptos-move/e2e-tests/src/executor.rs @@ -865,7 +865,8 @@ impl FakeExecutor { StorageGasParameters::latest(), ), GasMeterType::UnmeteredGasMeter => ( - AptosGasParameters::zeros(), + // In case of unmetered execution, we still want to enforce limits. + AptosGasParameters::initial(), StorageGasParameters::unlimited(), ), }; @@ -1045,10 +1046,9 @@ impl FakeExecutor { let (write_set, events) = { let resolver = self.data_store.as_move_resolver(); - // TODO(Gas): we probably want to switch to non-zero costs in the future let vm = MoveVmExt::new( LATEST_GAS_FEATURE_VERSION, - Ok(&AptosGasParameters::zeros()), + Ok(&AptosGasParameters::initial()), self.env.clone(), &resolver, ); @@ -1060,6 +1060,7 @@ impl FakeExecutor { &Self::name(function_name), type_params, args, + // TODO(Gas): we probably want to switch to metered execution in the future &mut UnmeteredGasMeter, &mut TraversalContext::new(&storage), ) @@ -1169,11 +1170,9 @@ impl FakeExecutor { args: Vec>, ) -> Result<(WriteSet, Vec), VMStatus> { let resolver = self.data_store.as_move_resolver(); - - // TODO(Gas): we probably want to switch to non-zero costs in the future let vm = MoveVmExt::new( LATEST_GAS_FEATURE_VERSION, - Ok(&AptosGasParameters::zeros()), + Ok(&AptosGasParameters::initial()), self.env.clone(), &resolver, ); @@ -1185,6 +1184,7 @@ impl FakeExecutor { &Self::name(function_name), type_params, args, + // TODO(Gas): we probably want to switch to metered execution in the future &mut UnmeteredGasMeter, &mut TraversalContext::new(&storage), ) diff --git a/types/src/on_chain_config/aptos_features.rs b/types/src/on_chain_config/aptos_features.rs index 5b0b78b86332c..08cccb759cb3d 100644 --- a/types/src/on_chain_config/aptos_features.rs +++ b/types/src/on_chain_config/aptos_features.rs @@ -150,7 +150,7 @@ impl FeatureFlag { FeatureFlag::CONCURRENT_FUNGIBLE_ASSETS, FeatureFlag::AGGREGATOR_V2_IS_AT_LEAST_API, FeatureFlag::CONCURRENT_FUNGIBLE_BALANCE, - // FeatureFlag::LIMIT_VM_TYPE_SIZE, // TODO: Enable when type builder rolls out + FeatureFlag::LIMIT_VM_TYPE_SIZE, FeatureFlag::ABORT_IF_MULTISIG_PAYLOAD_MISMATCH, ] }