Skip to content

Commit

Permalink
Block validator buckets (#8395)
Browse files Browse the repository at this point in the history
* Block validator buckets

* add more buckets to blocked collector list

Co-authored-by: rauljordan <raul@prysmaticlabs.com>
  • Loading branch information
terencechain and rauljordan authored Feb 4, 2021
1 parent c97ea76 commit cf88afb
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion validator/db/kv/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ var (
ProtectionDbFileName = "validator.db"
)

// blockedBuckets represents the buckets that we want to restrict
// from our metrics fetching for performance reasons. For a detailed
// summary, it can be read in https://github.com/prysmaticlabs/prysm/issues/8274.
var blockedBuckets = [][]byte{
deprecatedAttestationHistoryBucket,
lowestSignedSourceBucket,
lowestSignedTargetBucket,
lowestSignedProposalsBucket,
highestSignedProposalsBucket,
pubKeysBucket,
attestationSigningRootsBucket,
attestationSourceEpochsBucket,
}

// Store defines an implementation of the Prysm Database interface
// using BoltDB as the underlying persistent kv-store for eth2.
type Store struct {
Expand Down Expand Up @@ -171,5 +185,5 @@ func (s *Store) Size() (int64, error) {

// createBoltCollector returns a prometheus collector specifically configured for boltdb.
func createBoltCollector(db *bolt.DB) prometheus.Collector {
return prombolt.New("boltDB", db)
return prombolt.New("boltDB", db, blockedBuckets...)
}

0 comments on commit cf88afb

Please sign in to comment.