diff --git a/hmy/staking.go b/hmy/staking.go index fe6ff58b6..792737300 100644 --- a/hmy/staking.go +++ b/hmy/staking.go @@ -326,12 +326,12 @@ func (hmy *Harmony) GetValidatorInformation( lastBlockOfEpoch := shard.Schedule.EpochLastBlock(hmy.BeaconChain.CurrentBlock().Header().Epoch().Uint64()) computed.BlocksLeftInEpoch = lastBlockOfEpoch - hmy.BeaconChain.CurrentBlock().Header().Number().Uint64() - computed.Block = hmy.BeaconChain.CurrentBlock().Header().Number().Uint64() - computed.Epoch = hmy.BeaconChain.CurrentBlock().Header().Epoch().Uint64() if defaultReply.CurrentlyInCommittee { defaultReply.Performance = &staking.CurrentEpochPerformance{ CurrentSigningPercentage: *computed, + Epoch: hmy.BeaconChain.CurrentBlock().Header().Number().Uint64(), + Block: hmy.BeaconChain.CurrentBlock().Header().Epoch().Uint64(), } } diff --git a/staking/availability/measure.go b/staking/availability/measure.go index 5e4c795eb..d79181c32 100644 --- a/staking/availability/measure.go +++ b/staking/availability/measure.go @@ -143,7 +143,7 @@ func ComputeCurrentSigning( new(big.Int).Sub(statsNow.NumBlocksToSign, snapToSign) computed := staking.NewComputed( - signed, toSign, 0, numeric.ZeroDec(), true, 0, 0, + signed, toSign, 0, numeric.ZeroDec(), true, ) if toSign.Cmp(common.Big0) == 0 { diff --git a/staking/types/validator.go b/staking/types/validator.go index 58b4f3564..91245a2be 100644 --- a/staking/types/validator.go +++ b/staking/types/validator.go @@ -109,8 +109,6 @@ type Computed struct { BlocksLeftInEpoch uint64 `json:"-"` Percentage numeric.Dec `json:"current-epoch-signing-percentage"` IsBelowThreshold bool `json:"-"` - Epoch uint64 `json:"epoch"` - Block uint64 `json:"block"` } func (c Computed) String() string { @@ -123,10 +121,8 @@ func NewComputed( signed, toSign *big.Int, blocksLeft uint64, percent numeric.Dec, - isBelowNow bool, - epoch uint64, - block uint64) *Computed { - return &Computed{signed, toSign, blocksLeft, percent, isBelowNow, epoch, block} + isBelowNow bool) *Computed { + return &Computed{signed, toSign, blocksLeft, percent, isBelowNow} } // NewEmptyStats .. @@ -143,6 +139,8 @@ func NewEmptyStats() *ValidatorStats { // whatever current epoch is type CurrentEpochPerformance struct { CurrentSigningPercentage Computed `json:"current-epoch-signing-percent"` + Epoch uint64 `json:"epoch"` + Block uint64 `json:"block"` } // ValidatorRPCEnhanced contains extra information for RPC consumer