This repository intends to calculate, given an estimated block height for the start of coretime sales, until when each paraID will have a core on the relay chain.
- Clone this repository
- Install dependencies with
npm install
- Run the project
- For Polkadot: [not available yet]
- For Kusama:
npm run start
ornpm run start chain=kusama
Coretime sale cycles are dictated by the region length, given by the amount of timeslices in a region and the amount of blocks on a timeslice.
region_length = 5040 timeslice
timeslice = 80 blocks
At the same time, coretime sales are set to start at a specific block height. So sale1
will start at block_height = X
, and sale2
will start at block_height = X+region_length
.
If the objective is to calculate at which block height does a specific n
sale start, then the above can be represented as:
saleBlock = CORETIME_SALES_START + (region_length * timeslice) * (n-1)
where:
- CORETIME_SALES_START is the time at which the first sale starts
- region_length is the length in timeslices of a region
- timeslice is the number of blocks on a timeslice
- n is the targeted sale
Currently each parachain on Polkadot has a slot measured in Lease Periods. Therefore there needs to be a translation from the current Lease Periods to the intended coretime sale cycles.
The coretime migration code is designed to allow teams to have a core until the next available sale start. So if a specific lease period ends at block X which is between sales Y and Z (with Z > Y), then this team will have a core assigned until sales at block Z start, and will have to renew during the sales at block Y.
This has been the basis of the calculation of this tool.
The output of the tool looks something like this:
{
paraID: 2084,
name: 'Calamari',
coreUntilBlock: 23160700,
renewCoreAtSaleNumber: 1
},
Each paraID that has a slot on Kusama and/or Polkadot will be represented in this list. The output shows until which block the paraID has a core (coreUntilBlock
) and at which coretime sale the paraID has to renew its core.
In this case, paraID 2084 will have a core until block 23_160_700, however will have to renew this core during sale cycle 1.
IMPORTANT
โ ๏ธ This tool has a fixed estimated time of coretime sales here. If need be, change this number accordingly when using it.