Skip to content
Unverified Commit f170af61 authored by Sergej Sakac's avatar Sergej Sakac Committed by GitHub
Browse files

Coretime auto-renew (#4424)



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:
- [x] Write benchmarks for the newly added extrinsics.

Closes: #4351

---------

Co-authored-by: default avatarDónal Murray <[email protected]>
parent 6619277b
Pipeline #487459 waiting for manual action with stages
in 44 minutes and 4 seconds