|
|
@ -66,6 +66,11 @@ func (hmy *Harmony) readAndUpdateRawStakes( |
|
|
|
|
|
|
|
|
|
|
|
func (hmy *Harmony) getSuperCommittees() (*quorum.Transition, error) { |
|
|
|
func (hmy *Harmony) getSuperCommittees() (*quorum.Transition, error) { |
|
|
|
nowE := hmy.BlockChain.CurrentHeader().Epoch() |
|
|
|
nowE := hmy.BlockChain.CurrentHeader().Epoch() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if hmy.BlockChain.CurrentHeader().IsLastBlockInEpoch() { |
|
|
|
|
|
|
|
// current epoch is current header epoch + 1 if the header was last block of prev epoch
|
|
|
|
|
|
|
|
nowE = new(big.Int).Add(nowE, common.Big1) |
|
|
|
|
|
|
|
} |
|
|
|
thenE := new(big.Int).Sub(nowE, common.Big1) |
|
|
|
thenE := new(big.Int).Sub(nowE, common.Big1) |
|
|
|
|
|
|
|
|
|
|
|
var ( |
|
|
|
var ( |
|
|
@ -86,8 +91,8 @@ func (hmy *Harmony) getSuperCommittees() (*quorum.Transition, error) { |
|
|
|
shard.ExternalSlotsAvailableForEpoch(thenE) |
|
|
|
shard.ExternalSlotsAvailableForEpoch(thenE) |
|
|
|
|
|
|
|
|
|
|
|
then, now := |
|
|
|
then, now := |
|
|
|
quorum.NewRegistry(stakedSlotsThen), |
|
|
|
quorum.NewRegistry(stakedSlotsThen, int(thenE.Int64())), |
|
|
|
quorum.NewRegistry(stakedSlotsNow) |
|
|
|
quorum.NewRegistry(stakedSlotsNow, int(nowE.Int64())) |
|
|
|
|
|
|
|
|
|
|
|
rawStakes := []effective.SlotPurchase{} |
|
|
|
rawStakes := []effective.SlotPurchase{} |
|
|
|
validatorSpreads := map[common.Address]numeric.Dec{} |
|
|
|
validatorSpreads := map[common.Address]numeric.Dec{} |
|
|
|