Documentation ¶
Index ¶
- Variables
- func Aggregate(atts []*zondpb.Attestation) ([]*zondpb.Attestation, error)
- func AggregateDisjointOneBitAtts(atts []*zondpb.Attestation) (*zondpb.Attestation, error)
- func AggregatePair(a1, a2 *zondpb.Attestation) (*zondpb.Attestation, error)
- func MaxCoverAttestationAggregation(atts []*zondpb.Attestation) ([]*zondpb.Attestation, error)
- func NewMaxCover(atts []*zondpb.Attestation) *aggregation.MaxCoverProblem
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 []*zondpb.Attestation) ([]*zondpb.Attestation, error)
Aggregate aggregates attestations. The minimal number of attestations is returned. Aggregation occurs in-place i.e. contents of input array will be modified. Should you need to preserve input attestations, clone them before aggregating:
clonedAtts := make([]*zondpb.Attestation, len(atts)) for i, a := range atts { clonedAtts[i] = stateTrie.CopyAttestation(a) } aggregatedAtts, err := attaggregation.Aggregate(clonedAtts)
func AggregateDisjointOneBitAtts ¶
func AggregateDisjointOneBitAtts(atts []*zondpb.Attestation) (*zondpb.Attestation, error)
AggregateDisjointOneBitAtts aggregates unaggregated attestations with the exact same attestation data.
func AggregatePair ¶
func AggregatePair(a1, a2 *zondpb.Attestation) (*zondpb.Attestation, error)
AggregatePair aggregates pair of attestations a1 and a2 together.
func MaxCoverAttestationAggregation ¶
func MaxCoverAttestationAggregation(atts []*zondpb.Attestation) ([]*zondpb.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). See https://hackmd.io/@farazdagi/in-place-attagg for design and rationale.
func NewMaxCover ¶
func NewMaxCover(atts []*zondpb.Attestation) *aggregation.MaxCoverProblem
NewMaxCover returns initialized Maximum Coverage problem for attestations aggregation.
Types ¶
This section is empty.