From 50e5b1b4f586bb6d12194f01b223ccbe71b43535 Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Fri, 22 Jan 2021 19:11:02 +0800 Subject: [PATCH] fix deposit index metrics (#8315) --- beacon-chain/powchain/service.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beacon-chain/powchain/service.go b/beacon-chain/powchain/service.go index 6fc4b99038f5..4d1ab8aaf976 100644 --- a/beacon-chain/powchain/service.go +++ b/beacon-chain/powchain/service.go @@ -562,7 +562,7 @@ func (s *Service) initDepositCaches(ctx context.Context, ctrs []*protodb.Deposit if !s.chainStartData.Chainstarted { // do not add to pending cache // if no genesis state exists. - validDepositsCount.Add(float64(s.preGenesisState.Eth1DepositIndex() + 1)) + validDepositsCount.Add(float64(s.preGenesisState.Eth1DepositIndex())) return nil } genesisState, err := s.beaconDB.GenesisState(ctx) @@ -588,7 +588,7 @@ func (s *Service) initDepositCaches(ctx context.Context, ctrs []*protodb.Deposit // Set deposit index to the one in the current archived state. currIndex = fState.Eth1DepositIndex() } - validDepositsCount.Add(float64(currIndex + 1)) + validDepositsCount.Add(float64(currIndex)) // Only add pending deposits if the container slice length // is more than the current index in state. if uint64(len(ctrs)) > currIndex {