beacon

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: GPL-3.0 Imports: 20 Imported by: 1

Documentation

Overview

Package beacon is a generated GoMock package.

Package beacon is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchValidatorsMetadata

func FetchValidatorsMetadata(bc Beacon, pubKeys [][]byte) (map[string]*ValidatorMetadata, error)

FetchValidatorsMetadata is fetching validators data from beacon

func UpdateValidatorsMetadata

func UpdateValidatorsMetadata(logger *zap.Logger, pubKeys [][]byte, collection ValidatorMetadataStorage, bc Beacon, onUpdated OnUpdated) error

UpdateValidatorsMetadata updates validator information for the given public keys

func UpdateValidatorsMetadataBatch

func UpdateValidatorsMetadataBatch(logger *zap.Logger,
	pubKeys [][]byte,
	queue queue.Queue,
	collection ValidatorMetadataStorage,
	bc Beacon,
	onUpdated OnUpdated,
	batchSize int)

UpdateValidatorsMetadataBatch updates the given public keys in batches

Types

type Beacon

type Beacon interface {
	ssv.BeaconNode // spec beacon interface
	// contains filtered or unexported methods
}

Beacon interface for all beacon duty calls

type DutyData

type DutyData struct {
	// Types that are valid to be assigned to Data:
	//	*InputValueAttestationData
	//	*InputValue_AggregationData
	//	*InputValue_BeaconBlock
	Data IsInputValueData `protobuf_oneof:"data"`
	// Types that are valid to be assigned to SignedData:
	//	*InputValueAttestation
	//	*InputValue_Aggregation
	//	*InputValue_Block
	SignedData IsInputValueSignedData `protobuf_oneof:"signed_data"`
}

DutyData represent unified duty types data

func (*DutyData) GetAttestation

func (m *DutyData) GetAttestation() *phase0.Attestation

GetAttestation return cast attestation input data

func (*DutyData) GetAttestationData

func (m *DutyData) GetAttestationData() *phase0.AttestationData

GetAttestationData return cast input data

func (*DutyData) GetData

func (m *DutyData) GetData() IsInputValueData

GetData returns input data

func (*DutyData) GetSignedData

func (m *DutyData) GetSignedData() IsInputValueSignedData

GetSignedData returns input data

type InputValueAttestation

type InputValueAttestation struct {
	Attestation *phase0.Attestation
}

InputValueAttestation implementing IsInputValueSignedData

type InputValueAttestationData

type InputValueAttestationData struct {
	AttestationData *phase0.AttestationData
}

InputValueAttestationData implementing IsInputValueData

type IsInputValueData

type IsInputValueData interface {
	// contains filtered or unexported methods
}

IsInputValueData interface representing input data

type IsInputValueSignedData

type IsInputValueSignedData interface {
	// contains filtered or unexported methods
}

IsInputValueSignedData interface representing input signed data

type MockBeacon

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

MockBeacon is a mock of Beacon interface.

func NewMockBeacon

func NewMockBeacon(ctrl *gomock.Controller) *MockBeacon

NewMockBeacon creates a new mock instance.

func (*MockBeacon) ComputeSigningRoot

func (m *MockBeacon) ComputeSigningRoot(object interface{}, domain phase0.Domain) ([32]byte, error)

ComputeSigningRoot mocks base method.

func (*MockBeacon) DomainData

func (m *MockBeacon) DomainData(epoch phase0.Epoch, domain phase0.DomainType) (phase0.Domain, error)

DomainData mocks base method.

func (*MockBeacon) EXPECT

func (m *MockBeacon) EXPECT() *MockBeaconMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockBeacon) Events added in v0.4.7

func (m *MockBeacon) Events(ctx context.Context, topics []string, handler client.EventHandlerFunc) error

Events mocks base method.

func (*MockBeacon) GetAttestationData

func (m *MockBeacon) GetAttestationData(slot phase0.Slot, committeeIndex phase0.CommitteeIndex) (ssz.Marshaler, spec.DataVersion, error)

GetAttestationData mocks base method.

func (*MockBeacon) GetBeaconBlock

func (m *MockBeacon) GetBeaconBlock(slot phase0.Slot, committeeIndex phase0.CommitteeIndex, graffiti, randao []byte) (ssz.Marshaler, spec.DataVersion, error)

GetBeaconBlock mocks base method.

func (*MockBeacon) GetBeaconNetwork

func (m *MockBeacon) GetBeaconNetwork() types.BeaconNetwork

GetBeaconNetwork mocks base method.

func (*MockBeacon) GetBlindedBeaconBlock

func (m *MockBeacon) GetBlindedBeaconBlock(slot phase0.Slot, committeeIndex phase0.CommitteeIndex, graffiti, randao []byte) (ssz.Marshaler, spec.DataVersion, error)

GetBlindedBeaconBlock mocks base method.

func (*MockBeacon) GetDuties

func (m *MockBeacon) GetDuties(logger *zap.Logger, epoch phase0.Epoch, validatorIndices []phase0.ValidatorIndex) ([]*types.Duty, error)

GetDuties mocks base method.

func (*MockBeacon) GetSyncCommitteeContribution

func (m *MockBeacon) GetSyncCommitteeContribution(slot phase0.Slot, selectionProofs []phase0.BLSSignature, subnetIDs []uint64) (ssz.Marshaler, spec.DataVersion, error)

GetSyncCommitteeContribution mocks base method.

func (*MockBeacon) GetSyncMessageBlockRoot

func (m *MockBeacon) GetSyncMessageBlockRoot(slot phase0.Slot) (phase0.Root, spec.DataVersion, error)

GetSyncMessageBlockRoot mocks base method.

func (*MockBeacon) GetValidatorData

func (m *MockBeacon) GetValidatorData(validatorPubKeys []phase0.BLSPubKey) (map[phase0.ValidatorIndex]*v1.Validator, error)

GetValidatorData mocks base method.

func (*MockBeacon) IsSyncCommitteeAggregator

func (m *MockBeacon) IsSyncCommitteeAggregator(proof []byte) (bool, error)

IsSyncCommitteeAggregator mocks base method.

func (*MockBeacon) SubmitAggregateSelectionProof

func (m *MockBeacon) SubmitAggregateSelectionProof(slot phase0.Slot, committeeIndex phase0.CommitteeIndex, committeeLength uint64, index phase0.ValidatorIndex, slotSig []byte) (ssz.Marshaler, spec.DataVersion, error)

SubmitAggregateSelectionProof mocks base method.

func (*MockBeacon) SubmitAttestation

func (m *MockBeacon) SubmitAttestation(attestation *phase0.Attestation) error

SubmitAttestation mocks base method.

func (*MockBeacon) SubmitBeaconBlock

func (m *MockBeacon) SubmitBeaconBlock(block *spec.VersionedBeaconBlock, sig phase0.BLSSignature) error

SubmitBeaconBlock mocks base method.

func (*MockBeacon) SubmitBlindedBeaconBlock

func (m *MockBeacon) SubmitBlindedBeaconBlock(block *api.VersionedBlindedBeaconBlock, sig phase0.BLSSignature) error

SubmitBlindedBeaconBlock mocks base method.

func (*MockBeacon) SubmitProposalPreparation

func (m *MockBeacon) SubmitProposalPreparation(feeRecipients map[phase0.ValidatorIndex]bellatrix.ExecutionAddress) error

SubmitProposalPreparation mocks base method.

func (*MockBeacon) SubmitSignedAggregateSelectionProof

func (m *MockBeacon) SubmitSignedAggregateSelectionProof(msg *phase0.SignedAggregateAndProof) error

SubmitSignedAggregateSelectionProof mocks base method.

func (*MockBeacon) SubmitSignedContributionAndProof

func (m *MockBeacon) SubmitSignedContributionAndProof(contribution *altair.SignedContributionAndProof) error

SubmitSignedContributionAndProof mocks base method.

func (*MockBeacon) SubmitSyncCommitteeSubscriptions

func (m *MockBeacon) SubmitSyncCommitteeSubscriptions(subscription []*v1.SyncCommitteeSubscription) error

SubmitSyncCommitteeSubscriptions mocks base method.

func (*MockBeacon) SubmitSyncMessage

func (m *MockBeacon) SubmitSyncMessage(msg *altair.SyncCommitteeMessage) error

SubmitSyncMessage mocks base method.

func (*MockBeacon) SubscribeToCommitteeSubnet

func (m *MockBeacon) SubscribeToCommitteeSubnet(subscription []*v1.BeaconCommitteeSubscription) error

SubscribeToCommitteeSubnet mocks base method.

func (*MockBeacon) SyncCommitteeDuties added in v0.4.7

func (m *MockBeacon) SyncCommitteeDuties(epoch phase0.Epoch, indices []phase0.ValidatorIndex) ([]*v1.SyncCommitteeDuty, error)

SyncCommitteeDuties mocks base method.

func (*MockBeacon) SyncCommitteeSubnetID

func (m *MockBeacon) SyncCommitteeSubnetID(index phase0.CommitteeIndex) (uint64, error)

SyncCommitteeSubnetID mocks base method.

type MockBeaconMockRecorder

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

MockBeaconMockRecorder is the mock recorder for MockBeacon.

func (*MockBeaconMockRecorder) ComputeSigningRoot

func (mr *MockBeaconMockRecorder) ComputeSigningRoot(object, domain interface{}) *gomock.Call

ComputeSigningRoot indicates an expected call of ComputeSigningRoot.

func (*MockBeaconMockRecorder) DomainData

func (mr *MockBeaconMockRecorder) DomainData(epoch, domain interface{}) *gomock.Call

DomainData indicates an expected call of DomainData.

func (*MockBeaconMockRecorder) Events added in v0.4.7

func (mr *MockBeaconMockRecorder) Events(ctx, topics, handler interface{}) *gomock.Call

Events indicates an expected call of Events.

func (*MockBeaconMockRecorder) GetAttestationData

func (mr *MockBeaconMockRecorder) GetAttestationData(slot, committeeIndex interface{}) *gomock.Call

GetAttestationData indicates an expected call of GetAttestationData.

func (*MockBeaconMockRecorder) GetBeaconBlock

func (mr *MockBeaconMockRecorder) GetBeaconBlock(slot, committeeIndex, graffiti, randao interface{}) *gomock.Call

GetBeaconBlock indicates an expected call of GetBeaconBlock.

func (*MockBeaconMockRecorder) GetBeaconNetwork

func (mr *MockBeaconMockRecorder) GetBeaconNetwork() *gomock.Call

GetBeaconNetwork indicates an expected call of GetBeaconNetwork.

func (*MockBeaconMockRecorder) GetBlindedBeaconBlock

func (mr *MockBeaconMockRecorder) GetBlindedBeaconBlock(slot, committeeIndex, graffiti, randao interface{}) *gomock.Call

GetBlindedBeaconBlock indicates an expected call of GetBlindedBeaconBlock.

func (*MockBeaconMockRecorder) GetDuties

func (mr *MockBeaconMockRecorder) GetDuties(logger, epoch, validatorIndices interface{}) *gomock.Call

GetDuties indicates an expected call of GetDuties.

func (*MockBeaconMockRecorder) GetSyncCommitteeContribution

func (mr *MockBeaconMockRecorder) GetSyncCommitteeContribution(slot, selectionProofs, subnetIDs interface{}) *gomock.Call

GetSyncCommitteeContribution indicates an expected call of GetSyncCommitteeContribution.

func (*MockBeaconMockRecorder) GetSyncMessageBlockRoot

func (mr *MockBeaconMockRecorder) GetSyncMessageBlockRoot(slot interface{}) *gomock.Call

GetSyncMessageBlockRoot indicates an expected call of GetSyncMessageBlockRoot.

func (*MockBeaconMockRecorder) GetValidatorData

func (mr *MockBeaconMockRecorder) GetValidatorData(validatorPubKeys interface{}) *gomock.Call

GetValidatorData indicates an expected call of GetValidatorData.

func (*MockBeaconMockRecorder) IsSyncCommitteeAggregator

func (mr *MockBeaconMockRecorder) IsSyncCommitteeAggregator(proof interface{}) *gomock.Call

IsSyncCommitteeAggregator indicates an expected call of IsSyncCommitteeAggregator.

func (*MockBeaconMockRecorder) SubmitAggregateSelectionProof

func (mr *MockBeaconMockRecorder) SubmitAggregateSelectionProof(slot, committeeIndex, committeeLength, index, slotSig interface{}) *gomock.Call

SubmitAggregateSelectionProof indicates an expected call of SubmitAggregateSelectionProof.

func (*MockBeaconMockRecorder) SubmitAttestation

func (mr *MockBeaconMockRecorder) SubmitAttestation(attestation interface{}) *gomock.Call

SubmitAttestation indicates an expected call of SubmitAttestation.

func (*MockBeaconMockRecorder) SubmitBeaconBlock

func (mr *MockBeaconMockRecorder) SubmitBeaconBlock(block, sig interface{}) *gomock.Call

SubmitBeaconBlock indicates an expected call of SubmitBeaconBlock.

func (*MockBeaconMockRecorder) SubmitBlindedBeaconBlock

func (mr *MockBeaconMockRecorder) SubmitBlindedBeaconBlock(block, sig interface{}) *gomock.Call

SubmitBlindedBeaconBlock indicates an expected call of SubmitBlindedBeaconBlock.

func (*MockBeaconMockRecorder) SubmitProposalPreparation

func (mr *MockBeaconMockRecorder) SubmitProposalPreparation(feeRecipients interface{}) *gomock.Call

SubmitProposalPreparation indicates an expected call of SubmitProposalPreparation.

func (*MockBeaconMockRecorder) SubmitSignedAggregateSelectionProof

func (mr *MockBeaconMockRecorder) SubmitSignedAggregateSelectionProof(msg interface{}) *gomock.Call

SubmitSignedAggregateSelectionProof indicates an expected call of SubmitSignedAggregateSelectionProof.

func (*MockBeaconMockRecorder) SubmitSignedContributionAndProof

func (mr *MockBeaconMockRecorder) SubmitSignedContributionAndProof(contribution interface{}) *gomock.Call

SubmitSignedContributionAndProof indicates an expected call of SubmitSignedContributionAndProof.

func (*MockBeaconMockRecorder) SubmitSyncCommitteeSubscriptions

func (mr *MockBeaconMockRecorder) SubmitSyncCommitteeSubscriptions(subscription interface{}) *gomock.Call

SubmitSyncCommitteeSubscriptions indicates an expected call of SubmitSyncCommitteeSubscriptions.

func (*MockBeaconMockRecorder) SubmitSyncMessage

func (mr *MockBeaconMockRecorder) SubmitSyncMessage(msg interface{}) *gomock.Call

SubmitSyncMessage indicates an expected call of SubmitSyncMessage.

func (*MockBeaconMockRecorder) SubscribeToCommitteeSubnet

func (mr *MockBeaconMockRecorder) SubscribeToCommitteeSubnet(subscription interface{}) *gomock.Call

SubscribeToCommitteeSubnet indicates an expected call of SubscribeToCommitteeSubnet.

func (*MockBeaconMockRecorder) SyncCommitteeDuties added in v0.4.7

func (mr *MockBeaconMockRecorder) SyncCommitteeDuties(epoch, indices interface{}) *gomock.Call

SyncCommitteeDuties indicates an expected call of SyncCommitteeDuties.

func (*MockBeaconMockRecorder) SyncCommitteeSubnetID

func (mr *MockBeaconMockRecorder) SyncCommitteeSubnetID(index interface{}) *gomock.Call

SyncCommitteeSubnetID indicates an expected call of SyncCommitteeSubnetID.

type MockValidatorMetadataStorage

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

MockValidatorMetadataStorage is a mock of ValidatorMetadataStorage interface.

func NewMockValidatorMetadataStorage

func NewMockValidatorMetadataStorage(ctrl *gomock.Controller) *MockValidatorMetadataStorage

NewMockValidatorMetadataStorage creates a new mock instance.

func (*MockValidatorMetadataStorage) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockValidatorMetadataStorage) UpdateValidatorMetadata

func (m *MockValidatorMetadataStorage) UpdateValidatorMetadata(logger *zap.Logger, pk string, metadata *ValidatorMetadata) error

UpdateValidatorMetadata mocks base method.

type MockValidatorMetadataStorageMockRecorder

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

MockValidatorMetadataStorageMockRecorder is the mock recorder for MockValidatorMetadataStorage.

func (*MockValidatorMetadataStorageMockRecorder) UpdateValidatorMetadata

func (mr *MockValidatorMetadataStorageMockRecorder) UpdateValidatorMetadata(logger, pk, metadata interface{}) *gomock.Call

UpdateValidatorMetadata indicates an expected call of UpdateValidatorMetadata.

type MockbeaconDuties

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

MockbeaconDuties is a mock of beaconDuties interface.

func NewMockbeaconDuties

func NewMockbeaconDuties(ctrl *gomock.Controller) *MockbeaconDuties

NewMockbeaconDuties creates a new mock instance.

func (*MockbeaconDuties) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockbeaconDuties) Events added in v0.4.7

func (m *MockbeaconDuties) Events(ctx context.Context, topics []string, handler client.EventHandlerFunc) error

Events mocks base method.

func (*MockbeaconDuties) GetDuties

func (m *MockbeaconDuties) GetDuties(logger *zap.Logger, epoch phase0.Epoch, validatorIndices []phase0.ValidatorIndex) ([]*types.Duty, error)

GetDuties mocks base method.

func (*MockbeaconDuties) SyncCommitteeDuties added in v0.4.7

func (m *MockbeaconDuties) SyncCommitteeDuties(epoch phase0.Epoch, indices []phase0.ValidatorIndex) ([]*v1.SyncCommitteeDuty, error)

SyncCommitteeDuties mocks base method.

type MockbeaconDutiesMockRecorder

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

MockbeaconDutiesMockRecorder is the mock recorder for MockbeaconDuties.

func (*MockbeaconDutiesMockRecorder) Events added in v0.4.7

func (mr *MockbeaconDutiesMockRecorder) Events(ctx, topics, handler interface{}) *gomock.Call

Events indicates an expected call of Events.

func (*MockbeaconDutiesMockRecorder) GetDuties

func (mr *MockbeaconDutiesMockRecorder) GetDuties(logger, epoch, validatorIndices interface{}) *gomock.Call

GetDuties indicates an expected call of GetDuties.

func (*MockbeaconDutiesMockRecorder) SyncCommitteeDuties added in v0.4.7

func (mr *MockbeaconDutiesMockRecorder) SyncCommitteeDuties(epoch, indices interface{}) *gomock.Call

SyncCommitteeDuties indicates an expected call of SyncCommitteeDuties.

type MockbeaconSubscriber

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

MockbeaconSubscriber is a mock of beaconSubscriber interface.

func NewMockbeaconSubscriber

func NewMockbeaconSubscriber(ctrl *gomock.Controller) *MockbeaconSubscriber

NewMockbeaconSubscriber creates a new mock instance.

func (*MockbeaconSubscriber) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockbeaconSubscriber) SubmitSyncCommitteeSubscriptions

func (m *MockbeaconSubscriber) SubmitSyncCommitteeSubscriptions(subscription []*v1.SyncCommitteeSubscription) error

SubmitSyncCommitteeSubscriptions mocks base method.

func (*MockbeaconSubscriber) SubscribeToCommitteeSubnet

func (m *MockbeaconSubscriber) SubscribeToCommitteeSubnet(subscription []*v1.BeaconCommitteeSubscription) error

SubscribeToCommitteeSubnet mocks base method.

type MockbeaconSubscriberMockRecorder

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

MockbeaconSubscriberMockRecorder is the mock recorder for MockbeaconSubscriber.

func (*MockbeaconSubscriberMockRecorder) SubmitSyncCommitteeSubscriptions

func (mr *MockbeaconSubscriberMockRecorder) SubmitSyncCommitteeSubscriptions(subscription interface{}) *gomock.Call

SubmitSyncCommitteeSubscriptions indicates an expected call of SubmitSyncCommitteeSubscriptions.

func (*MockbeaconSubscriberMockRecorder) SubscribeToCommitteeSubnet

func (mr *MockbeaconSubscriberMockRecorder) SubscribeToCommitteeSubnet(subscription interface{}) *gomock.Call

SubscribeToCommitteeSubnet indicates an expected call of SubscribeToCommitteeSubnet.

type MockbeaconValidator

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

MockbeaconValidator is a mock of beaconValidator interface.

func NewMockbeaconValidator

func NewMockbeaconValidator(ctrl *gomock.Controller) *MockbeaconValidator

NewMockbeaconValidator creates a new mock instance.

func (*MockbeaconValidator) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockbeaconValidator) GetValidatorData

func (m *MockbeaconValidator) GetValidatorData(validatorPubKeys []phase0.BLSPubKey) (map[phase0.ValidatorIndex]*v1.Validator, error)

GetValidatorData mocks base method.

type MockbeaconValidatorMockRecorder

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

MockbeaconValidatorMockRecorder is the mock recorder for MockbeaconValidator.

func (*MockbeaconValidatorMockRecorder) GetValidatorData

func (mr *MockbeaconValidatorMockRecorder) GetValidatorData(validatorPubKeys interface{}) *gomock.Call

GetValidatorData indicates an expected call of GetValidatorData.

type Mockproposer

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

Mockproposer is a mock of proposer interface.

func NewMockproposer

func NewMockproposer(ctrl *gomock.Controller) *Mockproposer

NewMockproposer creates a new mock instance.

func (*Mockproposer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*Mockproposer) SubmitProposalPreparation

func (m *Mockproposer) SubmitProposalPreparation(feeRecipients map[phase0.ValidatorIndex]bellatrix.ExecutionAddress) error

SubmitProposalPreparation mocks base method.

type MockproposerMockRecorder

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

MockproposerMockRecorder is the mock recorder for Mockproposer.

func (*MockproposerMockRecorder) SubmitProposalPreparation

func (mr *MockproposerMockRecorder) SubmitProposalPreparation(feeRecipients interface{}) *gomock.Call

SubmitProposalPreparation indicates an expected call of SubmitProposalPreparation.

type Mocksigner

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

Mocksigner is a mock of signer interface.

func NewMocksigner

func NewMocksigner(ctrl *gomock.Controller) *Mocksigner

NewMocksigner creates a new mock instance.

func (*Mocksigner) ComputeSigningRoot

func (m *Mocksigner) ComputeSigningRoot(object interface{}, domain phase0.Domain) ([32]byte, error)

ComputeSigningRoot mocks base method.

func (*Mocksigner) EXPECT

func (m *Mocksigner) EXPECT() *MocksignerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

type MocksignerMockRecorder

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

MocksignerMockRecorder is the mock recorder for Mocksigner.

func (*MocksignerMockRecorder) ComputeSigningRoot

func (mr *MocksignerMockRecorder) ComputeSigningRoot(object, domain interface{}) *gomock.Call

ComputeSigningRoot indicates an expected call of ComputeSigningRoot.

type Network

type Network struct {
	core.Network
	// contains filtered or unexported fields
}

Network is a beacon chain network.

func NewNetwork

func NewNetwork(network core.Network, minGenesisTime uint64) Network

NewNetwork creates a new beacon chain network.

func (Network) EstimatedCurrentEpoch

func (n Network) EstimatedCurrentEpoch() phase0.Epoch

EstimatedCurrentEpoch estimates the current epoch https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/beacon-chain.md#compute_start_slot_at_epoch

func (Network) EstimatedCurrentSlot

func (n Network) EstimatedCurrentSlot() phase0.Slot

EstimatedCurrentSlot returns the estimation of the current slot

func (Network) EstimatedEpochAtSlot

func (n Network) EstimatedEpochAtSlot(slot phase0.Slot) phase0.Epoch

EstimatedEpochAtSlot estimates epoch at the given slot

func (Network) EstimatedSlotAtTime

func (n Network) EstimatedSlotAtTime(time int64) phase0.Slot

EstimatedSlotAtTime estimates slot at the given time

func (Network) EstimatedSyncCommitteePeriodAtEpoch added in v0.4.7

func (n Network) EstimatedSyncCommitteePeriodAtEpoch(epoch phase0.Epoch) uint64

EstimatedSyncCommitteePeriodAtEpoch estimates the current sync committee period at the given Epoch

func (Network) FirstEpochOfSyncPeriod added in v0.4.7

func (n Network) FirstEpochOfSyncPeriod(period uint64) phase0.Epoch

FirstEpochOfSyncPeriod calculates the first epoch of the given sync period.

func (Network) GetEpochFirstSlot

func (n Network) GetEpochFirstSlot(epoch phase0.Epoch) phase0.Slot

GetEpochFirstSlot returns the beacon node first slot in epoch

func (Network) GetSlotStartTime

func (n Network) GetSlotStartTime(slot phase0.Slot) time.Time

GetSlotStartTime returns the start time for the given slot

func (Network) IsFirstSlotOfEpoch

func (n Network) IsFirstSlotOfEpoch(slot phase0.Slot) bool

IsFirstSlotOfEpoch estimates epoch at the given slot

func (Network) LastSlotOfSyncPeriod added in v0.4.7

func (n Network) LastSlotOfSyncPeriod(period uint64) phase0.Slot

LastSlotOfSyncPeriod calculates the first epoch of the given sync period.

func (Network) MinGenesisTime

func (n Network) MinGenesisTime() uint64

type OnUpdated

type OnUpdated func(logger *zap.Logger, pk string, meta *ValidatorMetadata)

OnUpdated represents a function to be called once validator's metadata was updated

type Options

type Options struct {
	Context        context.Context
	Network        string `yaml:"Network" env:"NETWORK" env-default:"prater"`
	MinGenesisTime uint64 `yaml:"MinGenesisTime" env:"MinGenesisTime"`
	BeaconNodeAddr string `yaml:"BeaconNodeAddr" env:"BEACON_NODE_ADDR" env-required:"true"`
	Graffiti       []byte
}

Options for controller struct creation

type ValidatorMetadata

type ValidatorMetadata struct {
	Balance phase0.Gwei              `json:"balance"`
	Status  eth2apiv1.ValidatorState `json:"status"`
	Index   phase0.ValidatorIndex    `json:"index"` // pointer in order to support nil
}

ValidatorMetadata represents validator metdata from beacon

func (*ValidatorMetadata) Activated

func (m *ValidatorMetadata) Activated() bool

Activated returns true if the validator is not unknown. It might be pending activation or active

func (*ValidatorMetadata) Equals

func (m *ValidatorMetadata) Equals(other *ValidatorMetadata) bool

Equals returns true if the given metadata is equal to current

func (*ValidatorMetadata) Exiting

func (m *ValidatorMetadata) Exiting() bool

Exiting returns true if the validator is existing or exited

func (*ValidatorMetadata) IsActive

func (m *ValidatorMetadata) IsActive() bool

IsActive returns true if the validator is currently active. Cant be other state

func (*ValidatorMetadata) Pending

func (m *ValidatorMetadata) Pending() bool

Pending returns true if the validator is pending

func (*ValidatorMetadata) Slashed

func (m *ValidatorMetadata) Slashed() bool

Slashed returns true if the validator is existing or exited due to slashing

type ValidatorMetadataStorage

type ValidatorMetadataStorage interface {
	UpdateValidatorMetadata(logger *zap.Logger, pk string, metadata *ValidatorMetadata) error
}

ValidatorMetadataStorage interface for validator metadata

Jump to

Keyboard shortcuts

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