Documentation ¶
Overview ¶
Package eventhandler provides support for handling registry contract events and persisting them to the database.
Index ¶
Constants ¶
View Source
const ( OperatorAdded = "OperatorAdded" OperatorRemoved = "OperatorRemoved" ValidatorAdded = "ValidatorAdded" ValidatorRemoved = "ValidatorRemoved" ClusterLiquidated = "ClusterLiquidated" ClusterReactivated = "ClusterReactivated" FeeRecipientAddressUpdated = "FeeRecipientAddressUpdated" ValidatorExited = "ValidatorExited" )
Event names
Variables ¶
View Source
var ( ErrAlreadyRegistered = fmt.Errorf("operator registered with the same operator public key") ErrOperatorDataNotFound = fmt.Errorf("operator data not found") ErrSignatureVerification = fmt.Errorf("signature verification failed") )
View Source
var ( // ErrInferiorBlock is returned when trying to process a block that is // not higher than the last processed block. ErrInferiorBlock = errors.New("block is not higher than the last processed block") )
Functions ¶
This section is empty.
Types ¶
type EventHandler ¶
type EventHandler struct {
// contains filtered or unexported fields
}
func New ¶
func New( nodeStorage nodestorage.Storage, eventParser eventparser.Parser, taskExecutor taskExecutor, networkConfig networkconfig.NetworkConfig, operatorDataStore operatordatastore.OperatorDataStore, operatorDecrypter keys.OperatorDecrypter, keyManager spectypes.KeyManager, beacon beaconprotocol.BeaconNode, opts ...Option, ) (*EventHandler, error)
func (*EventHandler) HandleBlockEventsStream ¶
func (eh *EventHandler) HandleBlockEventsStream(logs <-chan executionclient.BlockLogs, executeTasks bool) (lastProcessedBlock uint64, err error)
func (*EventHandler) HandleLocalEvents ¶
func (eh *EventHandler) HandleLocalEvents(localEvents []localevents.Event) error
type ExitValidatorTask ¶ added in v1.2.2
type ExitValidatorTask struct {
// contains filtered or unexported fields
}
func NewExitValidatorTask ¶ added in v1.2.2
func NewExitValidatorTask(executor exitValidatorExecutor, pubKey phase0.BLSPubKey, blockNumber uint64, validatorIndex phase0.ValidatorIndex) *ExitValidatorTask
func (ExitValidatorTask) Execute ¶ added in v1.2.2
func (t ExitValidatorTask) Execute() error
type LiquidateClusterTask ¶
type LiquidateClusterTask struct {
// contains filtered or unexported fields
}
func NewLiquidateClusterTask ¶
func NewLiquidateClusterTask( executor liquidateClusterExecutor, owner ethcommon.Address, operatorIDs []spectypes.OperatorID, toLiquidate []*types.SSVShare, ) *LiquidateClusterTask
func (LiquidateClusterTask) Execute ¶
func (t LiquidateClusterTask) Execute() error
type MalformedEventError ¶
type MalformedEventError struct {
Err error
}
MalformedEventError is returned when event is malformed
func (*MalformedEventError) Error ¶
func (e *MalformedEventError) Error() string
func (*MalformedEventError) Unwrap ¶
func (e *MalformedEventError) Unwrap() error
type Option ¶
type Option func(*EventHandler)
Option defines EventHandler configuration option.
func WithFullNode ¶
func WithFullNode() Option
WithFullNode signals that node works in a full node state.
type ReactivateClusterTask ¶
type ReactivateClusterTask struct {
// contains filtered or unexported fields
}
func NewReactivateClusterTask ¶
func NewReactivateClusterTask( executor reactivateClusterExecutor, owner ethcommon.Address, operatorIDs []spectypes.OperatorID, toReactivate []*types.SSVShare, ) *ReactivateClusterTask
func (ReactivateClusterTask) Execute ¶
func (t ReactivateClusterTask) Execute() error
type StartValidatorTask ¶
type StartValidatorTask struct {
// contains filtered or unexported fields
}
func NewStartValidatorTask ¶
func NewStartValidatorTask(executor startValidatorExecutor, share *types.SSVShare) *StartValidatorTask
func (StartValidatorTask) Execute ¶
func (t StartValidatorTask) Execute() error
type StopValidatorTask ¶
type StopValidatorTask struct {
// contains filtered or unexported fields
}
func NewStopValidatorTask ¶
func NewStopValidatorTask(executor stopValidatorExecutor, pubKey spectypes.ValidatorPK) *StopValidatorTask
func (StopValidatorTask) Execute ¶
func (t StopValidatorTask) Execute() error
type UpdateFeeRecipientTask ¶
type UpdateFeeRecipientTask struct {
// contains filtered or unexported fields
}
func NewUpdateFeeRecipientTask ¶
func NewUpdateFeeRecipientTask(executor updateFeeRecipientExecutor, owner, recipient ethcommon.Address) *UpdateFeeRecipientTask
func (UpdateFeeRecipientTask) Execute ¶
func (t UpdateFeeRecipientTask) Execute() error
Click to show internal directories.
Click to hide internal directories.