polkadot-sdk icon indicating copy to clipboard operation
polkadot-sdk copied to clipboard

Coretime auto-renew

Open Szegoo opened this issue 1 year ago • 3 comments

This PR adds functionality that allows tasks to enable auto-renewal. Each task eligible for renewal can enable auto-renewal.

A new storage value is added to track all the cores with auto-renewal enabled and the associated task running on the core. The BoundedVec is sorted by CoreIndex to make disabling auto-renewal more efficient.

Cores are renewed at the start of a new bulk sale. If auto-renewal fails(e.g. due to the sovereign account of the task not holding sufficient balance), an event will be emitted, and the renewal will continue for the other cores.

The two added extrinsics are:

  • enable_auto_renew: Extrinsic for enabling auto renewal.
  • disable_auto_renew: Extrinsic for disabling auto renewal.

TODOs:

  • [ ] Write benchmarks for the newly added extrinsics.

Closes: #4351

Szegoo avatar May 09 '24 16:05 Szegoo

If it is the sovereign account of the para, why don't we implement auto renew on the para itself?

But what if the parachain has multiple cores assigned to it? For example, perhaps the parachain wants to keep renewing only one core but has acquired an additional core for this bulk period due to higher demand.

The reason I am storing the TaskId here as well is to avoid having to look it up for each core when performing auto-renewals.

Szegoo avatar May 10 '24 12:05 Szegoo

@eskimor I would appreciate a review to see if what I implemented here is sensible before writing benchmarks.

Szegoo avatar May 17 '24 08:05 Szegoo

This pull request has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/kusama-coretime-renewal/8219/1

Polkadot-Forum avatar May 21 '24 17:05 Polkadot-Forum

Could you please explain why this PR wasn't addressed with the comment, "This is out of scope for the broker pallet," similar to how it was done in this PR: link to PR?

poppyseedDev avatar May 30 '24 13:05 poppyseedDev

I think this PR is totally in scope for the broker pallet, renewals are a first-class operation supported directly on the coretime chain and this is a UX improvement for teams who want to renew regularly. The PR you've linked introduces secondary market functionality directly in the broker pallet, which is not in scope for the coretime chain as defined in RFC-1. It's not that we're making arbitrary decisions about scope, if an RFC were to be accepted that defines the functionality in that PR then it would be a welcome addition

seadanda avatar May 30 '24 13:05 seadanda

This pull request has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/kusama-coretime-renewal/8219/12

Polkadot-Forum avatar Jun 21 '24 09:06 Polkadot-Forum

The CI pipeline was cancelled due to failure one of the required jobs. Job name: cargo-clippy Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6592890

paritytech-cicd-pr avatar Jul 01 '24 09:07 paritytech-cicd-pr

This pull request has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/polkadot-coretime-renewals/10536/1

Polkadot-Forum avatar Oct 21 '24 09:10 Polkadot-Forum