Skip to content

Commit e4450b9

Browse files
0xLuccanhussein11eshaben
authored
Add manage coretime page (#663)
* wip: manage coretime * Improve content * Apply suggestions from code review Co-authored-by: Nicolás Hussein <[email protected]> * Apply suggestions * Apply suggestions from code review Co-authored-by: Erin Shaben <[email protected]> * Fix llms.txt --------- Co-authored-by: Nicolás Hussein <[email protected]> Co-authored-by: Erin Shaben <[email protected]>
1 parent 327d92a commit e4450b9

File tree

3 files changed

+206
-2
lines changed

3 files changed

+206
-2
lines changed

develop/parachains/deployment/.pages

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ nav:
55
- 'Generate Chain Specs': generate-chain-specs.md
66
- 'Obtain Coretime': obtain-coretime.md
77
- 'Coretime Renewal': coretime-renewal.md
8-
# - 'POP CLI': pop-cli.md
9-
# - 'Tanssi': tanssi.md
8+
- 'Manage Coretime': manage-coretime.md
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
title: Manage Coretime
3+
description: Learn to manage bulk coretime regions through transfer, partition, interlace, assign, and pool operations for optimal resource allocation.
4+
---
5+
6+
# Manage Coretime
7+
8+
## Introduction
9+
10+
Coretime management involves manipulating [bulk coretime](/develop/parachains/deployment/obtain-coretime/#bulk-coretime){target=\_blank} regions to optimize resource allocation and usage. Regions represent allocated computational resources on cores and can be modified through various operations to meet different project requirements. This guide covers the essential operations for managing your coretime regions effectively.
11+
12+
## Transfer
13+
14+
[Transfer](https://paritytech.github.io/polkadot-sdk/master/pallet_broker/pallet/struct.Pallet.html#method.transfer){target=\_blank} ownership of a bulk coretime region to a new owner. This operation allows you to change who controls and manages a specific region.
15+
16+
Use this operation when you need to delegate control of computational resources to another account or when selling regions to other parties.
17+
18+
```rust
19+
pub fn transfer<T: Config>(region_id: RegionId, new_owner: T::AccountId)
20+
```
21+
22+
**Parameters:**
23+
24+
- **`origin`**: Must be a signed origin of the account which owns the region `region_id`.
25+
- **`region_id`**: The region whose ownership should change.
26+
- **`new_owner`**: The new owner for the region.
27+
28+
## Partition
29+
30+
Split a bulk coretime region into two non-overlapping regions at a specific time point. This operation divides a region temporally, creating two shorter regions that together span the same duration as the original.
31+
32+
The [partition](https://paritytech.github.io/polkadot-sdk/master/pallet_broker/pallet/struct.Pallet.html#method.partition){target=\_blank} operation removes the original region and creates two new regions with the same owner and core mask. The first new region spans from the original start time to the pivot point, while the second spans from the pivot point to the original end time.
33+
34+
This is useful when you want to use part of your allocated time immediately and reserve the remainder for later use or when you want to sell or transfer only a portion of your time allocation.
35+
36+
```rust
37+
pub fn partition<T: Config>(region_id: RegionId, pivot: Timeslice)
38+
```
39+
40+
**Parameters:**
41+
42+
- **`origin`**: Must be a signed origin of the account which owns the region `region_id`.
43+
- **`region_id`**: The region which should be partitioned into two non-overlapping regions.
44+
- **`pivot`**: The offset in time into the region at which to make the split.
45+
46+
## Interlace
47+
48+
Split a bulk coretime region into two wholly-overlapping regions with complementary interlace masks. This operation allows core sharing by dividing computational resources between two projects that run simultaneously.
49+
50+
The [interlace](https://paritytech.github.io/polkadot-sdk/master/pallet_broker/pallet/struct.Pallet.html#method.interlace){target=\_blank} operation removes the original region and creates two new regions with the same time span and owner. One region receives the specified core mask, while the other receives the XOR of the specified mask and the original region's core mask.
51+
52+
Use interlacing when you want to share core resources between multiple tasks or when you need to optimize resource utilization by running complementary workloads simultaneously.
53+
54+
```rust
55+
pub fn interlace<T: Config>(region_id: RegionId, pivot: CoreMask)
56+
```
57+
58+
Parameters:
59+
60+
- **`origin`**: Must be a signed origin of the account which owns the region `region_id`.
61+
- **`region_id`**: The region which should become two interlaced regions of incomplete regularity.
62+
- **`pivot`**: The interlace mask of one of the two new regions (the other is its partial complement).
63+
64+
## Assign
65+
66+
[Assign](https://paritytech.github.io/polkadot-sdk/master/pallet_broker/pallet/struct.Pallet.html#method.assign){target=\_blank} a bulk coretime region to a specific task for execution.
67+
68+
This operation places an item in the work plan corresponding to the region's properties and assigns it to the target task. If the region's end time has already passed, the operation becomes a no-op. If the region's beginning has passed, it effectively starts from the next schedulable timeslice.
69+
70+
Use this operation to execute your tasks on the allocated cores. Choose a final assignment when you're certain about the task allocation or provisional when you might need flexibility for later changes.
71+
72+
```rust
73+
pub fn assign<T: Config>(region_id: RegionId, task: TaskId, finality: Finality)
74+
```
75+
76+
**Parameters:**
77+
78+
- **`origin`**: Must be a signed origin of the account which owns the region `region_id`.
79+
- **`region_id`**: The region which should be assigned to the task.
80+
- **`task`**: The task to assign.
81+
- **`finality`**: Indication of whether this assignment is final or provisional.
82+
83+
## Pool
84+
85+
Place a bulk coretime region into the instantaneous coretime pool to earn revenue from unused computational resources.
86+
87+
The [pool](https://paritytech.github.io/polkadot-sdk/master/pallet_broker/pallet/struct.Pallet.html#method.pool){target=\_blank} operation places the region in the workplan and assigns it to the instantaneous coretime pool. The region details are recorded to calculate a pro rata share of the instantaneous coretime sales revenue relative to other pool providers.
88+
89+
Use pooling when you have unused coretime that you want to monetize, or when you want to contribute to the network's available computational resources while earning passive income.
90+
91+
```rust
92+
pub fn pool<T: Config>(region_id: RegionId, payee: T::AccountId, finality: Finality)
93+
```
94+
95+
**Parameters:**
96+
97+
- **`origin`**: Must be a signed origin of the account which owns the region `region_id`.
98+
- **`region_id`**: The region which should be assigned to the pool.
99+
- **`payee`**: The account which can collect revenue from the usage of this region.
100+
- **`finality`**: Indication of whether this pool assignment is final or provisional.

llms.txt

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Doc-Page: https://docs.polkadot.com/develop/parachains/deployment/build-determin
2323
Doc-Page: https://docs.polkadot.com/develop/parachains/deployment/coretime-renewal/
2424
Doc-Page: https://docs.polkadot.com/develop/parachains/deployment/generate-chain-specs/
2525
Doc-Page: https://docs.polkadot.com/develop/parachains/deployment/
26+
Doc-Page: https://docs.polkadot.com/develop/parachains/deployment/manage-coretime/
2627
Doc-Page: https://docs.polkadot.com/develop/parachains/deployment/obtain-coretime/
2728
Doc-Page: https://docs.polkadot.com/develop/parachains/
2829
Doc-Page: https://docs.polkadot.com/develop/parachains/install-polkadot-sdk/
@@ -4555,6 +4556,110 @@ If you’re building a standalone blockchain (solochain) that won’t connect to
45554556
</div>
45564557
--- END CONTENT ---
45574558

4559+
Doc-Content: https://docs.polkadot.com/develop/parachains/deployment/manage-coretime/
4560+
--- BEGIN CONTENT ---
4561+
---
4562+
title: Manage Coretime
4563+
description: Learn to manage bulk coretime regions through transfer, partition, interlace, assign, and pool operations for optimal resource allocation.
4564+
---
4565+
4566+
# Manage Coretime
4567+
4568+
## Introduction
4569+
4570+
Coretime management involves manipulating [bulk coretime](/develop/parachains/deployment/obtain-coretime/#bulk-coretime){target=\_blank} regions to optimize resource allocation and usage. Regions represent allocated computational resources on cores and can be modified through various operations to meet different project requirements. This guide covers the essential operations for managing your coretime regions effectively.
4571+
4572+
## Transfer
4573+
4574+
[Transfer](https://paritytech.github.io/polkadot-sdk/master/pallet_broker/pallet/struct.Pallet.html#method.transfer){target=\_blank} ownership of a bulk coretime region to a new owner. This operation allows you to change who controls and manages a specific region.
4575+
4576+
Use this operation when you need to delegate control of computational resources to another account or when selling regions to other parties.
4577+
4578+
```rust
4579+
pub fn transfer<T: Config>(region_id: RegionId, new_owner: T::AccountId)
4580+
```
4581+
4582+
**Parameters:**
4583+
4584+
- **`origin`**: Must be a signed origin of the account which owns the region `region_id`.
4585+
- **`region_id`**: The region whose ownership should change.
4586+
- **`new_owner`**: The new owner for the region.
4587+
4588+
## Partition
4589+
4590+
Split a bulk coretime region into two non-overlapping regions at a specific time point. This operation divides a region temporally, creating two shorter regions that together span the same duration as the original.
4591+
4592+
The [partition](https://paritytech.github.io/polkadot-sdk/master/pallet_broker/pallet/struct.Pallet.html#method.partition){target=\_blank} operation removes the original region and creates two new regions with the same owner and core mask. The first new region spans from the original start time to the pivot point, while the second spans from the pivot point to the original end time.
4593+
4594+
This is useful when you want to use part of your allocated time immediately and reserve the remainder for later use or when you want to sell or transfer only a portion of your time allocation.
4595+
4596+
```rust
4597+
pub fn partition<T: Config>(region_id: RegionId, pivot: Timeslice)
4598+
```
4599+
4600+
**Parameters:**
4601+
4602+
- **`origin`**: Must be a signed origin of the account which owns the region `region_id`.
4603+
- **`region_id`**: The region which should be partitioned into two non-overlapping regions.
4604+
- **`pivot`**: The offset in time into the region at which to make the split.
4605+
4606+
## Interlace
4607+
4608+
Split a bulk coretime region into two wholly-overlapping regions with complementary interlace masks. This operation allows core sharing by dividing computational resources between two projects that run simultaneously.
4609+
4610+
The [interlace](https://paritytech.github.io/polkadot-sdk/master/pallet_broker/pallet/struct.Pallet.html#method.interlace){target=\_blank} operation removes the original region and creates two new regions with the same time span and owner. One region receives the specified core mask, while the other receives the XOR of the specified mask and the original region's core mask.
4611+
4612+
Use interlacing when you want to share core resources between multiple tasks or when you need to optimize resource utilization by running complementary workloads simultaneously.
4613+
4614+
```rust
4615+
pub fn interlace<T: Config>(region_id: RegionId, pivot: CoreMask)
4616+
```
4617+
4618+
Parameters:
4619+
4620+
- **`origin`**: Must be a signed origin of the account which owns the region `region_id`.
4621+
- **`region_id`**: The region which should become two interlaced regions of incomplete regularity.
4622+
- **`pivot`**: The interlace mask of one of the two new regions (the other is its partial complement).
4623+
4624+
## Assign
4625+
4626+
[Assign](https://paritytech.github.io/polkadot-sdk/master/pallet_broker/pallet/struct.Pallet.html#method.assign){target=\_blank} a bulk coretime region to a specific task for execution.
4627+
4628+
This operation places an item in the work plan corresponding to the region's properties and assigns it to the target task. If the region's end time has already passed, the operation becomes a no-op. If the region's beginning has passed, it effectively starts from the next schedulable timeslice.
4629+
4630+
Use this operation to execute your tasks on the allocated cores. Choose a final assignment when you're certain about the task allocation or provisional when you might need flexibility for later changes.
4631+
4632+
```rust
4633+
pub fn assign<T: Config>(region_id: RegionId, task: TaskId, finality: Finality)
4634+
```
4635+
4636+
**Parameters:**
4637+
4638+
- **`origin`**: Must be a signed origin of the account which owns the region `region_id`.
4639+
- **`region_id`**: The region which should be assigned to the task.
4640+
- **`task`**: The task to assign.
4641+
- **`finality`**: Indication of whether this assignment is final or provisional.
4642+
4643+
## Pool
4644+
4645+
Place a bulk coretime region into the instantaneous coretime pool to earn revenue from unused computational resources.
4646+
4647+
The [pool](https://paritytech.github.io/polkadot-sdk/master/pallet_broker/pallet/struct.Pallet.html#method.pool){target=\_blank} operation places the region in the workplan and assigns it to the instantaneous coretime pool. The region details are recorded to calculate a pro rata share of the instantaneous coretime sales revenue relative to other pool providers.
4648+
4649+
Use pooling when you have unused coretime that you want to monetize, or when you want to contribute to the network's available computational resources while earning passive income.
4650+
4651+
```rust
4652+
pub fn pool<T: Config>(region_id: RegionId, payee: T::AccountId, finality: Finality)
4653+
```
4654+
4655+
**Parameters:**
4656+
4657+
- **`origin`**: Must be a signed origin of the account which owns the region `region_id`.
4658+
- **`region_id`**: The region which should be assigned to the pool.
4659+
- **`payee`**: The account which can collect revenue from the usage of this region.
4660+
- **`finality`**: Indication of whether this pool assignment is final or provisional.
4661+
--- END CONTENT ---
4662+
45584663
Doc-Content: https://docs.polkadot.com/develop/parachains/deployment/obtain-coretime/
45594664
--- BEGIN CONTENT ---
45604665
---

0 commit comments

Comments
 (0)