attester

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 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(_ context.Context,
	slot phase0.Slot,
	committeesAtSlot uint64,
	validatorIndices []phase0.ValidatorIndex,
	committeeIndices []phase0.CommitteeIndex,
	validatorCommitteeIndices []uint64,
	committeeLengths map[phase0.CommitteeIndex]uint64,
) (*Duty, error)

NewDuty creates a new beacon block attester duty.

func (*Duty) CommitteeIndices

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

CommitteeIndices provides the committee indices for the beacon block attester.

func (*Duty) CommitteeSize

func (d *Duty) CommitteeSize(committeeIndex phase0.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() phase0.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.

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() []phase0.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{}) ([]*phase0.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