Documentation
¶
Index ¶
- func NewCollection(options CollectionOptions) validator.ICollection
- func ReportValidatorStatus(pk string, meta *beacon.ValidatorMetadata, logger *zap.Logger)
- func SetOperatorPublicKeys(registryStorage registrystorage.OperatorsCollection, ...) error
- func ShareFromValidatorEvent(validatorAddedEvent abiparser.ValidatorAddedEvent, ...) (*beaconprotocol.Share, *bls.SecretKey, error)
- func UpdateShareMetadata(share *beaconprotocol.Share, bc beaconprotocol.Beacon) (bool, error)
- type Collection
- func (s *Collection) CleanRegistryData() error
- func (s *Collection) DeleteValidatorShare(key []byte) error
- func (s *Collection) GetAllValidatorShares() ([]*beaconprotocol.Share, error)
- func (s *Collection) GetEnabledOperatorValidatorShares(operatorPubKey string) ([]*beaconprotocol.Share, error)
- func (s *Collection) GetValidatorShare(key []byte) (*beaconprotocol.Share, bool, error)
- func (s *Collection) GetValidatorSharesByOwnerAddress(ownerAddress string) ([]*beaconprotocol.Share, error)
- func (s *Collection) SaveValidatorShare(share *beaconprotocol.Share) error
- func (s *Collection) UpdateValidatorMetadata(pk string, metadata *beaconprotocol.ValidatorMetadata) error
- type CollectionOptions
- type Controller
- type ControllerOptions
- type ErrorNotFound
- type ICollection
- type ShareEncryptionKeyProvider
- type ShareEventHandlerFunc
- type ShareOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCollection ¶
func NewCollection(options CollectionOptions) validator.ICollection
NewCollection creates new share storage
func ReportValidatorStatus ¶
func ReportValidatorStatus(pk string, meta *beacon.ValidatorMetadata, logger *zap.Logger)
ReportValidatorStatus reports the current status of validator
func SetOperatorPublicKeys ¶
func SetOperatorPublicKeys( registryStorage registrystorage.OperatorsCollection, validatorAddedEvent *abiparser.ValidatorAddedEvent, ) error
SetOperatorPublicKeys extracts the operator public keys from the storage and fill the event
func ShareFromValidatorEvent ¶
func ShareFromValidatorEvent( validatorAddedEvent abiparser.ValidatorAddedEvent, registryStorage registrystorage.OperatorsCollection, shareEncryptionKeyProvider ShareEncryptionKeyProvider, operatorPubKey string, ) (*beaconprotocol.Share, *bls.SecretKey, error)
ShareFromValidatorEvent takes the contract event data and creates the corresponding validator share. share could return nil in case operator key is not present/ different
func UpdateShareMetadata ¶
func UpdateShareMetadata(share *beaconprotocol.Share, bc beaconprotocol.Beacon) (bool, error)
UpdateShareMetadata will update the given share object w/o involving storage, it will be called only when a new share is created
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
Collection struct
func (*Collection) CleanRegistryData ¶
func (s *Collection) CleanRegistryData() error
CleanRegistryData clears all registry data
func (*Collection) DeleteValidatorShare ¶
func (s *Collection) DeleteValidatorShare(key []byte) error
DeleteValidatorShare removes validator share by key
func (*Collection) GetAllValidatorShares ¶
func (s *Collection) GetAllValidatorShares() ([]*beaconprotocol.Share, error)
GetAllValidatorShares returns all shares
func (*Collection) GetEnabledOperatorValidatorShares ¶
func (s *Collection) GetEnabledOperatorValidatorShares(operatorPubKey string) ([]*beaconprotocol.Share, error)
GetEnabledOperatorValidatorShares returns all not liquidated validator shares belongs to operator
func (*Collection) GetValidatorShare ¶
func (s *Collection) GetValidatorShare(key []byte) (*beaconprotocol.Share, bool, error)
GetValidatorShare by key
func (*Collection) GetValidatorSharesByOwnerAddress ¶
func (s *Collection) GetValidatorSharesByOwnerAddress(ownerAddress string) ([]*beaconprotocol.Share, error)
GetValidatorSharesByOwnerAddress returns all validator shares belongs to owner address
func (*Collection) SaveValidatorShare ¶
func (s *Collection) SaveValidatorShare(share *beaconprotocol.Share) error
SaveValidatorShare save validator share to db
func (*Collection) UpdateValidatorMetadata ¶
func (s *Collection) UpdateValidatorMetadata(pk string, metadata *beaconprotocol.ValidatorMetadata) error
UpdateValidatorMetadata updates the metadata of the given validator
type CollectionOptions ¶
CollectionOptions struct
type Controller ¶
type Controller interface {
ListenToEth1Events(feed *event.Feed)
StartValidators()
GetValidatorsIndices() []spec.ValidatorIndex
GetValidator(pubKey string) (validator.IValidator, bool)
UpdateValidatorMetaDataLoop()
StartNetworkHandlers()
Eth1EventHandler(ongoingSync bool) eth1.SyncEventHandler
OnFork(forkVersion forksprotocol.ForkVersion) error
}
Controller represent the validators controller, it takes care of bootstrapping, updating and managing existing validators and their shares
func NewController ¶
func NewController(options ControllerOptions) Controller
NewController creates a new validator controller instance
type ControllerOptions ¶
type ControllerOptions struct {
Context context.Context
DB basedb.IDb
Logger *zap.Logger
SignatureCollectionTimeout time.Duration `` /* 152-byte string literal not displayed */
MetadataUpdateInterval time.Duration `` /* 127-byte string literal not displayed */
HistorySyncRateLimit time.Duration `yaml:"HistorySyncRateLimit" env:"HISTORY_SYNC_BACKOFF" env-default:"200ms" env-description:"Interval for updating metadata"`
ETHNetwork beaconprotocol.Network
Network network.P2PNetwork
Beacon beaconprotocol.Beacon
CleanRegistryData bool
FullNode bool `` /* 155-byte string literal not displayed */
KeyManager beaconprotocol.KeyManager
OperatorPubKey string
RegistryStorage registrystorage.OperatorsCollection
ForkVersion forksprotocol.ForkVersion
NewDecidedHandler qbftcontroller.NewDecidedHandler
// worker flags
WorkersCount int `` /* 130-byte string literal not displayed */
QueueBufferSize int `yaml:"MsgWorkerBufferSize" env:"MSG_WORKER_BUFFER_SIZE" env-default:"256" env-description:"Buffer size for message workers"`
}
ControllerOptions for creating a validator controller
type ErrorNotFound ¶
type ErrorNotFound struct {
Err error
}
ErrorNotFound is returned when the validator share is not found
func (*ErrorNotFound) Error ¶
func (e *ErrorNotFound) Error() string
type ICollection ¶
type ICollection interface {
eth1.RegistryStore
}
ICollection interface for validator storage
type ShareEncryptionKeyProvider ¶
type ShareEncryptionKeyProvider = func() (*rsa.PrivateKey, bool, error)
ShareEncryptionKeyProvider is a function that returns the operator private key
type ShareEventHandlerFunc ¶
type ShareEventHandlerFunc func(share *beaconprotocol.Share)
ShareEventHandlerFunc is a function that handles event in an extended mode
type ShareOptions ¶
type ShareOptions struct {
}
ShareOptions - used to load validator share from config