-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[aggregator] Fix simulation & view for delayed fields #12063
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #12063 +/- ##
=======================================
Coverage 71.4% 71.4%
=======================================
Files 802 802
Lines 184373 184411 +38
=======================================
+ Hits 131737 131826 +89
+ Misses 52636 52585 -51 ☔ View full report in Codecov by Sentry. |
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.
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.
Please address the comments before landing
aptos-move/aptos-vm/src/aptos_vm.rs
Outdated
|
||
fn new_impl( | ||
resolver: &impl AptosMoveResolver, | ||
is_delayed_field_optimization_capable: bool, |
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.
Too many constructors, we can have:
fn new(resolver: &..., maybe_override_delay_field_flag: Option) and cover all the cases.
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.
Good point!
aptos-move/aptos-vm/src/aptos_vm.rs
Outdated
} | ||
|
||
pub(crate) fn new_with_delayed_fields(resolver: &impl AptosMoveResolver) -> Self { | ||
Self::new_impl(resolver, true) |
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.
Should we assert resolver.is_delayed_field_optimization_capable())
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.
Used a single constructor instead
@@ -82,3 +86,57 @@ async fn test_simulate_transaction_with_insufficient_balance() { | |||
let resp = simulate_aptos_transfer(&mut context, false, LARGE_TRANSFER_AMOUNT, 200).await; | |||
assert!(!resp[0]["success"].as_bool().is_some_and(|v| v)); | |||
} | |||
|
|||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)] |
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.
Do we know what is this worker_threads = 2
achieving?
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.
This makes sure your runtime is configured as multi-threaded with 2 threads to run async
@@ -0,0 +1 @@ | |||
["10"] |
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.
newline
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.
golden tests compare the full file so new line breaks them
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.
let vm = AptosVM::new(&resolver); | ||
let vm = AptosVM::new( | ||
&resolver, | ||
/*override_is_delayed_field_optimization_capable=*/ Some(false), |
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.
Why do we need to disable aggregators here?
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.
This runs outside of Block-STM context
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
@@ -0,0 +1,26 @@ | |||
module addr::counter { |
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.
license headers?
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.
Do we need them for test sources as well?
Description
Previously, we have been tagging aggregator fields if the feature flag is enabled. This is not correct because it can be enabled but we run under non-capable context (i.e., outside of Block-STM). This PR fixes that by explicitly providing a boolean whether type layouts need to be tagged inside a VM.
Test Plan