|
|
@ -146,15 +146,6 @@ func prepareOrders( |
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
validatorStake := big.NewInt(0) |
|
|
|
|
|
|
|
for i := range validator.Delegations { |
|
|
|
|
|
|
|
validatorStake.Add( |
|
|
|
|
|
|
|
validatorStake, validator.Delegations[i].Amount, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
totalStaked.Add(totalStaked, validatorStake) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
found := false |
|
|
|
found := false |
|
|
|
for _, key := range validator.SlotPubKeys { |
|
|
|
for _, key := range validator.SlotPubKeys { |
|
|
|
if _, ok := blsKeys[key]; ok { |
|
|
|
if _, ok := blsKeys[key]; ok { |
|
|
@ -168,6 +159,15 @@ func prepareOrders( |
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
validatorStake := big.NewInt(0) |
|
|
|
|
|
|
|
for i := range validator.Delegations { |
|
|
|
|
|
|
|
validatorStake.Add( |
|
|
|
|
|
|
|
validatorStake, validator.Delegations[i].Amount, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
totalStaked.Add(totalStaked, validatorStake) |
|
|
|
|
|
|
|
|
|
|
|
essentials[validator.Address] = &effective.SlotOrder{ |
|
|
|
essentials[validator.Address] = &effective.SlotOrder{ |
|
|
|
validatorStake, |
|
|
|
validatorStake, |
|
|
|
validator.SlotPubKeys, |
|
|
|
validator.SlotPubKeys, |
|
|
@ -240,6 +240,7 @@ var ( |
|
|
|
ErrComputeForEpochInPast = errors.New("cannot compute for epoch in past") |
|
|
|
ErrComputeForEpochInPast = errors.New("cannot compute for epoch in past") |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// This is the shard state computation logic before staking epoch.
|
|
|
|
func preStakingEnabledCommittee(s shardingconfig.Instance) *shard.State { |
|
|
|
func preStakingEnabledCommittee(s shardingconfig.Instance) *shard.State { |
|
|
|
shardNum := int(s.NumShards()) |
|
|
|
shardNum := int(s.NumShards()) |
|
|
|
shardHarmonyNodes := s.NumHarmonyOperatedNodesPerShard() |
|
|
|
shardHarmonyNodes := s.NumHarmonyOperatedNodesPerShard() |
|
|
|