github.com/prysmaticlabs/prysm@v1.4.4/shared/aggregation/aggregation.go (about) 1 // Package aggregation contains implementations of bitlist aggregation algorithms and heuristics. 2 package aggregation 3 4 import ( 5 "errors" 6 7 "github.com/prysmaticlabs/go-bitfield" 8 "github.com/sirupsen/logrus" 9 ) 10 11 var _ = logrus.WithField("prefix", "aggregation") 12 13 var ( 14 // ErrBitsOverlap is returned when two bitlists overlap with each other. 15 ErrBitsOverlap = errors.New("overlapping aggregation bits") 16 17 // ErrInvalidStrategy is returned when invalid aggregation strategy is selected. 18 ErrInvalidStrategy = errors.New("invalid aggregation strategy") 19 ) 20 21 // Aggregation defines the bitlist aggregation problem solution. 22 type Aggregation struct { 23 // Coverage represents the best available solution to bitlist aggregation. 24 Coverage bitfield.Bitlist 25 // Keys is a list of candidate keys in the best available solution. 26 Keys []int 27 }