Skip to content

Commit

Permalink
[move] Enable type size limit (#13793)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemitenkov authored Jun 27, 2024
1 parent 6a0de5c commit f90f322
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion aptos-move/e2e-move-tests/src/tests/access_path_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}

Expand Down
12 changes: 6 additions & 6 deletions aptos-move/e2e-tests/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
),
};
Expand Down Expand Up @@ -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,
);
Expand All @@ -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),
)
Expand Down Expand Up @@ -1169,11 +1170,9 @@ impl FakeExecutor {
args: Vec<Vec<u8>>,
) -> Result<(WriteSet, Vec<ContractEvent>), 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,
);
Expand All @@ -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),
)
Expand Down
2 changes: 1 addition & 1 deletion types/src/on_chain_config/aptos_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]
}
Expand Down

0 comments on commit f90f322

Please sign in to comment.