-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vm] Use prod configs for aptos #13317
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
// For historical reasons, we support still < gas version 5, but if a new caller don't specify | ||
// the gas version, we default to 5, which was introduced in late '22. | ||
let gas_feature_version = gas_feature_version_opt.unwrap_or(5); | ||
if gas_feature_version < 5 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HM, is there any invariant that we can check here? Seems like the only thing we need from that parameter is whether it's None or <5? what happens if some large number is provided? Couldn't we just pass a boolean instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to not take gas feature version into account
let enable_invariant_violation_check_in_swap_loc = | ||
!timed_features.is_enabled(TimedFeatureFlag::DisableInvariantViolationCheckInSwapLoc); | ||
|
||
let mut type_max_cost = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is max cost actually 0 or 0 is used as None here? the below ones make sense if not enabled means byte/base cost being actually 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is basically to ensure pseudo gas metering in type to tag conversion is not charged if feature is not enabled.
storage/backup/backup-cli/src/backup_types/state_snapshot/restore.rs
Outdated
Show resolved
Hide resolved
@@ -1388,12 +1386,12 @@ impl AptosVM { | |||
|
|||
/// Deserialize a module bundle. | |||
fn deserialize_module_bundle(&self, modules: &ModuleBundle) -> VMResult<Vec<CompiledModule>> { | |||
let max_version = get_max_binary_format_version(self.features(), None); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vgao1996 this is a bug, right? We default to 5 here because of passing None, but instead should select 5,6,7 based on feature flags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still looking at the code, but one thing I noticed here is that the Option passed in is NOT the binary format version, but the gas feature version.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13317 +/- ##
========================================
Coverage 32.9% 33.0%
========================================
Files 1768 1764 -4
Lines 339264 339051 -213
========================================
- Hits 111949 111917 -32
+ Misses 227315 227134 -181 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I feel like we should just run replay verify
@@ -1388,12 +1386,12 @@ impl AptosVM { | |||
|
|||
/// Deserialize a module bundle. | |||
fn deserialize_module_bundle(&self, modules: &ModuleBundle) -> VMResult<Vec<CompiledModule>> { | |||
let max_version = get_max_binary_format_version(self.features(), None); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still looking at the code, but one thing I noticed here is that the Option passed in is NOT the binary format version, but the gas feature version.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
Description
This PR cherry picks a simple change from #13276 to have aptos production configs in one place and share them between the codebase. In particular:
Commit 1: introduce
aptos_prod_..._config()
functions to have a single way of creating production configurations.Commit 2: move VM randomness config to the same crate to have all configs in a single place.
Type of Change
Which Components or Systems Does This Change Impact?
How Has This Been Tested?
Key Areas to Review
Checklist