Skip to content

Commit

Permalink
fix deposit index metrics (#8315)
Browse files Browse the repository at this point in the history
  • Loading branch information
nisdas authored Jan 22, 2021
1 parent 33e2663 commit 50e5b1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions beacon-chain/powchain/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 {
Expand Down

0 comments on commit 50e5b1b

Please sign in to comment.