Documentation ¶
Index ¶
- Constants
- type MessageHandler
- type Metrics
- type NonCommitteeValidator
- type NopMetrics
- func (n NopMetrics) DroppedQueueMessage(spectypes.MessageID)
- func (n NopMetrics) IncomingQueueMessage(spectypes.MessageID)
- func (n NopMetrics) MessageQueueCapacity(int)
- func (n NopMetrics) MessageQueueSize(int)
- func (n NopMetrics) MessageTimeInQueue(spectypes.MessageID, time.Duration)
- func (n NopMetrics) OutgoingQueueMessage(spectypes.MessageID)
- func (n NopMetrics) ValidatorError([]byte)
- func (n NopMetrics) ValidatorExiting([]byte)
- func (n NopMetrics) ValidatorInactive([]byte)
- func (n NopMetrics) ValidatorNoIndex([]byte)
- func (n NopMetrics) ValidatorNotActivated([]byte)
- func (n NopMetrics) ValidatorNotFound([]byte)
- func (n NopMetrics) ValidatorPending([]byte)
- func (n NopMetrics) ValidatorReady([]byte)
- func (n NopMetrics) ValidatorRemoved([]byte)
- func (n NopMetrics) ValidatorSlashed([]byte)
- func (n NopMetrics) ValidatorUnknown([]byte)
- type Options
- type State
- type Validator
- func (v *Validator) ConsumeQueue(logger *zap.Logger, msgID spectypes.MessageID, handler MessageHandler) error
- func (v *Validator) GetLastHeight(identifier spectypes.MessageID) specqbft.Height
- func (v *Validator) GetLastRound(identifier spectypes.MessageID) specqbft.Round
- func (v *Validator) HandleMessage(logger *zap.Logger, msg *queue.DecodedSSVMessage)
- func (v *Validator) OnExecuteDuty(logger *zap.Logger, msg types.EventMsg) error
- func (v *Validator) ProcessMessage(logger *zap.Logger, msg *queue.DecodedSSVMessage) error
- func (v *Validator) Start(logger *zap.Logger) (started bool, err error)
- func (v *Validator) StartDuty(logger *zap.Logger, duty *spectypes.Duty) error
- func (v *Validator) StartQueueConsumer(logger *zap.Logger, msgID spectypes.MessageID, handler MessageHandler)
- func (v *Validator) Stop()
Constants ¶
const (
DefaultQueueSize = 32
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageHandler ¶
type MessageHandler func(logger *zap.Logger, msg *queue.DecodedSSVMessage) error
MessageHandler process the msg. return error if exist
type Metrics ¶ added in v1.1.0
type Metrics interface { ValidatorInactive(publicKey []byte) ValidatorNoIndex(publicKey []byte) ValidatorError(publicKey []byte) ValidatorReady(publicKey []byte) ValidatorNotActivated(publicKey []byte) ValidatorExiting(publicKey []byte) ValidatorSlashed(publicKey []byte) ValidatorNotFound(publicKey []byte) ValidatorPending(publicKey []byte) ValidatorRemoved(publicKey []byte) ValidatorUnknown(publicKey []byte) queue.Metrics }
type NonCommitteeValidator ¶
type NonCommitteeValidator struct { Storage *storage.QBFTStores // contains filtered or unexported fields }
func (*NonCommitteeValidator) ProcessMessage ¶
func (ncv *NonCommitteeValidator) ProcessMessage(logger *zap.Logger, msg *queue.DecodedSSVMessage)
type NopMetrics ¶ added in v1.1.0
type NopMetrics struct{}
func (NopMetrics) DroppedQueueMessage ¶ added in v1.1.0
func (n NopMetrics) DroppedQueueMessage(spectypes.MessageID)
func (NopMetrics) IncomingQueueMessage ¶ added in v1.1.0
func (n NopMetrics) IncomingQueueMessage(spectypes.MessageID)
func (NopMetrics) MessageQueueCapacity ¶ added in v1.1.0
func (n NopMetrics) MessageQueueCapacity(int)
func (NopMetrics) MessageQueueSize ¶ added in v1.1.0
func (n NopMetrics) MessageQueueSize(int)
func (NopMetrics) MessageTimeInQueue ¶ added in v1.1.0
func (n NopMetrics) MessageTimeInQueue(spectypes.MessageID, time.Duration)
func (NopMetrics) OutgoingQueueMessage ¶ added in v1.1.0
func (n NopMetrics) OutgoingQueueMessage(spectypes.MessageID)
func (NopMetrics) ValidatorError ¶ added in v1.1.0
func (n NopMetrics) ValidatorError([]byte)
func (NopMetrics) ValidatorExiting ¶ added in v1.1.0
func (n NopMetrics) ValidatorExiting([]byte)
func (NopMetrics) ValidatorInactive ¶ added in v1.1.0
func (n NopMetrics) ValidatorInactive([]byte)
func (NopMetrics) ValidatorNoIndex ¶ added in v1.1.0
func (n NopMetrics) ValidatorNoIndex([]byte)
func (NopMetrics) ValidatorNotActivated ¶ added in v1.1.0
func (n NopMetrics) ValidatorNotActivated([]byte)
func (NopMetrics) ValidatorNotFound ¶ added in v1.1.0
func (n NopMetrics) ValidatorNotFound([]byte)
func (NopMetrics) ValidatorPending ¶ added in v1.1.0
func (n NopMetrics) ValidatorPending([]byte)
func (NopMetrics) ValidatorReady ¶ added in v1.1.0
func (n NopMetrics) ValidatorReady([]byte)
func (NopMetrics) ValidatorRemoved ¶ added in v1.1.0
func (n NopMetrics) ValidatorRemoved([]byte)
func (NopMetrics) ValidatorSlashed ¶ added in v1.1.0
func (n NopMetrics) ValidatorSlashed([]byte)
func (NopMetrics) ValidatorUnknown ¶ added in v1.1.0
func (n NopMetrics) ValidatorUnknown([]byte)
type Options ¶
type Options struct { Network specqbft.Network Beacon specssv.BeaconNode BeaconNetwork beacon.BeaconNetwork Storage *storage.QBFTStores Signer spectypes.KeyManager DutyRunners runner.DutyRunners NewDecidedHandler qbftctrl.NewDecidedHandler FullNode bool Exporter bool BuilderProposals bool QueueSize int GasLimit uint64 MessageValidator validation.MessageValidator Metrics Metrics VerifySignatures bool }
Options represents options that should be passed to a new instance of Validator.
type Validator ¶
type Validator struct { DutyRunners runner.DutyRunners Network specqbft.Network Signer spectypes.KeyManager Storage *storage.QBFTStores Queues map[spectypes.BeaconRole]queueContainer // contains filtered or unexported fields }
Validator represents an SSV ETH consensus validator Share assigned, coordinates duty execution and more. Every validator has a validatorID which is validator's public key. Each validator has multiple DutyRunners, for each duty type.
func NewValidator ¶
NewValidator creates a new instance of Validator.
func (*Validator) ConsumeQueue ¶
func (v *Validator) ConsumeQueue(logger *zap.Logger, msgID spectypes.MessageID, handler MessageHandler) error
ConsumeQueue consumes messages from the queue.Queue of the controller it checks for current state
func (*Validator) GetLastHeight ¶
GetLastHeight returns the last height for the given identifier
func (*Validator) GetLastRound ¶
GetLastRound returns the last height for the given identifier
func (*Validator) HandleMessage ¶
func (v *Validator) HandleMessage(logger *zap.Logger, msg *queue.DecodedSSVMessage)
HandleMessage handles a spectypes.SSVMessage. TODO: accept DecodedSSVMessage once p2p is upgraded to decode messages during validation. TODO: get rid of logger, add context
func (*Validator) OnExecuteDuty ¶
func (*Validator) ProcessMessage ¶
ProcessMessage processes Network Message of all types
func (*Validator) StartQueueConsumer ¶
func (v *Validator) StartQueueConsumer(logger *zap.Logger, msgID spectypes.MessageID, handler MessageHandler)
StartQueueConsumer start ConsumeQueue with handler