attester

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Duty

type Duty struct {
	// contains filtered or unexported fields
}

Duty contains information about beacon block attester duties for a given slot.

func MergeDuties

func MergeDuties(ctx context.Context, attesterDuties []*api.AttesterDuty) ([]*Duty, error)

MergeDuties merges attester duties given by an Ethereum 2 client into vouch's per-slot structure.

func NewDuty

func NewDuty(ctx context.Context,
	slot spec.Slot,
	committeesAtSlot uint64,
	validatorIndices []spec.ValidatorIndex,
	committeeIndices []spec.CommitteeIndex,
	validatorCommitteeIndices []uint64,
	committeeLengths map[spec.CommitteeIndex]uint64,
) (*Duty, error)

NewDuty creates a new beacon block attester duty.

func (*Duty) CommitteeIndices

func (d *Duty) CommitteeIndices() []spec.CommitteeIndex

CommitteeIndices provides the committee indices for the beacon block attester.

func (*Duty) CommitteeSize

func (d *Duty) CommitteeSize(committeeIndex spec.CommitteeIndex) uint64

CommitteeSize provides the committee size for a given index.

func (*Duty) CommitteesAtSlot added in v0.9.0

func (d *Duty) CommitteesAtSlot() uint64

CommitteesAtSlot provides the number of committees at the duty's slot.

func (*Duty) Slot

func (d *Duty) Slot() spec.Slot

Slot provides the slot for the beacon block attester.

func (*Duty) String

func (d *Duty) String() string

String provides a friendly string for the struct's main details.

func (*Duty) Tuples added in v0.9.0

func (d *Duty) Tuples() []string

Tuples returns a slice of (validator index, committee index, validator position in committee) strings. Useful for logging the

func (*Duty) ValidatorCommitteeIndices

func (d *Duty) ValidatorCommitteeIndices() []uint64

ValidatorCommitteeIndices provides the indices of validators within committees for the beacon block attester.

func (*Duty) ValidatorIndices

func (d *Duty) ValidatorIndices() []spec.ValidatorIndex

ValidatorIndices provides the validator indices for the beacon block attester.

type Service

type Service interface {
	// Attest carries out attestations for a slot.
	// It returns a list of attestations made.
	Attest(ctx context.Context, details interface{}) ([]*spec.Attestation, error)
}

Service is the beacon block attester service.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL