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

[0/n][vm-rewrite][Move] Add runtime_id to SerializedPackage and remove old MoveResolver trait #21064

Open
wants to merge 9 commits into
base: cgswords/vm_pointer_exec
Choose a base branch
from

Conversation

tzakian
Copy link
Contributor

@tzakian tzakian commented Feb 3, 2025

This adds the runtime_id to the SerializedPackage struct, changes the module bytes in the SerializedPackage to be a BTreeMap from the module name to the modules bytes (making module resolution faster and more efficient for certain operations), and removes the old MoveResolver trait as it was no longer needed for the new VM,

The code in the PR may not be working as future PRs will build on top of this.

@tzakian tzakian requested a review from cgswords February 3, 2025 20:46
Copy link

vercel bot commented Feb 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2025 8:10pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Feb 19, 2025 8:10pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Feb 19, 2025 8:10pm

@@ -259,9 +262,10 @@ impl OnDiskStateView {
fs::create_dir_all(&pkg_path)?;
}

for m_bytes in package.modules {
for (nm, m_bytes) in package.modules {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: use a real name, I have no idea what nm means here.

@@ -26,11 +26,17 @@ pub struct TypeOrigin {
/// storage IDs.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this come live in move-vm-runtime eventually?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Possilby, or other stuff from the move-vm-runtime will need to move here (or some in-between state). We're going to need to have an execution versioning discussion about the move-vm-runtime crate and where types live as that was cropping up higher up as well for some other types.

@@ -26,11 +26,17 @@ pub struct TypeOrigin {
/// storage IDs.
#[derive(Debug, Clone)]
pub struct SerializedPackage {
pub modules: Vec<Vec<u8>>,
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 a little dubious about this change: we have previously discussed init relying on this order (which is currently sorted based on dependencies), and we need to consider how init and init_with_args will look with these changes.

@@ -73,8 +89,6 @@ impl SerializedPackage {
pub trait ModuleResolver {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: this should be a PackageResolver now

Copy link
Contributor

@cgswords cgswords left a comment

Choose a reason for hiding this comment

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

Seriously concerned about losing module ordering, but otherwise LGTM.

@tzakian
Copy link
Contributor Author

tzakian commented Feb 4, 2025

Good point on the module ordering. I think switching over to an IndexMap should alleviate these issues as that will maintain order.

@cgswords cgswords force-pushed the cgswords/vm_pointer_exec branch from 1417a14 to 53c073f Compare February 14, 2025 00:36
cgswords and others added 7 commits February 13, 2025 16:47
…emove old `MoveResolver` trait

This adds the `runtime_id` to the `SerializedPackage` struct, changes
the module bytes in the `SerializedPackage` to be a `BTreeMap` from the
module name to the modules bytes (making module resolution faster and
more efficient for certain operations), and removes the old
`MoveResolver` trait as it was no longer needed for the new VM,

The code in the PR may not be working as future PRs will build on top of
this.
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