aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[Compiler-v2] Generate bytecode version V7 when using compiler V2

Open rahxephon89 opened this issue 10 months ago • 2 comments

Description

This PR guarantees that the CompiledModule/Script generated by the compiler V2 must be 7 so that only when the feature flag VM_BINARY_FORMAT_V7 is set, the module can be published.

Type of Change

  • [x] 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.)
  • [x] Move/Aptos Virtual Machine
  • [ ] Aptos Framework
  • [ ] Aptos CLI/SDK
  • [ ] Developer Infrastructure
  • [ ] Other (specify)

How Has This Been Tested?

Added an e2e move test

Key Areas to Review

  1. V2 compiler generates bytecode version 7 by default;
  2. the newly added e2e move test checks that V2 generated code can only be published when VM_BINARY_FORMAT_V7 is set;
  3. V1 compiler is not affected.

Checklist

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

rahxephon89 avatar Apr 23 '24 22:04 rahxephon89

⏱️ 7h 6m total CI duration on this PR
Job Cumulative Duration Recent Runs
rust-targeted-unit-tests 2h 13m 🟥🟥🟩🟩 (+2 more)
rust-move-unit-coverage 1h 59m 🟩🟩🟩🟩🟩 (+2 more)
rust-move-tests 1h 12m 🟥🟥🟩🟩🟩 (+2 more)
rust-lints 37m 🟩🟩🟩🟩🟩 (+2 more)
run-tests-main-branch 29m 🟩🟩🟩🟩🟩 (+2 more)
general-lints 14m 🟩🟩🟩🟩🟩 (+2 more)
check-dynamic-deps 14m 🟩🟩🟩🟩🟩 (+2 more)
semgrep/ci 3m 🟩🟩🟩🟩🟩 (+2 more)
file_change_determinator 1m 🟩🟩🟩🟩🟩 (+2 more)
file_change_determinator 1m 🟩🟩🟩🟩🟩 (+2 more)
permission-check 27s 🟩🟩🟩🟩🟩 (+2 more)
permission-check 24s 🟩🟩🟩🟩🟩 (+2 more)
permission-check 18s 🟩🟩🟩🟩🟩 (+2 more)
permission-check 14s 🟩🟩🟩🟩🟩 (+2 more)

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

Job Duration vs 7d avg Delta
rust-move-tests 14m 9m +53%

settingsfeedbackdocs ⋅ learn more about trunk.io

trunk-io[bot] avatar Apr 23 '24 22:04 trunk-io[bot]

Codecov Report

Attention: Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.

Project coverage is 57.6%. Comparing base (5422dc1) to head (cea7f55). Report is 232 commits behind head on main.

Files Patch % Lines
...r-v2/src/file_format_generator/module_generator.rs 80.0% 1 Missing :warning:
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #12996   +/-   ##
=======================================
  Coverage    57.6%    57.6%           
=======================================
  Files         834      834           
  Lines      198369   198384   +15     
=======================================
+ Hits       114306   114319   +13     
- Misses      84063    84065    +2     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 24 '24 01:04 codecov[bot]

This issue is stale because it has been open 45 days with no activity. Remove the stale label, comment or push a commit - otherwise this will be closed in 15 days.

github-actions[bot] avatar Jun 20 '24 01:06 github-actions[bot]