Documentation ¶
Index ¶
- Variables
- func Aggregate(atts []*ethpb.Attestation) ([]*ethpb.Attestation, error)
- func AggregatePair(a1 *ethpb.Attestation, a2 *ethpb.Attestation) (*ethpb.Attestation, error)
- func MaxCoverAttestationAggregation(atts []*ethpb.Attestation) ([]*ethpb.Attestation, error)
- func NaiveAttestationAggregation(atts []*ethpb.Attestation) ([]*ethpb.Attestation, error)
- func NewMaxCover(atts []*ethpb.Attestation) (*aggregation.MaxCoverProblem, error)
- type AttestationAggregationStrategy
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidAttestationCount = errors.New("invalid number of attestations")
ErrInvalidAttestationCount is returned when insufficient number of attestations is provided for aggregation.
Functions ¶
func Aggregate ¶
func Aggregate(atts []*ethpb.Attestation) ([]*ethpb.Attestation, error)
Aggregate aggregates attestations. The minimal number of attestations is returned.
func AggregatePair ¶
func AggregatePair(a1 *ethpb.Attestation, a2 *ethpb.Attestation) (*ethpb.Attestation, error)
AggregatePair aggregates pair of attestations a1 and a2 together.
func MaxCoverAttestationAggregation ¶
func MaxCoverAttestationAggregation(atts []*ethpb.Attestation) ([]*ethpb.Attestation, error)
MaxCoverAttestationAggregation relies on Maximum Coverage greedy algorithm for aggregation. Aggregation occurs in many rounds, up until no more aggregation is possible (all attestations are overlapping).
func NaiveAttestationAggregation ¶
func NaiveAttestationAggregation(atts []*ethpb.Attestation) ([]*ethpb.Attestation, error)
NaiveAttestationAggregation aggregates naively, without any complex algorithms or optimizations. Note: this is currently a naive implementation to the order of O(mn^2).
func NewMaxCover ¶
func NewMaxCover(atts []*ethpb.Attestation) (*aggregation.MaxCoverProblem, error)
NewMaxCover returns initialized Maximum Coverage problem for attestations aggregation.
Types ¶
type AttestationAggregationStrategy ¶
type AttestationAggregationStrategy string
AttestationAggregationStrategy defines attestation aggregation strategy.
const ( // NaiveAggregation is an aggregation strategy without any optimizations. NaiveAggregation AttestationAggregationStrategy = "naive" // MaxCoverAggregation is a strategy based on Maximum Coverage greedy algorithm. MaxCoverAggregation AttestationAggregationStrategy = "max_cover" )