Skip to content

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

}

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.


/// The `SerializedPackage` struct holds the serialized modules of a package, the storage ID of the
/// package, and the linkage table that maps the runtime ID found within the package to their
/// 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.

/// 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.

/// (this is not currently possible as ModuleId and StructTag
/// are always structurally valid)
/// - storage encounters internal error
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.
@tzakian
Copy link
Contributor Author

tzakian commented Mar 19, 2025

merged into the bella-ciao branch. Closing.

@tzakian tzakian closed this Mar 19, 2025
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