heartbeat

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthHeartbeat        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowHeartbeat          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupHeartbeat = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ErrEmptySendTopic = errors.New("empty topic for sending messages")

ErrEmptySendTopic signals that an empty topic string was provided

View Source
var ErrInvalidThreshold = errors.New("invalid threshold")

ErrInvalidThreshold signals that an invalid threshold was provided

View Source
var ErrInvalidTimeDuration = errors.New("invalid time duration")

ErrInvalidTimeDuration signals that an invalid time duration was provided

View Source
var ErrInvalidValue = errors.New("invalid value")

ErrInvalidValue signals that an invalid value has been provided

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

ErrNilAppStatusHandler defines the error for setting a nil AppStatusHandler

View Source
var ErrNilCacher = errors.New("nil cacher")

ErrNilCacher signals that a nil cache has been provided

View Source
var ErrNilCurrentBlockProvider = errors.New("nil current block provider")

ErrNilCurrentBlockProvider signals that a nil current block provider

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

ErrNilHardforkTrigger signals that a nil hardfork trigger has been provided

View Source
var ErrNilHeartbeatMonitor = errors.New("nil heartbeat monitor")

ErrNilHeartbeatMonitor signals that a nil heartbeat monitor was provided

View Source
var ErrNilHeartbeatSenderInfoProvider = errors.New("nil heartbeat sender info provider")

ErrNilHeartbeatSenderInfoProvider signals that a nil heartbeat sender info provider was provided

View Source
var ErrNilMarshaller = errors.New("nil marshaller")

ErrNilMarshaller signals that a nil marshaller has been provided

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

ErrNilMessenger signals that a nil p2p messenger has been provided

View Source
var ErrNilNodesCoordinator = errors.New("nil nodes coordinator")

ErrNilNodesCoordinator signals that an operation has been attempted to or with a nil nodes coordinator

View Source
var ErrNilPeerAuthenticationPool = errors.New("nil peer authentication pool")

ErrNilPeerAuthenticationPool signals that a nil peer authentication pool has been provided

View Source
var ErrNilPeerShardMapper = errors.New("nil peer shard mapper")

ErrNilPeerShardMapper signals that a nil peer shard mapper has been provided

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 ErrNilRandomizer = errors.New("nil randomizer")

ErrNilRandomizer signals that a nil randomizer has been provided

View Source
var ErrNilRedundancyHandler = errors.New("nil redundancy handler")

ErrNilRedundancyHandler signals that a nil redundancy handler was provided

View Source
var ErrNilRequestHandler = errors.New("nil request handler")

ErrNilRequestHandler signals that a nil request handler interface was provided

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

ErrNilShardCoordinator signals that a nil shard coordinator was provided

View Source
var ErrNilTrieSyncStatisticsProvider = errors.New("nil trie sync statistics provider")

ErrNilTrieSyncStatisticsProvider signals that a nil trie sync statistics provider was 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 ErrShouldSkipValidator = errors.New("validator should be skipped")

ErrShouldSkipValidator signals that the validator should be skipped

Functions

This section is empty.

Types

type CurrentBlockProvider added in v1.1.1

type CurrentBlockProvider interface {
	GetCurrentBlockHeader() data.HeaderHandler
	SetCurrentBlockHeaderAndRootHash(bh data.HeaderHandler, rootHash []byte) error
	IsInterfaceNil() bool
}

CurrentBlockProvider can provide the current block that the node was able to commit

type HardforkTrigger

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

HardforkTrigger defines the behavior of a hardfork trigger

type HeartbeatV2 added in v1.3.37

type HeartbeatV2 struct {
	Payload            []byte `protobuf:"bytes,1,opt,name=Payload,proto3" json:"Payload,omitempty"`
	VersionNumber      string `protobuf:"bytes,2,opt,name=VersionNumber,proto3" json:"VersionNumber,omitempty"`
	NodeDisplayName    string `protobuf:"bytes,3,opt,name=NodeDisplayName,proto3" json:"NodeDisplayName,omitempty"`
	Identity           string `protobuf:"bytes,4,opt,name=Identity,proto3" json:"Identity,omitempty"`
	Nonce              uint64 `protobuf:"varint,5,opt,name=Nonce,proto3" json:"Nonce,omitempty"`
	PeerSubType        uint32 `protobuf:"varint,6,opt,name=PeerSubType,proto3" json:"PeerSubType,omitempty"`
	Pubkey             []byte `protobuf:"bytes,7,opt,name=Pubkey,proto3" json:"Pubkey,omitempty"`
	NumTrieNodesSynced uint64 `protobuf:"varint,8,opt,name=NumTrieNodesSynced,proto3" json:"NumTrieNodesSynced,omitempty"`
}

HeartbeatV2 represents the heartbeat message that is sent between peers from the same shard containing current node status

func (*HeartbeatV2) Descriptor added in v1.3.37

func (*HeartbeatV2) Descriptor() ([]byte, []int)

func (*HeartbeatV2) Equal added in v1.3.37

func (this *HeartbeatV2) Equal(that interface{}) bool

func (*HeartbeatV2) GetIdentity added in v1.3.37

func (m *HeartbeatV2) GetIdentity() string

func (*HeartbeatV2) GetNodeDisplayName added in v1.3.37

func (m *HeartbeatV2) GetNodeDisplayName() string

func (*HeartbeatV2) GetNonce added in v1.3.37

func (m *HeartbeatV2) GetNonce() uint64

func (*HeartbeatV2) GetNumTrieNodesSynced added in v1.4.0

func (m *HeartbeatV2) GetNumTrieNodesSynced() uint64

func (*HeartbeatV2) GetPayload added in v1.3.37

func (m *HeartbeatV2) GetPayload() []byte

func (*HeartbeatV2) GetPeerSubType added in v1.3.37

func (m *HeartbeatV2) GetPeerSubType() uint32

func (*HeartbeatV2) GetPubkey added in v1.3.38

func (m *HeartbeatV2) GetPubkey() []byte

func (*HeartbeatV2) GetVersionNumber added in v1.3.37

func (m *HeartbeatV2) GetVersionNumber() string

func (*HeartbeatV2) GoString added in v1.3.37

func (this *HeartbeatV2) GoString() string

func (*HeartbeatV2) Marshal added in v1.3.37

func (m *HeartbeatV2) Marshal() (dAtA []byte, err error)

func (*HeartbeatV2) MarshalTo added in v1.3.37

func (m *HeartbeatV2) MarshalTo(dAtA []byte) (int, error)

func (*HeartbeatV2) MarshalToSizedBuffer added in v1.3.37

func (m *HeartbeatV2) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*HeartbeatV2) ProtoMessage added in v1.3.37

func (*HeartbeatV2) ProtoMessage()

func (*HeartbeatV2) Reset added in v1.3.37

func (m *HeartbeatV2) Reset()

func (*HeartbeatV2) Size added in v1.3.37

func (m *HeartbeatV2) Size() (n int)

func (*HeartbeatV2) String added in v1.3.37

func (this *HeartbeatV2) String() string

func (*HeartbeatV2) Unmarshal added in v1.3.37

func (m *HeartbeatV2) Unmarshal(dAtA []byte) error

func (*HeartbeatV2) XXX_DiscardUnknown added in v1.3.37

func (m *HeartbeatV2) XXX_DiscardUnknown()

func (*HeartbeatV2) XXX_Marshal added in v1.3.37

func (m *HeartbeatV2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HeartbeatV2) XXX_Merge added in v1.3.37

func (m *HeartbeatV2) XXX_Merge(src proto.Message)

func (*HeartbeatV2) XXX_Size added in v1.3.37

func (m *HeartbeatV2) XXX_Size() int

func (*HeartbeatV2) XXX_Unmarshal added in v1.3.37

func (m *HeartbeatV2) XXX_Unmarshal(b []byte) error

type NodeRedundancyHandler added in v1.1.32

type NodeRedundancyHandler interface {
	IsRedundancyNode() bool
	IsMainMachineActive() bool
	ObserverPrivateKey() crypto.PrivateKey
	IsInterfaceNil() bool
}

NodeRedundancyHandler defines the interface responsible for the redundancy management of the node

type NodesCoordinator added in v1.3.37

type NodesCoordinator interface {
	GetAllEligibleValidatorsPublicKeys(epoch uint32) (map[uint32][][]byte, error)
	GetAllWaitingValidatorsPublicKeys(epoch uint32) (map[uint32][][]byte, error)
	GetValidatorWithPublicKey(publicKey []byte) (validator nodesCoordinator.Validator, shardId uint32, err error)
	IsInterfaceNil() bool
}

NodesCoordinator defines the behavior of a struct able to do validator selection

type P2PMessenger

type P2PMessenger interface {
	Broadcast(topic string, buff []byte)
	ID() core.PeerID
	Sign(payload []byte) ([]byte, error)
	ConnectedPeersOnTopic(topic string) []core.PeerID
	IsInterfaceNil() bool
}

P2PMessenger defines a subset of the p2p.Messenger interface

type Payload added in v1.3.37

type Payload struct {
	Timestamp       int64  `protobuf:"varint,1,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"`
	HardforkMessage string `protobuf:"bytes,2,opt,name=HardforkMessage,proto3" json:"HardforkMessage,omitempty"`
}

Payload represents the DTO used as payload for both HeartbeatV2 and PeerAuthentication messages

func (*Payload) Descriptor added in v1.3.37

func (*Payload) Descriptor() ([]byte, []int)

func (*Payload) Equal added in v1.3.37

func (this *Payload) Equal(that interface{}) bool

func (*Payload) GetHardforkMessage added in v1.3.37

func (m *Payload) GetHardforkMessage() string

func (*Payload) GetTimestamp added in v1.3.37

func (m *Payload) GetTimestamp() int64

func (*Payload) GoString added in v1.3.37

func (this *Payload) GoString() string

func (*Payload) Marshal added in v1.3.37

func (m *Payload) Marshal() (dAtA []byte, err error)

func (*Payload) MarshalTo added in v1.3.37

func (m *Payload) MarshalTo(dAtA []byte) (int, error)

func (*Payload) MarshalToSizedBuffer added in v1.3.37

func (m *Payload) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Payload) ProtoMessage added in v1.3.37

func (*Payload) ProtoMessage()

func (*Payload) Reset added in v1.3.37

func (m *Payload) Reset()

func (*Payload) Size added in v1.3.37

func (m *Payload) Size() (n int)

func (*Payload) String added in v1.3.37

func (this *Payload) String() string

func (*Payload) Unmarshal added in v1.3.37

func (m *Payload) Unmarshal(dAtA []byte) error

func (*Payload) XXX_DiscardUnknown added in v1.3.37

func (m *Payload) XXX_DiscardUnknown()

func (*Payload) XXX_Marshal added in v1.3.37

func (m *Payload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Payload) XXX_Merge added in v1.3.37

func (m *Payload) XXX_Merge(src proto.Message)

func (*Payload) XXX_Size added in v1.3.37

func (m *Payload) XXX_Size() int

func (*Payload) XXX_Unmarshal added in v1.3.37

func (m *Payload) XXX_Unmarshal(b []byte) error

type PeerAuthentication added in v1.3.37

type PeerAuthentication struct {
	Pubkey           []byte `protobuf:"bytes,1,opt,name=Pubkey,proto3" json:"Pubkey,omitempty"`
	Signature        []byte `protobuf:"bytes,2,opt,name=Signature,proto3" json:"Signature,omitempty"`
	Pid              []byte `protobuf:"bytes,3,opt,name=Pid,proto3" json:"Pid,omitempty"`
	Payload          []byte `protobuf:"bytes,4,opt,name=Payload,proto3" json:"Payload,omitempty"`
	PayloadSignature []byte `protobuf:"bytes,5,opt,name=PayloadSignature,proto3" json:"PayloadSignature,omitempty"`
}

PeerAuthentication represents the DTO used to pass peer authentication information such as public key, peer id, signature, payload and the signature. This message is used to link the peerID with the associated public key

func (*PeerAuthentication) Descriptor added in v1.3.37

func (*PeerAuthentication) Descriptor() ([]byte, []int)

func (*PeerAuthentication) Equal added in v1.3.37

func (this *PeerAuthentication) Equal(that interface{}) bool

func (*PeerAuthentication) GetPayload added in v1.3.37

func (m *PeerAuthentication) GetPayload() []byte

func (*PeerAuthentication) GetPayloadSignature added in v1.3.37

func (m *PeerAuthentication) GetPayloadSignature() []byte

func (*PeerAuthentication) GetPid added in v1.3.37

func (m *PeerAuthentication) GetPid() []byte

func (*PeerAuthentication) GetPubkey added in v1.3.37

func (m *PeerAuthentication) GetPubkey() []byte

func (*PeerAuthentication) GetSignature added in v1.3.37

func (m *PeerAuthentication) GetSignature() []byte

func (*PeerAuthentication) GoString added in v1.3.37

func (this *PeerAuthentication) GoString() string

func (*PeerAuthentication) Marshal added in v1.3.37

func (m *PeerAuthentication) Marshal() (dAtA []byte, err error)

func (*PeerAuthentication) MarshalTo added in v1.3.37

func (m *PeerAuthentication) MarshalTo(dAtA []byte) (int, error)

func (*PeerAuthentication) MarshalToSizedBuffer added in v1.3.37

func (m *PeerAuthentication) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PeerAuthentication) ProtoMessage added in v1.3.37

func (*PeerAuthentication) ProtoMessage()

func (*PeerAuthentication) Reset added in v1.3.37

func (m *PeerAuthentication) Reset()

func (*PeerAuthentication) Size added in v1.3.37

func (m *PeerAuthentication) Size() (n int)

func (*PeerAuthentication) String added in v1.3.37

func (this *PeerAuthentication) String() string

func (*PeerAuthentication) Unmarshal added in v1.3.37

func (m *PeerAuthentication) Unmarshal(dAtA []byte) error

func (*PeerAuthentication) XXX_DiscardUnknown added in v1.3.37

func (m *PeerAuthentication) XXX_DiscardUnknown()

func (*PeerAuthentication) XXX_Marshal added in v1.3.37

func (m *PeerAuthentication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PeerAuthentication) XXX_Merge added in v1.3.37

func (m *PeerAuthentication) XXX_Merge(src proto.Message)

func (*PeerAuthentication) XXX_Size added in v1.3.37

func (m *PeerAuthentication) XXX_Size() int

func (*PeerAuthentication) XXX_Unmarshal added in v1.3.37

func (m *PeerAuthentication) XXX_Unmarshal(b []byte) error

type PeerShardMapper added in v1.3.45

type PeerShardMapper interface {
	PutPeerIdShardId(pid core.PeerID, shardID uint32)
	IsInterfaceNil() bool
}

PeerShardMapper saves the shard for a peer ID

type PeerTypeProviderHandler

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

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

type TrieSyncStatisticsProvider added in v1.4.0

type TrieSyncStatisticsProvider interface {
	NumProcessed() int
	IsInterfaceNil() bool
}

TrieSyncStatisticsProvider is able to provide trie sync statistics

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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