mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-12 20:50:05 +00:00
Pre-allocate slices when reporting validator performance (#4979)
This commit is contained in:
parent
5cb51263b0
commit
044d72064f
@ -584,15 +584,16 @@ func (bs *Server) GetValidatorPerformance(
|
||||
) (*ethpb.ValidatorPerformanceResponse, error) {
|
||||
validatorSummary := state.ValidatorSummary
|
||||
|
||||
beforeTransitionBalances := make([]uint64, 0)
|
||||
afterTransitionBalances := make([]uint64, 0)
|
||||
effectiveBalances := make([]uint64, 0)
|
||||
inclusionSlots := make([]uint64, 0)
|
||||
inclusionDistances := make([]uint64, 0)
|
||||
correctlyVotedSource := make([]bool, 0)
|
||||
correctlyVotedTarget := make([]bool, 0)
|
||||
correctlyVotedHead := make([]bool, 0)
|
||||
missingValidators := make([][]byte, 0)
|
||||
reqPubKeysCount := len(req.PublicKeys)
|
||||
beforeTransitionBalances := make([]uint64, 0, reqPubKeysCount)
|
||||
afterTransitionBalances := make([]uint64, 0, reqPubKeysCount)
|
||||
effectiveBalances := make([]uint64, 0, reqPubKeysCount)
|
||||
inclusionSlots := make([]uint64, 0, reqPubKeysCount)
|
||||
inclusionDistances := make([]uint64, 0, reqPubKeysCount)
|
||||
correctlyVotedSource := make([]bool, 0, reqPubKeysCount)
|
||||
correctlyVotedTarget := make([]bool, 0, reqPubKeysCount)
|
||||
correctlyVotedHead := make([]bool, 0, reqPubKeysCount)
|
||||
missingValidators := make([][]byte, 0, reqPubKeysCount)
|
||||
|
||||
// Convert the list of validator public keys to list of validator indices.
|
||||
// Also track missing validators using public keys.
|
||||
|
Loading…
Reference in New Issue
Block a user