Skip to content
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

Merged
merged 30 commits into from
Nov 15, 2022
Merged

Conversation

0xOutOfGas
Copy link
Contributor

@0xOutOfGas 0xOutOfGas commented Nov 7, 2022

Description

This is a part of spec work for Aptos Framework from MoveBit, we updated below files/modules in this PR:

Added specs for module block & aptos_account & state_storage.

Test Plan

aptos move prove --package-dir ./aptos-framework


This change is Reviewable

spec aptos_framework::aptos_account {
spec module {
pragma verify = true;
pragma aborts_if_is_strict;
Copy link
Contributor

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?

Copy link
Contributor Author

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;
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@0xOutOfGas 0xOutOfGas requested review from junkil-park and removed request for rahxephon89 November 10, 2022 02:31
aptos_framework: &signer,
new_epoch_interval: u64,
) {
include Update_epoch_interval_microsecs;
Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor

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 {
Copy link
Contributor

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?

Copy link
Contributor

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);
Copy link
Contributor

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?

Copy link
Contributor

@qpb8023 qpb8023 Nov 15, 2022

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.

Copy link
Contributor

@junkil-park junkil-park left a 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.

@junkil-park junkil-park enabled auto-merge (squash) November 15, 2022 19:44
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

✅ Forge suite land_blocking success on af1c7e6538933a5b0144016bca9dcd66cf9c874e

performance benchmark with full nodes : 6645 TPS, 5905 ms latency, 10300 ms p99 latency,(!) expired 4024 out of 2841740 txns
Test Ok

@junkil-park junkil-park merged commit e89e898 into aptos-labs:main Nov 15, 2022
@github-actions
Copy link
Contributor

✅ Forge suite compat success on testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> af1c7e6538933a5b0144016bca9dcd66cf9c874e

Compatibility test results for testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> af1c7e6538933a5b0144016bca9dcd66cf9c874e (PR)
1. Check liveness of validators at old version: testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b
compatibility::simple-validator-upgrade::liveness-check : 7414 TPS, 5212 ms latency, 7200 ms p99 latency,no expired txns
2. Upgrading first Validator to new version: af1c7e6538933a5b0144016bca9dcd66cf9c874e
compatibility::simple-validator-upgrade::single-validator-upgrade : 4647 TPS, 9146 ms latency, 11500 ms p99 latency,no expired txns
3. Upgrading rest of first batch to new version: af1c7e6538933a5b0144016bca9dcd66cf9c874e
compatibility::simple-validator-upgrade::half-validator-upgrade : 4980 TPS, 8308 ms latency, 10500 ms p99 latency,no expired txns
4. upgrading second batch to new version: af1c7e6538933a5b0144016bca9dcd66cf9c874e
compatibility::simple-validator-upgrade::rest-validator-upgrade : 6685 TPS, 6040 ms latency, 13500 ms p99 latency,no expired txns
5. check swarm health
Compatibility test for testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> af1c7e6538933a5b0144016bca9dcd66cf9c874e passed
Test Ok

areshand pushed a commit to areshand/aptos-core-1 that referenced this pull request Dec 18, 2022
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants