Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrFetchGenesisTimeFromDb = errors.New("monitor: can't get genesis time from db")
ErrFetchGenesisTimeFromDb signals that the genesis time cannot be fetched from db
var ErrHeartbeatPidMismatch = errors.New("heartbeat peer id mismatch")
ErrHeartbeatPidMismatch signals that a received hearbeat did not come from the correct originator
var ErrInvalidDurationToConsiderUnresponsiveInSec = errors.New("value DurationToConsiderUnresponsiveInSec is less than 1")
ErrInvalidDurationToConsiderUnresponsiveInSec is raised when a value less than 1 has been provided
var ErrInvalidMaxDurationPeerUnresponsive = errors.New("invalid max duration to declare the peer unresponsive")
ErrInvalidMaxDurationPeerUnresponsive signals that the duration provided is invalid
var ErrMarshalGenesisTime = errors.New("monitor: can't marshal genesis time")
ErrMarshalGenesisTime signals that the marshaling of the genesis time didn't work
var ErrNegativeMaxTimeToWaitBetweenBroadcastsInSec = errors.New("value MaxTimeToWaitBetweenBroadcastsInSec is less than 1")
ErrNegativeMaxTimeToWaitBetweenBroadcastsInSec is raised when a value less than 1 has been provided
var ErrNegativeMinTimeToWaitBetweenBroadcastsInSec = errors.New("value MinTimeToWaitBetweenBroadcastsInSec is less than 1")
ErrNegativeMinTimeToWaitBetweenBroadcastsInSec is raised when a value less than 1 has been provided
var ErrNilAntifloodHandler = errors.New("nil antiflood handler")
ErrNilAntifloodHandler signals that a nil antiflood handler has been provided
var ErrNilAppStatusHandler = errors.New("nil AppStatusHandler")
ErrNilAppStatusHandler defines the error for setting a nil AppStatusHandler
var ErrNilBlackListHandler = errors.New("nil black list handler")
ErrNilBlackListHandler signals that a nil black list handler was provided
var ErrNilDataToProcess = errors.New("nil data to process")
ErrNilDataToProcess signals that nil data was provided
var ErrNilHardforkTrigger = errors.New("nil hardfork trigger")
ErrNilHardforkTrigger signals that a nil hardfork trigger has been provided
var ErrNilHeartbeatStorer = errors.New("nil heartbeat storer")
ErrNilHeartbeatStorer signals that the provided heartbeat storer is nil
var ErrNilKeyGenerator = errors.New("key generator is nil")
ErrNilKeyGenerator is raised when a valid key generator is expected but nil used
var ErrNilMarshalizer = errors.New("nil marshalizer")
ErrNilMarshalizer signals that a nil marshalizer has been provided
var ErrNilMessage = errors.New("nil message")
ErrNilMessage signals that a nil message has been received
var ErrNilMessageHandler = errors.New("nil message handler")
ErrNilMessageHandler signals that the provided message handler is nil
var ErrNilMessenger = errors.New("nil P2P Messenger")
ErrNilMessenger signals that a nil p2p messenger has been provided
var ErrNilMonitorDb = errors.New("nil monitor db")
ErrNilMonitorDb signals that a nil monitor db was provided
var ErrNilNetworkShardingCollector = errors.New("nil network sharding collector")
ErrNilNetworkShardingCollector defines the error for setting a nil network sharding collector
var ErrNilPeerTypeProvider = errors.New("nil peer type provider")
ErrNilPeerTypeProvider signals that a nil peer type provider has been given
var ErrNilPrivateKey = errors.New("nil private key")
ErrNilPrivateKey signals that a nil private key has been provided
var ErrNilPubkeyConverter = errors.New("trying to use a nil pubkey converter")
ErrNilPubkeyConverter signals that a nil public key converter has been provided
var ErrNilPublicKeysMap = errors.New("nil public keys map")
ErrNilPublicKeysMap signals that a nil public keys map has been provided
var ErrNilShardCoordinator = errors.New("nil shard coordinator")
ErrNilShardCoordinator signals that an operation has been attempted to or with a nil shard coordinator
var ErrNilSingleSigner = errors.New("nil single signer")
ErrNilSingleSigner signals that a nil single signer has been provided
var ErrNilTimer = errors.New("nil time getter handler")
ErrNilTimer signals that a nil time getter handler has been provided
var ErrPropertyTooLong = errors.New("property too long in Heartbeat")
ErrPropertyTooLong signals that one of the properties is too long
var ErrStoreGenesisTimeToDb = errors.New("monitor: can't store genesis time")
ErrStoreGenesisTimeToDb signals that the genesis time cannot be store to db
var ErrUnmarshalGenesisTime = errors.New("monitor: can't unmarshal genesis time")
ErrUnmarshalGenesisTime signals that the unmarshaling of the genesis time didn't work
var ErrValidatorAlreadySet = errors.New("topic validator has already been set")
ErrValidatorAlreadySet signals that a topic validator has already been set
var ErrWrongValues = errors.New("wrong values for heartbeat parameters")
ErrWrongValues signals that wrong values were provided
var ErrZeroHeartbeatRefreshIntervalInSec = errors.New("zero heartbeatRefreshInterval")
ErrZeroHeartbeatRefreshIntervalInSec signals that a zero value was provided for the HeartbeatRefreshIntervalInSec
var ErrZeroHideInactiveValidatorIntervalInSec = errors.New("zero hideInactiveValidatorIntervalInSec")
ErrZeroHideInactiveValidatorIntervalInSec signals that a zero value was provided for the ErrZeroHideInactiveValidatorIntervalInSec
Functions ¶
This section is empty.
Types ¶
type BlackListHandler ¶
type BlackListHandler interface { Add(key string) error Has(key string) bool Sweep() IsInterfaceNil() bool }
BlackListHandler can determine if a certain key is or not blacklisted
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) 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 p2p.PeerID, pk []byte) UpdatePublicKeyShardId(pk []byte, shardId uint32) UpdatePeerIdShardId(pid p2p.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 p2p.PeerID) error CanProcessMessagesOnTopic(peer p2p.PeerID, topic string, numMessages uint32) error 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 PeerAddress(pid p2p.PeerID) string IsConnectedToTheNetwork() bool ID() p2p.PeerID IsInterfaceNil() bool }
P2PMessenger defines a subset of the p2p.Messenger interface
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 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