peer

package
v1.3.19-indexer1.2.22 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewValidatorStatisticsProcessor

func NewValidatorStatisticsProcessor(arguments ArgValidatorStatisticsProcessor) (*validatorStatistics, error)

NewValidatorStatisticsProcessor instantiates a new validatorStatistics structure responsible of keeping account of

each validator actions in the consensus process

func NewValidatorsProvider added in v0.0.5

func NewValidatorsProvider(
	args ArgValidatorsProvider,
) (*validatorsProvider, error)

NewValidatorsProvider instantiates a new validatorsProvider structure responsible of keeping account of

the latest information about the validators

Types

type ArgPeerTypeProvider added in v1.0.117

type ArgPeerTypeProvider struct {
	NodesCoordinator        process.NodesCoordinator
	StartEpoch              uint32
	EpochStartEventNotifier process.EpochStartEventNotifier
}

ArgPeerTypeProvider contains all parameters needed for creating a PeerTypeProvider

type ArgValidatorStatisticsProcessor

type ArgValidatorStatisticsProcessor struct {
	Marshalizer                                       marshal.Marshalizer
	NodesCoordinator                                  sharding.NodesCoordinator
	ShardCoordinator                                  sharding.Coordinator
	DataPool                                          DataPool
	StorageService                                    dataRetriever.StorageService
	PubkeyConv                                        core.PubkeyConverter
	PeerAdapter                                       state.AccountsAdapter
	Rater                                             sharding.PeerAccountListAndRatingHandler
	RewardsHandler                                    process.RewardsHandler
	MaxComputableRounds                               uint64
	MaxConsecutiveRoundsOfRatingDecrease              uint64
	NodesSetup                                        sharding.GenesisNodesSetupHandler
	GenesisNonce                                      uint64
	RatingEnableEpoch                                 uint32
	SwitchJailWaitingEnableEpoch                      uint32
	BelowSignedThresholdEnableEpoch                   uint32
	StakingV2EnableEpoch                              uint32
	StopDecreasingValidatorRatingWhenStuckEnableEpoch uint32
	EpochNotifier                                     process.EpochNotifier
}

ArgValidatorStatisticsProcessor holds all dependencies for the validatorStatistics

type ArgValidatorsProvider added in v1.0.120

type ArgValidatorsProvider struct {
	NodesCoordinator                  process.NodesCoordinator
	EpochStartEventNotifier           process.EpochStartEventNotifier
	CacheRefreshIntervalDurationInSec time.Duration
	ValidatorStatistics               process.ValidatorStatisticsProcessor
	PubKeyConverter                   core.PubkeyConverter
	StartEpoch                        uint32
	MaxRating                         uint32
}

ArgValidatorsProvider contains all parameters needed for creating a validatorsProvider

type DataPool

type DataPool interface {
	Headers() dataRetriever.HeadersPool
	IsInterfaceNil() bool
}

DataPool indicates the main functionality needed in order to fetch the required blocks from the pool

type ListIndexUpdater added in v1.0.102

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

ListIndexUpdater will handle the updating of list type and the index for a peer

func (*ListIndexUpdater) IsInterfaceNil added in v1.0.102

func (liu *ListIndexUpdater) IsInterfaceNil() bool

IsInterfaceNil checks if the underlying object is nil

func (*ListIndexUpdater) UpdateListAndIndex added in v1.0.102

func (liu *ListIndexUpdater) UpdateListAndIndex(pubKey string, shardID uint32, list string, index uint32) error

UpdateListAndIndex will update the list and the index for a given peer

type PeerTypeProvider added in v1.0.117

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

PeerTypeProvider handles the computation of a peer type

func NewPeerTypeProvider added in v1.0.117

func NewPeerTypeProvider(arg ArgPeerTypeProvider) (*PeerTypeProvider, error)

NewPeerTypeProvider will return a new instance of PeerTypeProvider

func (*PeerTypeProvider) ComputeForPubKey added in v1.0.117

func (ptp *PeerTypeProvider) ComputeForPubKey(pubKey []byte) (common.PeerType, uint32, error)

ComputeForPubKey returns the peer type for a given public key and shard id

func (*PeerTypeProvider) GetAllPeerTypeInfos added in v1.0.117

func (ptp *PeerTypeProvider) GetAllPeerTypeInfos() []*state.PeerTypeInfo

GetAllPeerTypeInfos returns all known peer type infos

func (*PeerTypeProvider) IsInterfaceNil added in v1.0.117

func (ptp *PeerTypeProvider) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

type RatingReader

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

RatingReader will handle the fetching of the ratings

func (*RatingReader) GetRating

func (bsr *RatingReader) GetRating(pk string) uint32

GetRating returns the Rating for the specified public key

func (*RatingReader) IsInterfaceNil

func (bsr *RatingReader) IsInterfaceNil() bool

IsInterfaceNil checks if the underlying object is nil

Jump to

Keyboard shortcuts

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