Documentation
¶
Index ¶
- type Aggregate
- type Assignment
- type AttRef
- type AttSearchOption
- type AttestationPool
- func (ap *AttestationPool) AddAttestation(ctx context.Context, att *phase0.Attestation, ...) error
- func (ap *AttestationPool) Packing(ctx context.Context, source common.Checkpoint, target common.Checkpoint, ...) ([]phase0.Attestation, error)
- func (ap *AttestationPool) Prune(epoch common.Epoch)
- func (ap *AttestationPool) Search(opts ...AttSearchOption) (out []*phase0.Attestation)
- type AttesterSlashingPool
- type IndexedAttData
- type MinAggregates
- type ProposerSlashingPool
- type SubnetContrib
- type SyncCommitteeContributions
- type SyncCommitteeMessages
- type SyncCommitteePool
- func (sp *SyncCommitteePool) AddSyncCommitteeContribution(ctx context.Context, contrib *altair.SyncCommitteeContribution) error
- func (sp *SyncCommitteePool) AddSyncCommitteeMessage(ctx context.Context, msg *altair.SyncCommitteeMessage) error
- func (sp *SyncCommitteePool) PackAggregate(ctx context.Context, slot common.Slot, beaconBlockRoot common.Root, ...) (*altair.SyncAggregate, error)
- func (sp *SyncCommitteePool) PackContribution(ctx context.Context, slot common.Slot, beaconBlockRoot common.Root, ...) (*altair.SyncCommitteeContribution, error)
- func (sp *SyncCommitteePool) Reset(slot common.Slot)
- type VoluntaryExitPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregate ¶
type Aggregate struct {
Participants phase0.AttestationBits
Sig common.BLSSignature
}
type Assignment ¶
type Assignment struct {
Index common.ValidatorIndex
Epoch common.Epoch
}
type AttSearchOption ¶
type AttSearchOption func(a *attSearch)
func WithCommittee ¶
func WithCommittee(index common.CommitteeIndex) AttSearchOption
func WithSlot ¶
func WithSlot(slot common.Slot) AttSearchOption
type AttestationPool ¶
func NewAttestationPool ¶
func NewAttestationPool(spec *common.Spec) *AttestationPool
func (*AttestationPool) AddAttestation ¶
func (ap *AttestationPool) AddAttestation(ctx context.Context, att *phase0.Attestation, committee common.CommitteeIndices) error
func (*AttestationPool) Packing ¶
func (ap *AttestationPool) Packing(ctx context.Context, source common.Checkpoint, target common.Checkpoint, headRoot common.Root, headSlot common.Slot, maxCount uint64, maxTime time.Duration, included func(epoch common.Epoch, index common.ValidatorIndex)) ([]phase0.Attestation, error)
Approximation of the optimal attestation packing. Attestations must match source, get prioritized if the target is correct, and more if the head is correct. Attestations may not be included if they already are (checked via included func). Maximum attestation output and packing-time constraints apply.
func (*AttestationPool) Prune ¶
func (ap *AttestationPool) Prune(epoch common.Epoch)
Prune pool based on current epoch, attestations which cannot be included anymore will get pruned.
func (*AttestationPool) Search ¶
func (ap *AttestationPool) Search(opts ...AttSearchOption) (out []*phase0.Attestation)
type AttesterSlashingPool ¶
func NewAttesterSlashingPool ¶
func NewAttesterSlashingPool(spec *common.Spec) *AttesterSlashingPool
func (*AttesterSlashingPool) AddAttesterSlashing ¶
func (asp *AttesterSlashingPool) AddAttesterSlashing(ctx context.Context, sl *phase0.AttesterSlashing) error
This does not filter slashings that are a subset of other slashings. The pool merely collects them. Make sure to protect against spam elsewhere as a caller.
func (*AttesterSlashingPool) All ¶
func (asp *AttesterSlashingPool) All() []*phase0.AttesterSlashing
func (*AttesterSlashingPool) Pack ¶ added in v0.16.0
func (asp *AttesterSlashingPool) Pack(estReward func(sl *phase0.AttesterSlashing) int, n uint) []*phase0.AttesterSlashing
Pack n slashings, removes the slashings from the pool. A reward estimator is used to pick the best slashings. Slashings with negative rewards will not be packed.
type IndexedAttData ¶
type IndexedAttData struct {
Data phase0.AttestationData
Committee common.CommitteeIndices
}
type MinAggregates ¶
type MinAggregates struct {
Aggregates []Aggregate
// The OR of all bitfields contained in Aggregates list, to easily filter out subsets
Participants phase0.AttestationBits
// Things already covered by the sum of the above aggregates, but maybe useful later. Keep a limited number of these.
Extra []Aggregate
}
type ProposerSlashingPool ¶
func NewProposerSlashingPool ¶
func NewProposerSlashingPool(spec *common.Spec) *ProposerSlashingPool
func (*ProposerSlashingPool) AddProposerSlashing ¶
func (psp *ProposerSlashingPool) AddProposerSlashing(ctx context.Context, sl *phase0.ProposerSlashing) error
func (*ProposerSlashingPool) All ¶ added in v0.16.0
func (psp *ProposerSlashingPool) All() []*phase0.ProposerSlashing
func (*ProposerSlashingPool) Pack ¶ added in v0.16.0
func (psp *ProposerSlashingPool) Pack(estReward func(sl *phase0.ProposerSlashing) int, n uint) []*phase0.ProposerSlashing
Pack n slashings, removes the slashings from the pool. A reward estimator is used to pick the best slashings. Slashings with negative rewards will not be packed.
type SubnetContrib ¶ added in v0.27.0
type SubnetContrib struct {
// A bit is set if a signature from the validator at the corresponding
// index in the subcommittee is present in the aggregate `signature`.
AggregationBits altair.SyncCommitteeSubnetBits
// Signature by the validator(s) over the block root of `slot`
Signature common.BLSSignature
}
type SyncCommitteeContributions ¶ added in v0.27.0
type SyncCommitteeContributions map[common.Root]map[uint64][]*SubnetContrib
beacon root -> subnet -> contributions
type SyncCommitteeMessages ¶ added in v0.27.0
type SyncCommitteeMessages map[common.ValidatorIndex]*altair.SyncCommitteeMessage
func (SyncCommitteeMessages) Select ¶ added in v0.27.0
func (msgs SyncCommitteeMessages) Select(root common.Root, members []common.ValidatorIndex) []*altair.SyncCommitteeMessage
type SyncCommitteePool ¶ added in v0.27.0
SyncCommitteePool is a very short lived buffer: - The sync committee messages of the previous, current and next slot are buffered - The sync committee contributions (subnet aggregates) of the previous, current and next slot are buffered - As soon as a slot is done, Reset(slot) should be called to transition to a new slot, rotating out buffers. - Nothing is aggregated ahead of time; packing work is avoided if we are not selected as aggregator - At any time the validator can run PackAggregate and PackContribution for the approximate current slot (previous/current/next slot accepted) and beacon block root.
func NewSyncCommitteePool ¶ added in v0.27.0
func NewSyncCommitteePool(spec *common.Spec) *SyncCommitteePool
func (*SyncCommitteePool) AddSyncCommitteeContribution ¶ added in v0.27.0
func (sp *SyncCommitteePool) AddSyncCommitteeContribution(ctx context.Context, contrib *altair.SyncCommitteeContribution) error
func (*SyncCommitteePool) AddSyncCommitteeMessage ¶ added in v0.27.0
func (sp *SyncCommitteePool) AddSyncCommitteeMessage(ctx context.Context, msg *altair.SyncCommitteeMessage) error
func (*SyncCommitteePool) PackAggregate ¶ added in v0.27.0
func (sp *SyncCommitteePool) PackAggregate(ctx context.Context, slot common.Slot, beaconBlockRoot common.Root, syncCommittee []common.ValidatorIndex) (*altair.SyncAggregate, error)
func (*SyncCommitteePool) PackContribution ¶ added in v0.27.0
func (sp *SyncCommitteePool) PackContribution(ctx context.Context, slot common.Slot, beaconBlockRoot common.Root, subnet uint64, subComm []common.ValidatorIndex) (*altair.SyncCommitteeContribution, error)
func (*SyncCommitteePool) Reset ¶ added in v0.27.0
func (sp *SyncCommitteePool) Reset(slot common.Slot)
type VoluntaryExitPool ¶
func NewVoluntaryExitPool ¶
func NewVoluntaryExitPool(spec *common.Spec) *VoluntaryExitPool
func (*VoluntaryExitPool) AddVoluntaryExit ¶
func (vep *VoluntaryExitPool) AddVoluntaryExit(ctx context.Context, exit *phase0.SignedVoluntaryExit) error
func (*VoluntaryExitPool) All ¶ added in v0.16.0
func (vep *VoluntaryExitPool) All() []*phase0.SignedVoluntaryExit
func (*VoluntaryExitPool) Pack ¶ added in v0.16.0
func (vep *VoluntaryExitPool) Pack(rank func(sl *phase0.SignedVoluntaryExit) int, n uint) []*phase0.SignedVoluntaryExit
Pack n exits, removes the exits from the pool. A ranking function is used to pick the best exits. Exits with negative rank function outputs will not be packed.