heartbeat

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFetchGenesisTimeFromDb = errors.New("monitor: can't get genesis time from db")

ErrFetchGenesisTimeFromDb signals that the genesis time cannot be fetched from db

View Source
var ErrHeartbeatPidMismatch = errors.New("heartbeat peer id mismatch")

ErrHeartbeatPidMismatch signals that a received hearbeat did not come from the correct originator

View Source
var ErrInvalidDurationToConsiderUnresponsiveInSec = errors.New("value DurationToConsiderUnresponsiveInSec is less than 1")

ErrInvalidDurationToConsiderUnresponsiveInSec is raised when a value less than 1 has been provided

View Source
var ErrInvalidMaxDurationPeerUnresponsive = errors.New("invalid max duration to declare the peer unresponsive")

ErrInvalidMaxDurationPeerUnresponsive signals that the duration provided is invalid

View Source
var ErrMarshalGenesisTime = errors.New("monitor: can't marshal genesis time")

ErrMarshalGenesisTime signals that the marshaling of the genesis time didn't work

View Source
var ErrNegativeMaxTimeToWaitBetweenBroadcastsInSec = errors.New("value MaxTimeToWaitBetweenBroadcastsInSec is less than 1")

ErrNegativeMaxTimeToWaitBetweenBroadcastsInSec is raised when a value less than 1 has been provided

View Source
var ErrNegativeMinTimeToWaitBetweenBroadcastsInSec = errors.New("value MinTimeToWaitBetweenBroadcastsInSec is less than 1")

ErrNegativeMinTimeToWaitBetweenBroadcastsInSec is raised when a value less than 1 has been provided

View Source
var ErrNilAntifloodHandler = errors.New("nil antiflood handler")

ErrNilAntifloodHandler signals that a nil antiflood handler has been provided

View Source
var ErrNilAppStatusHandler = errors.New("nil AppStatusHandler")

ErrNilAppStatusHandler defines the error for setting a nil AppStatusHandler

View Source
var ErrNilDataToProcess = errors.New("nil data to process")

ErrNilDataToProcess signals that nil data was provided

View Source
var ErrNilHardforkTrigger = errors.New("nil hardfork trigger")

ErrNilHardforkTrigger signals that a nil hardfork trigger has been provided

View Source
var ErrNilHeartbeatStorer = errors.New("nil heartbeat storer")

ErrNilHeartbeatStorer signals that the provided heartbeat storer is nil

View Source
var ErrNilMarshalizer = errors.New("nil marshalizer")

ErrNilMarshalizer signals that a nil marshalizer has been provided

View Source
var ErrNilMessage = errors.New("nil message")

ErrNilMessage signals that a nil message has been received

View Source
var ErrNilMessageHandler = errors.New("nil message handler")

ErrNilMessageHandler signals that the provided message handler is nil

View Source
var ErrNilMessenger = errors.New("nil P2P Messenger")

ErrNilMessenger signals that a nil p2p messenger has been provided

View Source
var ErrNilMonitorDb = errors.New("nil monitor db")

ErrNilMonitorDb signals that a nil monitor db was provided

View Source
var ErrNilNetworkShardingCollector = errors.New("nil network sharding collector")

ErrNilNetworkShardingCollector defines the error for setting a nil network sharding collector

View Source
var ErrNilPeerSignatureHandler = errors.New("trying to set nil peerSignatureHandler")

ErrNilPeerSignatureHandler signals that a nil peerSignatureHandler object has been provided

View Source
var ErrNilPeerTypeProvider = errors.New("nil peer type provider")

ErrNilPeerTypeProvider signals that a nil peer type provider has been given

View Source
var ErrNilPrivateKey = errors.New("nil private key")

ErrNilPrivateKey signals that a nil private key has been provided

View Source
var ErrNilPubkeyConverter = errors.New("trying to use a nil pubkey converter")

ErrNilPubkeyConverter signals that a nil public key converter has been provided

View Source
var ErrNilPublicKeysMap = errors.New("nil public keys map")

ErrNilPublicKeysMap signals that a nil public keys map has been provided

View Source
var ErrNilShardCoordinator = errors.New("nil shard coordinator")

ErrNilShardCoordinator signals that an operation has been attempted to or with a nil shard coordinator

View Source
var ErrNilTimer = errors.New("nil time getter handler")

ErrNilTimer signals that a nil time getter handler has been provided

View Source
var ErrPropertyTooLong = errors.New("property too long in Heartbeat")

ErrPropertyTooLong signals that one of the properties is too long

View Source
var ErrStoreGenesisTimeToDb = errors.New("monitor: can't store genesis time")

ErrStoreGenesisTimeToDb signals that the genesis time cannot be store to db

View Source
var ErrUnmarshalGenesisTime = errors.New("monitor: can't unmarshal genesis time")

ErrUnmarshalGenesisTime signals that the unmarshaling of the genesis time didn't work

View Source
var ErrValidatorAlreadySet = errors.New("topic validator has already been set")

ErrValidatorAlreadySet signals that a topic validator has already been set

View Source
var ErrWrongValues = errors.New("wrong values for heartbeat parameters")

ErrWrongValues signals that wrong values were provided

View Source
var ErrZeroHeartbeatRefreshIntervalInSec = errors.New("zero heartbeatRefreshInterval")

ErrZeroHeartbeatRefreshIntervalInSec signals that a zero value was provided for the HeartbeatRefreshIntervalInSec

View Source
var ErrZeroHideInactiveValidatorIntervalInSec = errors.New("zero hideInactiveValidatorIntervalInSec")

ErrZeroHideInactiveValidatorIntervalInSec signals that a zero value was provided for the ErrZeroHideInactiveValidatorIntervalInSec

Functions

This section is empty.

Types

type EligibleListProvider

type EligibleListProvider interface {
	GetAllEligibleValidatorsPublicKeys(epoch uint32) (map[uint32][][]byte, error)
	GetAllWaitingValidatorsPublicKeys(epoch uint32) (map[uint32][][]byte, error)
	IsInterfaceNil() bool
}

EligibleListProvider defines what an eligible list provider should do

type HardforkTrigger

type HardforkTrigger interface {
	TriggerReceived(payload []byte, data []byte, pkBytes []byte) (bool, error)
	RecordedTriggerMessage() ([]byte, bool)
	NotifyTriggerReceived() <-chan struct{}
	CreateData() []byte
	IsInterfaceNil() bool
}

HardforkTrigger defines the behavior of a hardfork trigger

type HeartbeatStorageHandler

type HeartbeatStorageHandler interface {
	LoadGenesisTime() (time.Time, error)
	UpdateGenesisTime(genesisTime time.Time) error
	LoadHeartBeatDTO(pubKey string) (*data.HeartbeatDTO, error)
	SavePubkeyData(pubkey []byte, heartbeat *data.HeartbeatDTO) error
	LoadKeys() ([][]byte, error)
	SaveKeys(peersSlice [][]byte) error
	IsInterfaceNil() bool
}

HeartbeatStorageHandler defines what a heartbeat's storer should do

type MessageHandler

type MessageHandler interface {
	CreateHeartbeatFromP2PMessage(message p2p.MessageP2P) (*data.Heartbeat, error)
	IsInterfaceNil() bool
}

MessageHandler defines what a message processor for heartbeat should do

type NetworkShardingCollector

type NetworkShardingCollector interface {
	UpdatePeerIdPublicKey(pid core.PeerID, pk []byte)
	UpdatePublicKeyShardId(pk []byte, shardId uint32)
	UpdatePeerIdShardId(pid core.PeerID, shardId uint32)
	IsInterfaceNil() bool
}

NetworkShardingCollector defines the updating methods used by the network sharding component The interface assures that the collected data will be used by the p2p network sharding components

type P2PAntifloodHandler

type P2PAntifloodHandler interface {
	CanProcessMessage(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error
	CanProcessMessagesOnTopic(peer core.PeerID, topic string, numMessages uint32, totalSize uint64, sequence []byte) error
	BlacklistPeer(peer core.PeerID, reason string, duration time.Duration)
	IsInterfaceNil() bool
}

P2PAntifloodHandler defines the behavior of a component able to signal that the system is too busy (or flooded) processing p2p messages

type P2PMessenger

type P2PMessenger interface {
	io.Closer
	Bootstrap() error
	Broadcast(topic string, buff []byte)
	BroadcastOnChannel(channel string, topic string, buff []byte)
	BroadcastOnChannelBlocking(channel string, topic string, buff []byte) error
	CreateTopic(name string, createChannelForTopic bool) error
	HasTopic(name string) bool
	HasTopicValidator(name string) bool
	RegisterMessageProcessor(topic string, handler p2p.MessageProcessor) error
	PeerAddresses(pid core.PeerID) []string
	IsConnectedToTheNetwork() bool
	ID() core.PeerID
	IsInterfaceNil() bool
}

P2PMessenger defines a subset of the p2p.Messenger interface

type PeerBlackListHandler

type PeerBlackListHandler interface {
	Add(pid core.PeerID) error
	Has(pid core.PeerID) bool
	Sweep()
	IsInterfaceNil() bool
}

PeerBlackListHandler can determine if a certain peer ID is or not blacklisted

type PeerTypeProviderHandler

type PeerTypeProviderHandler interface {
	ComputeForPubKey(pubKey []byte) (core.PeerType, uint32, error)
	GetAllPeerTypeInfos() []*state.PeerTypeInfo
	IsInterfaceNil() bool
}

PeerTypeProviderHandler defines what a component which computes the type of a peer should do

type Timer

type Timer interface {
	Now() time.Time
	IsInterfaceNil() bool
}

Timer defines an interface for tracking time

type ValidatorStatisticsProcessor

type ValidatorStatisticsProcessor interface {
	RootHash() ([]byte, error)
	GetValidatorInfoForRootHash(rootHash []byte) (map[uint32][]*state.ValidatorInfo, error)
	IsInterfaceNil() bool
}

ValidatorStatisticsProcessor is the interface for consensus participation statistics

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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