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

[sui-types] avoid deserialization when fetching ID of non-upgraded pa… #19849

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sblackshear
Copy link
Collaborator

…ckages

The original_package_id function is showing up in some slow traces, so make it less expensive in the (common) case of grabbing the ID of a non-upgraded package

Copy link

vercel bot commented Oct 14, 2024

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 Oct 14, 2024 5:15pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Oct 14, 2024 5:15pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Oct 14, 2024 5:15pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Oct 14, 2024 5:15pm

…ckages

The `original_package_id` function is showing up in some slow traces, so make it less expensive in the (common) case of grabbing the ID of a non-upgraded package
Copy link
Member

@amnn amnn left a comment

Choose a reason for hiding this comment

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

Makes sense -- in hindsight, we should have included the package's own linkage information in the linkage_table to avoid this...

@@ -483,6 +483,10 @@ impl MovePackage {
/// The ObjectID that this package's modules believe they are from, at runtime (can differ from
/// `MovePackage::id()` in the case of package upgrades).
pub fn original_package_id(&self) -> ObjectID {
if self.version == OBJECT_START_VERSION {
Copy link
Contributor

Choose a reason for hiding this comment

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

I forget, packages don't get the lamport timestamp?

Copy link
Member

Choose a reason for hiding this comment

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

No, they are versioned linearly.

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.

3 participants