Categories
Getting Started

What are Epochs?

An epoch in SafeCoin terms is 432,000 slots (blocks) each of which aim for 400ms each. It works out at just over 2 days as not all blocks will be 400ms, that is the optimium target.

432,000 slots x 0.4s = 172,800 seconds / 3600 = 48 hours

Epochs are important as they signify the reward periods. At the end of each epoch rewards are paid out and more activating stake becomes active.

To find information about the current epoch

$ ~/Safecoin/target/release/safecoin epoch-info

Block height: 7106491
Slot: 7124293
Epoch: 16
Transaction Count: 12952282
Epoch Slot Range: [6912000..7344000)
Epoch Completed Percent: 49.142%
Epoch Completed Slots: 212293/432000 (219707 remaining)
Epoch Completed Time: 23h 35m 17s 200ms/2days (1day 24m 42s 800ms remaining)

A Word on Epochs
Staking-related updates in SafeCoin happen at epoch boundaries. An epoch is the length of a certain amount of blocks (in SafeCoin: “slots”) in which the validator schedule of SafeCoin’s consensus algorithm is defined.

To stakers this means that beginning and stopping to stake, as well as reward distribution, always happen when epochs switch over. An epoch is 432,000 slots, each of which should at a minimum take 400ms. Since block times are variable this means epochs effectively last somewhere between 2–3 days.