forked from aptos-labs/aptos-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[move-prover] Revived invariant disabling
In PR aptos-labs#8840, all pragmas disabling invariants were commented out and some invariants were weakened because we found that we needed greater control over which invariants were disabled in order to avoid false positives. This PR has a feature "invariant [suspendable] ...." that indicates that an invariant should be disabled in the body of a function when pragma disable_invariants_in_body appears in the spec of that function. Other invariants will not be disabled. This turns out to work (at least for the Diem framework) because most invariants don't need to be disabled and turn out to be useful for, e.g., proving the absence of abort conditions. There is a small change to add the pragma, and changes in verification_analysis_v2.rs to compute a smaller set of disabled predicates by limiting to the suspendable invariants. Numerous changes were in DiemAccount.move, to disable invariants in some functions, strengthen those invariants, and declare some new friend functions in Roles.move. Several bugs have been fixed where invariants were asserted/assumed in the wrong place. NOTE: This PR is more correct than the previous state, but there are still bugs, including potential soundness bugs. Also, changes to fix soundness issues with type parameters do not play well with the some of the invariant code, so more work is needed, including some careful thinking through of soundness arguments. Closes: aptos-labs#8907
- Loading branch information
1 parent
396ea4c
commit 77ac2b2
Showing
18 changed files
with
608 additions
and
480 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.