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

Honor #[verify_only] in move-compiler-v2. Add relevant tests from v1. Also add tests of #[deprecated]. #13732

Merged
merged 11 commits into from
Jun 29, 2024

Conversation

brmataptos
Copy link
Contributor

@brmataptos brmataptos commented Jun 17, 2024

Description

Add options and plumbing for compile_verify_code, warn_deprecated, etc. to move-compiler-v2, and test add relevant tests from v1. Requires disabling verify by default in compiler path in move-model.

Fixes #13696.

Merged in a commit from Wolfgang to fix #13737.

How Has This Been Tested?

Added relevant tests from V1 under tests/more-v1/. Also ran move_pr.sh, which uncovers issue #13737, which is now also fixed here, thanks to Wolfgang. Added new tests to illustrate #13737: function_with_spec.move to test #[verify_only] and #[test_only] with associated spec blocks for verify and testing on and off.

Key Areas to Review

Is plumbing correct?

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Full Node (API, Indexer, etc.)
  • Move/Aptos Virtual Machine
  • Aptos Framework
  • Aptos CLI/SDK
  • Developer Infrastructure
  • Other (specify)

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

Copy link

trunk-io bot commented Jun 17, 2024

⏱️ 6h 2m total CI duration on this PR
Job Cumulative Duration Recent Runs
test-fuzzers 2h 22m 🟩🟩🟩🟩
rust-targeted-unit-tests 1h 20m 🟥🟥🟥
rust-move-tests 43m 🟥🟥🟩🟩
rust-move-unit-coverage 42m 🟩🟩🟩
rust-lints 22m 🟩🟩🟩🟩
run-tests-main-branch 18m 🟩🟩🟩🟩
general-lints 7m 🟩🟩🟩🟩
check-dynamic-deps 4m 🟩🟩🟩🟩
semgrep/ci 3m 🟩🟩🟩🟩🟩 (+1 more)
file_change_determinator 44s 🟩🟩🟩🟩
permission-check 44s 🟩🟩🟩🟩
file_change_determinator 42s 🟩🟩🟩🟩
permission-check 16s 🟩🟩🟩🟩
permission-check 14s 🟩🟩🟩🟩
permission-check 10s 🟩🟩🟩🟩

🚨 1 job on the last run was significantly faster/slower than expected

Job Duration vs 7d avg Delta
rust-targeted-unit-tests 22m 13m +70%

settingsfeedbackdocs ⋅ learn more about trunk.io

Copy link

codecov bot commented Jun 17, 2024

Codecov Report

Attention: Patch coverage is 65.33333% with 26 lines in your changes missing coverage. Please review.

Project coverage is 59.0%. Comparing base (3d4d746) to head (aa91e66).
Report is 1 commits behind head on main.

Files Patch % Lines
third_party/move/move-compiler-v2/src/options.rs 0.0% 26 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13732   +/-   ##
=======================================
  Coverage    59.0%    59.0%           
=======================================
  Files         820      820           
  Lines      197375   197445   +70     
=======================================
+ Hits       116553   116598   +45     
- Misses      80822    80847   +25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


/// Whether to compile #[verify_only] code
#[clap(skip)]
pub compile_verify_code: bool,
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 point to where this flag is used apart from unit tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run_move_prover_v2(), in third_party/move/move-prover/src/lib.rs.

@brmataptos brmataptos requested a review from rahxephon89 June 18, 2024 20:56
@@ -25,29 +31,36 @@ pub struct Options {
num_args = 0..
)]
pub dependencies: Vec<String>,

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has this been done by the auto formatter? Please note that there is no agreement in general what is the better style, it actually pretty much depends on the IDE and font you are using. Its not necessarily better now. I would leave such decisions of formatting at the author and not enforce my private style tastes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just can't read it the other way. Call it an accessibility issue for the partially-blind.


#[clap(long = cli::MOVE_COMPILER_WARN_OF_DEPRECATION_USE_FLAG,
default_value=bool_to_str(move_compiler_warn_of_deprecation_use_env_var()))]
pub warn_deprecated: bool,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering how this relates to the title of the PR. Should you update the title?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it. Though it's the final commit message that really matters.

@brmataptos brmataptos changed the title Honor #[verify_only] in move-compiler-v2. Add relevant tests from v1. Honor #[verify_only] in move-compiler-v2. Add relevant tests from v1. Also add tests of #[deprecated]. Jun 19, 2024
brmataptos and others added 8 commits June 28, 2024 16:23
…ing and tests that it is set when appropriate
…verification and keep_testing_functions"

This reverts commit 355e14e.
Closes #13737. This removes, in the generic parser AST filter, spec blocks for members which are filtered out. For example, for a `#[test_only]` function which is filtered out, also an associated spec block will be removed. This works equally for other attributes like `#[verify_only]` thanks to the generic filter logic.
@brmataptos brmataptos enabled auto-merge (squash) June 29, 2024 00:09

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.

Copy link
Contributor

✅ Forge suite compat success on f648076a280621dbfd4e73b1ca83e3a3f52878ed ==> aa91e66056658506c986b72b071ffa809df66e69

Compatibility test results for f648076a280621dbfd4e73b1ca83e3a3f52878ed ==> aa91e66056658506c986b72b071ffa809df66e69 (PR)
1. Check liveness of validators at old version: f648076a280621dbfd4e73b1ca83e3a3f52878ed
compatibility::simple-validator-upgrade::liveness-check : committed: 10215.623060662116 txn/s, latency: 2880.419955809983 ms, (p50: 2700 ms, p90: 3300 ms, p99: 9300 ms), latency samples: 398280
2. Upgrading first Validator to new version: aa91e66056658506c986b72b071ffa809df66e69
compatibility::simple-validator-upgrade::single-validator-upgrading : committed: 2523.637466565872 txn/s, latency: 10175.49374423609 ms, (p50: 11100 ms, p90: 16000 ms, p99: 16800 ms), latency samples: 65060
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 3266.2923893141156 txn/s, latency: 9544.344757422157 ms, (p50: 9600 ms, p90: 14500 ms, p99: 14900 ms), latency samples: 138100
3. Upgrading rest of first batch to new version: aa91e66056658506c986b72b071ffa809df66e69
compatibility::simple-validator-upgrade::half-validator-upgrading : committed: 3511.603558684835 txn/s, latency: 7421.934323888505 ms, (p50: 9000 ms, p90: 9600 ms, p99: 10200 ms), latency samples: 86820
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 3242.4607789851752 txn/s, latency: 9591.866840052016 ms, (p50: 9600 ms, p90: 14600 ms, p99: 15100 ms), latency samples: 138420
4. upgrading second batch to new version: aa91e66056658506c986b72b071ffa809df66e69
compatibility::simple-validator-upgrade::rest-validator-upgrading : committed: 255.4510216362236 txn/s, submitted: 632.8499278544055 txn/s, failed submission: 253.48880895224693 txn/s, expired: 377.3989062181818 txn/s, latency: 38937.825263157894 ms, (p50: 57700 ms, p90: 58700 ms, p99: 59400 ms), latency samples: 17575
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 6553.869949453931 txn/s, latency: 5042.1699408386985 ms, (p50: 4900 ms, p90: 7900 ms, p99: 9000 ms), latency samples: 229880
5. check swarm health
Compatibility test for f648076a280621dbfd4e73b1ca83e3a3f52878ed ==> aa91e66056658506c986b72b071ffa809df66e69 passed
Test Ok

Copy link
Contributor

✅ Forge suite realistic_env_max_load success on aa91e66056658506c986b72b071ffa809df66e69

two traffics test: inner traffic : committed: 8771.030040542117 txn/s, latency: 4469.174574381519 ms, (p50: 4200 ms, p90: 5400 ms, p99: 9300 ms), latency samples: 3785080
two traffics test : committed: 99.99480672450716 txn/s, latency: 2048.858695652174 ms, (p50: 1900 ms, p90: 2200 ms, p99: 7300 ms), latency samples: 1840
Latency breakdown for phase 0: ["QsBatchToPos: max: 0.218, avg: 0.212", "QsPosToProposal: max: 0.240, avg: 0.228", "ConsensusProposalToOrdered: max: 0.311, avg: 0.285", "ConsensusOrderedToCommit: max: 0.355, avg: 0.342", "ConsensusProposalToCommit: max: 0.637, avg: 0.627"]
Max round gap was 1 [limit 4] at version 1822956. Max no progress secs was 5.083657 [limit 15] at version 1822956.
Test Ok

Copy link
Contributor

✅ Forge suite framework_upgrade success on f648076a280621dbfd4e73b1ca83e3a3f52878ed ==> aa91e66056658506c986b72b071ffa809df66e69

Compatibility test results for f648076a280621dbfd4e73b1ca83e3a3f52878ed ==> aa91e66056658506c986b72b071ffa809df66e69 (PR)
Upgrade the nodes to version: aa91e66056658506c986b72b071ffa809df66e69
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1107.1300550285905 txn/s, submitted: 1109.1308924774373 txn/s, failed submission: 2.0008374488468506 txn/s, expired: 2.0008374488468506 txn/s, latency: 2874.721345381526 ms, (p50: 2100 ms, p90: 5100 ms, p99: 8400 ms), latency samples: 99600
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1263.119889510889 txn/s, submitted: 1266.2140215183585 txn/s, failed submission: 3.0941320074696734 txn/s, expired: 3.0941320074696734 txn/s, latency: 2508.1463161861693 ms, (p50: 1800 ms, p90: 4500 ms, p99: 7700 ms), latency samples: 106140
5. check swarm health
Compatibility test for f648076a280621dbfd4e73b1ca83e3a3f52878ed ==> aa91e66056658506c986b72b071ffa809df66e69 passed
Upgrade the remaining nodes to version: aa91e66056658506c986b72b071ffa809df66e69
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1153.6179711051984 txn/s, submitted: 1156.3899806473014 txn/s, failed submission: 2.772009542103 txn/s, expired: 2.772009542103 txn/s, latency: 2790.801842210653 ms, (p50: 2100 ms, p90: 4900 ms, p99: 11400 ms), latency samples: 99880
Test Ok

@brmataptos brmataptos merged commit cc8a87e into main Jun 29, 2024
49 checks passed
@brmataptos brmataptos deleted the brm-issue-13696 branch June 29, 2024 23:59
@bchocho bchocho mentioned this pull request Jul 1, 2024
21 tasks
brmataptos added a commit that referenced this pull request Jul 3, 2024
Cleanup of the the move_pr.sh script to allow use in CI:

- relocate v2 doc test outputs, use v2 to build for v2 integration tests
   - env var `MVC_DOCGEN_OUTPUT_DIR` is set by V2 tests to relocate doc outputs for V2
- use nextest -profile smoke-test by default to tolerate rare Heisenbugs by replaying 3x
   - env var `MOVE_PR_NEXTEST_PROFILE` allows `smoke-test` to be overridden.
- a few cleanups
    -  paying attention to env var `MOVE_PR_PROFILE` if set
    - Add a few compiler-v2 verification tests and update to v1.matched that were left over from #13732
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants