Skip to content

Commit

Permalink
rollback env var
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemitenkov committed Nov 13, 2024
1 parent ff56da7 commit 2877833
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
10 changes: 2 additions & 8 deletions aptos-move/aptos-vm-environment/src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ use aptos_native_interface::SafeNativeBuilder;
use aptos_types::{
chain_id::ChainId,
on_chain_config::{
ConfigurationResource, FeatureFlag, Features, OnChainConfig, TimedFeatures,
TimedFeaturesBuilder,
ConfigurationResource, Features, OnChainConfig, TimedFeatures, TimedFeaturesBuilder,
},
state_store::StateView,
};
Expand Down Expand Up @@ -176,13 +175,8 @@ impl Environment {
) -> Self {
// We compute and store a hash of configs in order to distinguish different environments.
let mut sha3_256 = Sha3_256::new();
let mut features =
let features =
fetch_config_and_update_hash::<Features>(&mut sha3_256, state_view).unwrap_or_default();
if std::env::var("USE_LOADER_V1").is_ok() {
features.disable(FeatureFlag::ENABLE_LOADER_V2);
} else {
features.enable(FeatureFlag::ENABLE_LOADER_V2);
}

// If no chain ID is in storage, we assume we are in a testing environment.
let chain_id = fetch_config_and_update_hash::<ChainId>(&mut sha3_256, state_view)
Expand Down
2 changes: 1 addition & 1 deletion third_party/move/move-vm/runtime/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl Default for VMConfig {
ty_builder: TypeBuilder::with_limits(128, 20),
disallow_dispatch_for_native: true,
use_compatibility_checker_v2: true,
use_loader_v2: std::env::var("USE_LOADER_V1").is_err(),
use_loader_v2: true,
}
}
}
5 changes: 0 additions & 5 deletions types/src/on_chain_config/aptos_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,6 @@ impl Default for Features {
for feature in FeatureFlag::default_features() {
features.enable(feature);
}
if std::env::var("USE_LOADER_V1").is_ok() {
features.disable(FeatureFlag::ENABLE_LOADER_V2);
} else {
features.enable(FeatureFlag::ENABLE_LOADER_V2);
}
features
}
}
Expand Down

0 comments on commit 2877833

Please sign in to comment.