-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Introduce remove_upgrade_cooldown
#8254
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
Conversation
This dispatchable enables anyone to pay for removing an active upgrade cooldown from a parachain instead of waiting for the cooldown to be finished. It is useful for times when a parachain needs to apply an upgrade faster than the upgrade cooldown, but it will need to pay in this case. The dispatchable enables anyone to remove an upgrade cooldown of any parachain. The caller needs to pay for the removal and the tokens are burned on a successful removal.
|
/cmd prdoc --audience runtime_user --bump major |
…time_user --bump major'
…e-cooldown' into bkchr-remove-upgrade-cooldown
| /// The cost for removing the cooldown earlier depends on the time left for the cooldown | ||
| /// multiplied by [`Config::CooldownRemovalMultiplier`]. The paid tokens are burned. | ||
| #[pallet::call_index(9)] | ||
| #[pallet::weight(<T as Config>::WeightInfo::force_set_most_recent_context())] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the correct weight?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, I forgot this :P
ordian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not going to block this, but left some suggestion on how it can be improved (maybe in the future)
| // Per day the cooldown is removed earlier, it should cost 1000. | ||
| type CooldownRemovalMultiplier = ConstUint<{ 1000 * UNITS / DAYS as u128 }>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that a suggested configuration for Polkadot? 1000 DOT to unlock an upgrade immediately? Might be worth clarifying in the prdoc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a random number I picked. Would not say it is a recommendation for Polkadot.
| /// removed by using [`Pallet::remove_upgrade_cooldown`]. This dispatchable will use this | ||
| /// multiplier to determine the cost for removing the upgrade cooldown. Time left for the | ||
| /// cooldown multiplied with this multiplier determines the cost. | ||
| type CooldownRemovalMultiplier: Get<BalanceOf<Self>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as you mentioned, the upgrade cooldown is dynamically configured, where's this parameter is static, but implicitly depends on the upgrade cooldown for it's configuration. that means whoever will propose a change to the former, needs to be aware of that implicit dependency.
I suggest an implementation that dynamically reads this cooldown value from the config instead. So this param would not need to be / DAYS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get why you need to depend on it implicitly? If the costs are 1000 per day and the cooldown is 2 days, it would cost 2000 at the beginning.
|
|
||
| /// The fungible instance used by the runtime. | ||
| type Fungible: Mutate<Self::AccountId, Balance: From<BlockNumberFor<Self>>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something to be aware of: we're adding yet another dependency on balances here, which will make it harder to remove them from the relay chain. i guess all of this can be replaced by a credit system akin to the coretime credits. some future work :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that is true, but I don't see the balances support getting removed in the near future.
|
All GitHub workflows were cancelled due to failure one of the required jobs. |
This dispatchable enables anyone to pay for removing an active upgrade cooldown from a parachain instead of waiting for the cooldown to be finished. It is useful for times when a parachain needs to apply an upgrade faster than the upgrade cooldown, but it will need to pay in this case. The dispatchable enables anyone to remove an upgrade cooldown of any parachain. The caller needs to pay for the removal and the tokens are burned on a successful removal. --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This brings in `stable2506` Polkadot SDK, and integrates many new features. Integrated breaking changes to be verified by the original authors: - [x] ~paritytech/polkadot-sdk#8127 @kianenigma @Ank4n~ This will come in with AHM, and not before. - [x] paritytech/polkadot-sdk#7597 @gui1117 - [x] paritytech/polkadot-sdk#8254 @bkchr - [x] paritytech/polkadot-sdk#7592 @bkontur - [x] paritytech/polkadot-sdk#8382 @UtkarshBhardwaj007 - [x] paritytech/polkadot-sdk#8021 @serban300 - [x] paritytech/polkadot-sdk#8344 @serban300 - [x] paritytech/polkadot-sdk#8262 @athei - [x] paritytech/polkadot-sdk#8584 @athei - [x] paritytech/polkadot-sdk#8299 @skunert - [x] paritytech/polkadot-sdk#8652 @pgherveou - [x] paritytech/polkadot-sdk#8554 @pgherveou - [x] paritytech/polkadot-sdk#8281 @mrshiposha - [x] paritytech/polkadot-sdk#7730 @franciscoaguirre - [x] paritytech/polkadot-sdk#8599 @yrong @claravanstaden - [x] paritytech/polkadot-sdk#8531 @bkontur - [x] paritytech/polkadot-sdk#8409 @kianenigma - [x] paritytech/polkadot-sdk#9137 @franciscoaguirre - [x] paritytech/polkadot-sdk#7944 @bkontur - [x] paritytech/polkadot-sdk#8179 @bkontur - [x] paritytech/polkadot-sdk#8037 @yrong --------- Co-authored-by: GitHub Action <[email protected]> Co-authored-by: claravanstaden <[email protected]> Co-authored-by: Branislav Kontur <[email protected]> Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Alain Brenzikofer <[email protected]> Co-authored-by: kianenigma <[email protected]> Co-authored-by: Francisco Aguirre <[email protected]> Co-authored-by: ron <[email protected]> Co-authored-by: joe petrowski <[email protected]> Co-authored-by: Overkillus <[email protected]>
This dispatchable enables anyone to pay for removing an active upgrade cooldown from a parachain instead of waiting for the cooldown to be finished. It is useful for times when a parachain needs to apply an upgrade faster than the upgrade cooldown, but it will need to pay in this case. The dispatchable enables anyone to remove an upgrade cooldown of any parachain. The caller needs to pay for the removal and the tokens are burned on a successful removal.