move
move copied to clipboard
[move-vm] expose metadata to session
In order to look up struct metadata during changeset evaluation for merging storage / resource groups, we need to expose this aspect of the loader to the session.
This is already exposed as
vm.get_module_metadata, which fits the lifetime of the loader. Its also already used for Aptos, checkframework/src/module_metadata.rs. Error maps and views use this today.
From my investigation, the best place to put the storage group merge is in the session output to changeset, here: https://github.com/aptos-labs/aptos-core/blob/f19ed79b3c180c59a6102e5deb5a5a8c8d1cc78a/aptos-move/aptos-vm/src/move_vm_ext/session.rs#L104
Passing in a MoveVM there leads to some pretty gnarly, spaghetti code.
Doesn't seem like it hurts to expose this here. It would be nice not having to bounce around move versions, even in the case, where we don't end up using this.
Pausing on this... realized that we eat the session in that code, so this approach might be useless as well...