-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Spec] Added specs for module block & aptos_account & state_storage #5478
Conversation
spec aptos_framework::aptos_account { | ||
spec module { | ||
pragma verify = true; | ||
pragma aborts_if_is_strict; |
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.
I am wondering why aborts_if_is_strict
is 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 is to ensure all the functions are verified in this module.
@@ -1,20 +1,39 @@ | |||
spec aptos_framework::state_storage { | |||
spec module { | |||
use aptos_std::chain_status; | |||
pragma verify = true; | |||
pragma aborts_if_is_strict; |
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.
Same question. I am wondering why aborts_if_is_strict
is 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 is to ensure all the functions are verified in this module.
aptos_framework: &signer, | ||
new_epoch_interval: u64, | ||
) { | ||
include Update_epoch_interval_microsecs; |
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.
Not: Why capitalize here? And other places as well
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.
Changed naming style to camelcase.
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, a convention is that schema names are in camelcase without _
. I see this is corrected in the newer commit pushed.
// TODO: temporary mockup. | ||
pragma opaque; | ||
aborts_if false; | ||
} | ||
|
||
spec on_reconfig { |
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.
Could you add the comment that this function is supposed to abort always because it has been deprecated?
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 has been removed.
aborts_if addr != @aptos_framework; | ||
aborts_if new_epoch_interval <= 0; | ||
aborts_if !exists<BlockResource>(addr); | ||
ensures exists<BlockResource>(addr); |
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.
What's the reason for this to be re-ensured?
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.
The ensures here is indeed inappropriate. It has been re-modified.
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.
I left a few minor comments. Other than that, it looks good to me.
…eginning() and modify the inappropriate ensures of update_epoch_interval_microsecs()
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
…ptos-labs#5478) * add account.move,coin.move spec * remove coin.spec.move aborts_if_is_strict * update specs for account.move and coin.move * update account.move,coin.move spec * add account.move,coin.move spec comments * Merge aptos:main * Generate account.move.coin.move spec doc * Trim coin.move spec trailing whitespace * add spec for aptos_account & block & state_storage * Generate aptos_account & block & state_storage spec * Changed schema naming style for block and aptos_account to camelcase * Remove the aborts if false of get_state_storage_usage_only_at_epoch_beginning() and modify the inappropriate ensures of update_epoch_interval_microsecs() Co-authored-by: tiutiutiu <qiu971009@gmail.com> Co-authored-by: 英雄造时势 <zhangping_ymd@outlook.com>
Description
This is a part of spec work for Aptos Framework from MoveBit, we updated below files/modules in this PR:
Test Plan
This change is