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

[stdlib] ModuleUpgradeScripts::update_module_upgrade_strategy support set min_time_limit #7

Closed
jolestar opened this issue Dec 30, 2021 · 4 comments · Fixed by #127
Closed
Milestone

Comments

@jolestar
Copy link
Member

ModuleUpgradeScripts::update_module_upgrade_strategy can not support set min_time_limit now.

module ModuleUpgradeScripts {
    public(script) fun update_module_upgrade_strategy(
        sender: signer,
        strategy: u8,
    ){
    //....
     PackageTxnManager::update_module_upgrade_strategy(
            &sender,
            strategy,
            Option::none<u64>(),
        );
   }
}
   // Add a new script function
   public(script) fun update_module_upgrade_strategy_with_min_time(
        sender: signer,
        strategy: u8,
        min_time_limit: u64,
    ){
       //...
      PackageTxnManager::update_module_upgrade_strategy(
            &sender,
            strategy,
            Option::some<u64>(min_time_limit),
        );
   }
@element2050
Copy link

element2050 commented Dec 30, 2021

support to update the config of the same strategy at the same time.

current stdlib implementation limits this:

            let previous_strategy = get_module_upgrade_strategy(account_address);
            assert(strategy > previous_strategy, Errors::invalid_argument(ESTRATEGY_INCORRECT));

@jolestar
Copy link
Member Author

support to update the config of the same strategy at the same time.

current stdlib implementation limits this:

            let previous_strategy = get_module_upgrade_strategy(account_address);
            assert(strategy > previous_strategy, Errors::invalid_argument(ESTRATEGY_INCORRECT));

update strategy and min time limit only support update once from ARBITRARY to TWO_PHASE.

@element2050
Copy link

This means that a contract that has already been deployed and initialized will update the min time limit, can only be redeployed by replacing address ?

@jolestar
Copy link
Member Author

This means that a contract that has already been deployed and initialized will update the min time limit, can only be redeployed by replacing address ?

yes

@jolestar jolestar transferred this issue from starcoinorg/starcoin Feb 28, 2022
@jolestar jolestar added this to the v12 milestone Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants