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

Support freeze package upgrading #1808

Merged
merged 6 commits into from
Jun 4, 2024
Merged

Conversation

pause125
Copy link
Collaborator

@pause125 pause125 commented Jun 3, 2024

Summary

Part of #704

Add Upgrade policy of package, and support freezeing package.

Copy link

vercel bot commented Jun 3, 2024

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

Name Status Preview Comments Updated (UTC)
rooch-portal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 5:16am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
rooch ⬜️ Ignored (Inspect) Visit Preview Jun 4, 2024 5:16am

object::transfer_extend(package, tx_context::sender());
// TODO: should we transfer the Package object to tx sender or package id address?
create_package(module_object, package_id, tx_context::sender());
is_upgrade = false;
};
let package = borrow_mut_package(module_object, package_id);
Copy link
Contributor

Choose a reason for hiding this comment

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

Check if the Package is frozen and abort the transaction with an error code from the module_store.

if (!exists_package(module_object, package_id)) {
let package = object::add_object_field_with_id(module_object, package_id, Package {});
object::transfer_extend(package, tx_context::sender());
// TODO: should we transfer the Package object to tx sender or package id address?
Copy link
Contributor

Choose a reason for hiding this comment

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

The package id address must equal the tx sender?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is not always the same. For example, sequencer publish the framework modules, the tx_sender should be sequencer?

Copy link
Contributor

Choose a reason for hiding this comment

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

The sequencer can only upgrade the framework modules and can not publish a new package with the framework address.

@jolestar jolestar merged commit 1623c31 into rooch-network:main Jun 4, 2024
7 checks passed
@pause125 pause125 deleted the package branch September 2, 2024 15:18
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