Skip to content

Conversation

@bkchr
Copy link
Member

@bkchr bkchr commented Apr 16, 2025

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.

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.
@bkchr bkchr added the T8-polkadot This PR/Issue is related to/affects the Polkadot network. label Apr 16, 2025
@bkchr bkchr requested a review from a team as a code owner April 16, 2025 09:11
@bkchr
Copy link
Member Author

bkchr commented Apr 16, 2025

/cmd prdoc --audience runtime_user --bump major

/// 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())]
Copy link
Member

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?

Copy link
Member Author

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

@bkchr bkchr requested a review from ordian April 18, 2025 20:09
Copy link
Contributor

@ordian ordian left a 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)

Comment on lines +1265 to +1266
// Per day the cooldown is removed earlier, it should cost 1000.
type CooldownRemovalMultiplier = ConstUint<{ 1000 * UNITS / DAYS as u128 }>;
Copy link
Contributor

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.

Copy link
Member Author

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>>;
Copy link
Contributor

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.

Copy link
Member Author

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.

Comment on lines +666 to +668

/// The fungible instance used by the runtime.
type Fungible: Mutate<Self::AccountId, Balance: From<BlockNumberFor<Self>>>;
Copy link
Contributor

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 :)

Copy link
Member Author

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.

@bkchr bkchr added this pull request to the merge queue Apr 20, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 20, 2025
@bkchr bkchr added this pull request to the merge queue Apr 22, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Apr 22, 2025
@bkchr bkchr enabled auto-merge April 22, 2025 09:51
@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/14717409279
Failed job name: cargo-clippy

@bkchr bkchr requested review from a team as code owners April 29, 2025 07:19
@bkchr bkchr added this pull request to the merge queue Apr 29, 2025
Merged via the queue into master with commit 678b60f Apr 29, 2025
234 of 249 checks passed
@bkchr bkchr deleted the bkchr-remove-upgrade-cooldown branch April 29, 2025 10:48
castillax pushed a commit that referenced this pull request May 12, 2025
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>
fellowship-merge-bot bot pushed a commit to polkadot-fellows/runtimes that referenced this pull request Aug 7, 2025
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T8-polkadot This PR/Issue is related to/affects the Polkadot network.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants