Blocks & Epochs
Whenever a delegator votes for a validator, they immediately contribute to the modification of the total delegated amount. Effectively, they also modify the share distribution between all delegators. It makes share computation very complicated and requires dynamic re-calculation of the shares for each reward distribution. This may make the entire rewards distribution process very expensive. Since we are running the staking and reward distribution models fully on-chain, we aim to realize all the computations to be optimized in smart contracts. To reach this goal, we split the staking process into epochs so that gas consumption can be reduced significantly.
β€’ An epoch is an interval with
NN
blocks inside.
β€’ An epoch length can be equal to just one block. However, it can significantly increase storage size and bring no benefit.
β€’ The average time for a block producing is 3 seconds, and 28800 (=24*60*60/3) blocks are expected to be daily produced.
B2 Sidechain will use the epoch size of 1 day. 1-day epoch allows spending only 1.7 million gas units a year per single user. Since the block size is around 80 million gas units, a delegator has ~40-50 years to claim their rewards before those can become unclaimable.
Copy link