attestations

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AttestationDataAndCustodyBitSSZ = zssz.GetSSZ((*AttestationDataAndCustodyBit)(nil))
View Source
var AttestationSSZ = zssz.GetSSZ((*Attestation)(nil))

Functions

This section is empty.

Types

type Attestation

type Attestation struct {
	AggregationBits CommitteeBits
	Data            AttestationData
	CustodyBits     CommitteeBits
	Signature       BLSSignature
}

func (*Attestation) ConvertToIndexed

func (attestation *Attestation) ConvertToIndexed(committee []ValidatorIndex) (*IndexedAttestation, error)

Convert attestation to (almost) indexed-verifiable form

type AttestationData

type AttestationData struct {
	// LMD GHOST vote
	BeaconBlockRoot Root

	// FFG vote
	Source Checkpoint
	Target Checkpoint

	// Crosslink vote
	Crosslink Crosslink
}

func (*AttestationData) GetAttestationSlot

func (attData *AttestationData) GetAttestationSlot(m AttestationSlotMeta) Slot

type AttestationDataAndCustodyBit

type AttestationDataAndCustodyBit struct {
	Data       AttestationData
	CustodyBit bool // Challengeable bit (SSZ-bool, 1 byte) for the custody of crosslink data
}

type AttestationDeltasFeature

type AttestationDeltasFeature struct {
	Meta interface {
		meta.Versioning
		meta.RegistrySize
		meta.Staking
		meta.EffectiveBalances
		meta.AttesterStatuses
		meta.Finality
	}
}

func (*AttestationDeltasFeature) AttestationDeltas

func (f *AttestationDeltasFeature) AttestationDeltas() *Deltas

type AttestationFeature

func (*AttestationFeature) ProcessAttestation

func (f *AttestationFeature) ProcessAttestation(attestation *Attestation) error

func (*AttestationFeature) ProcessAttestations

func (f *AttestationFeature) ProcessAttestations(ops []Attestation) error

type AttestationProcessor

type AttestationProcessor interface {
	ProcessAttestations(ops []Attestation) error
	ProcessAttestation(attestation *Attestation) error
}

type AttestationSlotMeta

type AttestationSlotMeta interface {
	meta.CrosslinkTiming
	meta.CommitteeCount
}

type AttestationValidator

type AttestationValidator interface {
	meta.RegistrySize
	meta.Pubkeys
	meta.Versioning
}

type AttestationsState

type AttestationsState struct {
	PreviousEpochAttestations EpochPendingAttestations
	CurrentEpochAttestations  EpochPendingAttestations
}

func (*AttestationsState) RotateEpochAttestations

func (state *AttestationsState) RotateEpochAttestations()

Rotate current/previous epoch attestations

type AttesterStatusFeature

func (*AttesterStatusFeature) GetAttesterStatuses added in v0.8.4

func (f *AttesterStatusFeature) GetAttesterStatuses() (out []AttesterStatus)

type CommitteeBits

type CommitteeBits []byte

func (CommitteeBits) BitLen

func (cb CommitteeBits) BitLen() uint64

func (CommitteeBits) FilterNonParticipants

func (cb CommitteeBits) FilterNonParticipants(committee []ValidatorIndex) []ValidatorIndex

In-place filters a list of committees indices to only keep the bitfield NON-participants. The result is not sorted. Returns the re-sliced filtered non-participants list.

func (CommitteeBits) FilterParticipants

func (cb CommitteeBits) FilterParticipants(committee []ValidatorIndex) []ValidatorIndex

In-place filters a list of committees indices to only keep the bitfield participants. The result is not sorted. Returns the re-sliced filtered participants list.

func (CommitteeBits) GetBit

func (cb CommitteeBits) GetBit(i uint64) bool

func (*CommitteeBits) Limit

func (cb *CommitteeBits) Limit() uint64

func (CommitteeBits) Or

func (cb CommitteeBits) Or(other CommitteeBits)

Sets the bits to true that are true in other. (in place)

func (CommitteeBits) SetBit

func (cb CommitteeBits) SetBit(i uint64, v bool)

type CommitteeIndices

type CommitteeIndices []ValidatorIndex

func (*CommitteeIndices) Limit

func (ci *CommitteeIndices) Limit() uint64

type CrosslinkingEpoch

type CrosslinkingEpoch struct {
	Epoch        Epoch
	WinningLinks [SHARD_COUNT]LinkWinner
}

func (*CrosslinkingEpoch) GetWinningCrosslinkAndAttesters added in v0.8.4

func (ce *CrosslinkingEpoch) GetWinningCrosslinkAndAttesters(shard Shard) (*Crosslink, ValidatorSet)

type CrosslinkingFeature

type CrosslinkingFeature struct {
	State *AttestationsState
	Meta  interface {
		meta.Versioning
		meta.Crosslinks
		meta.EffectiveBalances
		meta.CrosslinkCommittees
		meta.SlashedIndices
	}
}

func (*CrosslinkingFeature) LoadEpochCrosslinkWinners added in v0.8.4

func (f *CrosslinkingFeature) LoadEpochCrosslinkWinners(epoch Epoch) meta.EpochCrosslinkWinners

type EpochPendingAttestations

type EpochPendingAttestations []*PendingAttestation

func (*EpochPendingAttestations) Limit

type IndexedAttestation

type IndexedAttestation struct {
	// Indices with custody bit equal to 0
	CustodyBit0Indices CommitteeIndices
	// Indices with custody bit equal to 1
	CustodyBit1Indices CommitteeIndices

	Data      AttestationData
	Signature BLSSignature
}

func (*IndexedAttestation) Validate

func (indexedAttestation *IndexedAttestation) Validate(m AttestationValidator) error

Verify validity of slashable_attestation fields.

type LinkWinner

type LinkWinner struct {
	Crosslink *Crosslink   // nil when there are no crosslinks for the shard.
	Attesters ValidatorSet // nil-slice when there are no attestations for the shard.
}

type PendingAttestation

type PendingAttestation struct {
	AggregationBits CommitteeBits
	Data            AttestationData
	InclusionDelay  Slot
	ProposerIndex   ValidatorIndex
}

Jump to

Keyboard shortcuts

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