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

[move-cm][closures] Refactor: Move type conversions out of Loader into a trait #15669

Open
wants to merge 1 commit into
base: wrwg/clos_ability_move
Choose a base branch
from

Conversation

wrwg
Copy link
Contributor

@wrwg wrwg commented Jan 4, 2025

Description

[PR 3/n vm closures]

Type conversions from runtime types to MoveTypeLayout and TypeTag currently are associated with the Loader type. However, they are needed for the FunctionValueExtension trait which needs to be constructed in contexts where no loader but only ModuleStorage exists.

This PR moves the conversion functions into a new trait TypeConverter. The trait is then implemented two times, once based on ModuleStorage only and once based on the existing Loader, for downwards compatibility.

How Has This Been Tested?

Refactoring only, existing tests

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
  • Move Compiler
  • Other (specify)

Copy link

trunk-io bot commented Jan 4, 2025

⏱️ 50m total CI duration on this PR
Job Cumulative Duration Recent Runs
rust-move-tests 13m 🟩
rust-cargo-deny 8m 🟩🟩🟩🟩
rust-move-tests 8m 🟥
rust-move-tests 7m 🟥
check-dynamic-deps 6m 🟩🟩🟩🟩🟩
general-lints 2m 🟩🟩🟩🟩🟩
rust-move-tests 2m 🟥
semgrep/ci 2m 🟩🟩🟩🟩🟩
file_change_determinator 56s 🟩🟩🟩🟩🟩
rust-move-tests 31s
permission-check 15s 🟩🟩🟩🟩🟩
permission-check 12s 🟩🟩🟩🟩🟩
check-branch-prefix 1s 🟩

settingsfeedbackdocs ⋅ learn more about trunk.io

@wrwg wrwg force-pushed the wrwg/clos_ability_move branch from 34517a1 to 7862e77 Compare January 5, 2025 05:50
@wrwg wrwg force-pushed the wrwg/clos_type_conv branch from 4972a5c to 2fed681 Compare January 5, 2025 05:50
@wrwg wrwg force-pushed the wrwg/clos_ability_move branch from 7862e77 to ee49138 Compare January 5, 2025 23:50
@wrwg wrwg force-pushed the wrwg/clos_type_conv branch from 2fed681 to 9c0814c Compare January 6, 2025 02:47
@wrwg wrwg force-pushed the wrwg/clos_ability_move branch from ee49138 to 9fbe74f Compare January 6, 2025 02:47
@wrwg wrwg force-pushed the wrwg/clos_type_conv branch 2 times, most recently from 8b11451 to dcb6bc5 Compare January 6, 2025 03:25
@wrwg wrwg mentioned this pull request Jan 7, 2025
16 tasks
@wrwg wrwg marked this pull request as ready for review January 8, 2025 06:17
@wrwg wrwg force-pushed the wrwg/clos_ability_move branch from 9fbe74f to a79fde9 Compare January 13, 2025 07:08
@wrwg wrwg force-pushed the wrwg/clos_type_conv branch from dcb6bc5 to bfc6f4c Compare January 13, 2025 07:08
@wrwg wrwg force-pushed the wrwg/clos_ability_move branch from a79fde9 to 719f728 Compare January 14, 2025 02:32
@wrwg wrwg force-pushed the wrwg/clos_type_conv branch from bfc6f4c to 355525d Compare January 14, 2025 02:32
@wrwg wrwg force-pushed the wrwg/clos_ability_move branch from 719f728 to 41d027e Compare January 16, 2025 06:43
@wrwg wrwg force-pushed the wrwg/clos_type_conv branch from 355525d to 13dfe03 Compare January 16, 2025 06:43
@wrwg wrwg force-pushed the wrwg/clos_ability_move branch from 41d027e to 8e5b22c Compare January 16, 2025 06:44
@wrwg wrwg force-pushed the wrwg/clos_type_conv branch from 13dfe03 to 92f22e0 Compare January 16, 2025 06:45
@wrwg wrwg force-pushed the wrwg/clos_ability_move branch from 8e5b22c to 6aa1fbf Compare January 17, 2025 06:10
@wrwg wrwg force-pushed the wrwg/clos_type_conv branch from 92f22e0 to 23f4130 Compare January 17, 2025 06:11
@wrwg wrwg force-pushed the wrwg/clos_ability_move branch 3 times, most recently from da757e8 to c078929 Compare January 18, 2025 04:37
…nto a trait

Type conversions from runtime types to `MoveTypeLayout` and `TypeTag` currently are associated with the `Loader` type. However, they are needed for the `FunctionValueExtension` trait which needs to be constructed in contexts where no loader but only `ModuleStorage` exists.

This PR moves the conversion functions into a new trait `TypeConverter`. The trait is then implemented two times based on `ModuleStorage` only and based on the existing `Loader`, for downwards compatibility.
@wrwg wrwg force-pushed the wrwg/clos_ability_move branch from c078929 to 8140006 Compare January 21, 2025 05:09
@wrwg wrwg force-pushed the wrwg/clos_type_conv branch from 23f4130 to 1c9f941 Compare January 21, 2025 05:09
@wrwg wrwg requested a review from georgemitenkov January 21, 2025 05:14
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.

2 participants