prysm-pulse/proto/prysm/v1alpha1/attestation/aggregation/aggregation.go
terence tsao 2ba29a3cfc
Move block and attestation to proto v1alpha1 folder (#9618)
* Add block and attestation to container pkg

* Move aggregation into attestation

* Update attestation_test.go

* Move them to proto

* Gazelle

* fix cycle

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-09-20 16:17:03 +00:00

28 lines
832 B
Go

// Package aggregation contains implementations of bitlist aggregation algorithms and heuristics.
package aggregation
import (
"errors"
"github.com/prysmaticlabs/go-bitfield"
"github.com/sirupsen/logrus"
)
var _ = logrus.WithField("prefix", "aggregation")
var (
// ErrBitsOverlap is returned when two bitlists overlap with each other.
ErrBitsOverlap = errors.New("overlapping aggregation bits")
// ErrInvalidStrategy is returned when invalid aggregation strategy is selected.
ErrInvalidStrategy = errors.New("invalid aggregation strategy")
)
// Aggregation defines the bitlist aggregation problem solution.
type Aggregation struct {
// Coverage represents the best available solution to bitlist aggregation.
Coverage bitfield.Bitlist
// Keys is a list of candidate keys in the best available solution.
Keys []int
}