Documentation
¶
Overview ¶
Package beacon is a generated GoMock package.
Package beacon is a generated GoMock package.
Index ¶
- func FetchValidatorsMetadata(bc Beacon, pubKeys [][]byte) (map[string]*ValidatorMetadata, error)
- func UpdateValidatorsMetadata(pubKeys [][]byte, collection ValidatorMetadataStorage, bc Beacon, ...) error
- func UpdateValidatorsMetadataBatch(pubKeys [][]byte, queue queue.Queue, collection ValidatorMetadataStorage, ...)
- type Beacon
- type DutyData
- type InputValueAttestation
- type InputValueAttestationData
- type IsInputValueData
- type IsInputValueSignedData
- type MockBeacon
- func (m *MockBeacon) AddShare(shareKey *bls.SecretKey) error
- func (m *MockBeacon) ComputeSigningRoot(object interface{}, domain []byte) ([32]byte, error)
- func (m *MockBeacon) EXPECT() *MockBeaconMockRecorder
- func (m *MockBeacon) GetAttestationData(slot spec.Slot, committeeIndex spec.CommitteeIndex) (*spec.AttestationData, error)
- func (m *MockBeacon) GetDomain(data *spec.AttestationData) ([]byte, error)
- func (m *MockBeacon) GetDuties(epoch spec.Epoch, validatorIndices []spec.ValidatorIndex) ([]*spectypes.Duty, error)
- func (m *MockBeacon) GetValidatorData(validatorPubKeys []spec.BLSPubKey) (map[spec.ValidatorIndex]*v1.Validator, error)
- func (m *MockBeacon) RemoveShare(pubKey string) error
- func (m *MockBeacon) SignAttestation(data *spec.AttestationData, duty *spectypes.Duty, pk []byte) (*spec.Attestation, []byte, error)
- func (m *MockBeacon) SignRoot(data spectypes.Root, sigType spectypes.SignatureType, pk []byte) (spectypes.Signature, error)
- func (m *MockBeacon) SubmitAttestation(attestation *spec.Attestation) error
- func (m *MockBeacon) SubscribeToCommitteeSubnet(subscription []*v1.BeaconCommitteeSubscription) error
- type MockBeaconMockRecorder
- func (mr *MockBeaconMockRecorder) AddShare(shareKey interface{}) *gomock.Call
- func (mr *MockBeaconMockRecorder) ComputeSigningRoot(object, domain interface{}) *gomock.Call
- func (mr *MockBeaconMockRecorder) GetAttestationData(slot, committeeIndex interface{}) *gomock.Call
- func (mr *MockBeaconMockRecorder) GetDomain(data interface{}) *gomock.Call
- func (mr *MockBeaconMockRecorder) GetDuties(epoch, validatorIndices interface{}) *gomock.Call
- func (mr *MockBeaconMockRecorder) GetValidatorData(validatorPubKeys interface{}) *gomock.Call
- func (mr *MockBeaconMockRecorder) RemoveShare(pubKey interface{}) *gomock.Call
- func (mr *MockBeaconMockRecorder) SignAttestation(data, duty, pk interface{}) *gomock.Call
- func (mr *MockBeaconMockRecorder) SignRoot(data, sigType, pk interface{}) *gomock.Call
- func (mr *MockBeaconMockRecorder) SubmitAttestation(attestation interface{}) *gomock.Call
- func (mr *MockBeaconMockRecorder) SubscribeToCommitteeSubnet(subscription interface{}) *gomock.Call
- type MockKeyManager
- func (m *MockKeyManager) AddShare(shareKey *bls.SecretKey) error
- func (m *MockKeyManager) EXPECT() *MockKeyManagerMockRecorder
- func (m *MockKeyManager) RemoveShare(pubKey string) error
- func (m *MockKeyManager) SignAttestation(data *spec.AttestationData, duty *spectypes.Duty, pk []byte) (*spec.Attestation, []byte, error)
- func (m *MockKeyManager) SignRoot(data spectypes.Root, sigType spectypes.SignatureType, pk []byte) (spectypes.Signature, error)
- type MockKeyManagerMockRecorder
- func (mr *MockKeyManagerMockRecorder) AddShare(shareKey interface{}) *gomock.Call
- func (mr *MockKeyManagerMockRecorder) RemoveShare(pubKey interface{}) *gomock.Call
- func (mr *MockKeyManagerMockRecorder) SignAttestation(data, duty, pk interface{}) *gomock.Call
- func (mr *MockKeyManagerMockRecorder) SignRoot(data, sigType, pk interface{}) *gomock.Call
- type MockSigner
- func (m *MockSigner) EXPECT() *MockSignerMockRecorder
- func (m *MockSigner) SignAttestation(data *spec.AttestationData, duty *spectypes.Duty, pk []byte) (*spec.Attestation, []byte, error)
- func (m *MockSigner) SignRoot(data spectypes.Root, sigType spectypes.SignatureType, pk []byte) (spectypes.Signature, error)
- type MockSignerMockRecorder
- type MockSigningUtil
- type MockSigningUtilMockRecorder
- type MockValidatorMetadataStorage
- type MockValidatorMetadataStorageMockRecorder
- type Network
- type Node
- type OnUpdated
- type Options
- type PubKeys
- type Share
- func (s *Share) CommitteeSize() int
- func (s *Share) Deserialize(key []byte, val []byte) (*Share, error)
- func (s *Share) HasMetadata() bool
- func (s *Share) HasPartialQuorum(cnt int) bool
- func (s *Share) HasQuorum(cnt int) bool
- func (s *Share) HashOperators() []string
- func (s *Share) IsOperatorIDShare(operatorID uint64) bool
- func (s *Share) IsOperatorShare(operatorPubKey string) bool
- func (s *Share) OperatorReady() bool
- func (s *Share) OperatorSharePubKey() (*bls.PublicKey, error)
- func (s *Share) PartialThresholdSize() int
- func (s *Share) PubKeysByID(ids []spectypes.OperatorID) (map[spectypes.OperatorID]*bls.PublicKey, error)
- func (s *Share) Serialize() ([]byte, error)
- func (s *Share) SetOperatorIds(opIds []uint32)
- func (s *Share) SetOperators(ops [][]byte)
- func (s *Share) ThresholdSize() int
- func (s *Share) VerifySignedMessage(msg *specqbft.SignedMessage) error
- type SigningUtil
- type ValidatorMetadata
- type ValidatorMetadataStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchValidatorsMetadata ¶
func FetchValidatorsMetadata(bc Beacon, pubKeys [][]byte) (map[string]*ValidatorMetadata, error)
FetchValidatorsMetadata is fetching validators data from beacon
func UpdateValidatorsMetadata ¶
func UpdateValidatorsMetadata(pubKeys [][]byte, collection ValidatorMetadataStorage, bc Beacon, onUpdated OnUpdated) error
UpdateValidatorsMetadata updates validator information for the given public keys
func UpdateValidatorsMetadataBatch ¶
func UpdateValidatorsMetadataBatch(pubKeys [][]byte, queue queue.Queue, collection ValidatorMetadataStorage, bc Beacon, onUpdated OnUpdated, batchSize int)
UpdateValidatorsMetadataBatch updates the given public keys in batches
Types ¶
type Beacon ¶
type Beacon interface { SigningUtil // GetDuties returns duties for the passed validators indices GetDuties(epoch spec.Epoch, validatorIndices []spec.ValidatorIndex) ([]*spectypes.Duty, error) // GetValidatorData returns metadata (balance, index, status, more) for each pubkey from the node GetValidatorData(validatorPubKeys []spec.BLSPubKey) (map[spec.ValidatorIndex]*api.Validator, error) // GetAttestationData returns attestation data by the given slot and committee index GetAttestationData(slot spec.Slot, committeeIndex spec.CommitteeIndex) (*spec.AttestationData, error) // SubmitAttestation submit the attestation to the node SubmitAttestation(attestation *spec.Attestation) error // SubscribeToCommitteeSubnet subscribe committee to subnet (p2p topic) SubscribeToCommitteeSubnet(subscription []*api.BeaconCommitteeSubscription) error }
Beacon represents the behavior of the beacon node connector
type DutyData ¶
type DutyData struct { // Types that are valid to be assigned to Data: // *InputValueAttestationData // *InputValue_AggregationData // *InputValue_BeaconBlock Data IsInputValueData `protobuf_oneof:"data"` // Types that are valid to be assigned to SignedData: // *InputValueAttestation // *InputValue_Aggregation // *InputValue_Block SignedData IsInputValueSignedData `protobuf_oneof:"signed_data"` }
DutyData represent unified duty types data
func (*DutyData) GetAttestation ¶
func (m *DutyData) GetAttestation() *phase0.Attestation
GetAttestation return cast attestation input data
func (*DutyData) GetAttestationData ¶
func (m *DutyData) GetAttestationData() *phase0.AttestationData
GetAttestationData return cast input data
func (*DutyData) GetSignedData ¶
func (m *DutyData) GetSignedData() IsInputValueSignedData
GetSignedData returns input data
type InputValueAttestation ¶
type InputValueAttestation struct {
Attestation *phase0.Attestation
}
InputValueAttestation implementing IsInputValueSignedData
type InputValueAttestationData ¶
type InputValueAttestationData struct {
AttestationData *phase0.AttestationData
}
InputValueAttestationData implementing IsInputValueData
type IsInputValueData ¶
type IsInputValueData interface {
// contains filtered or unexported methods
}
IsInputValueData interface representing input data
type IsInputValueSignedData ¶
type IsInputValueSignedData interface {
// contains filtered or unexported methods
}
IsInputValueSignedData interface representing input signed data
type MockBeacon ¶
type MockBeacon struct {
// contains filtered or unexported fields
}
MockBeacon is a mock of Beacon interface
func NewMockBeacon ¶
func NewMockBeacon(ctrl *gomock.Controller) *MockBeacon
NewMockBeacon creates a new mock instance
func (*MockBeacon) AddShare ¶
func (m *MockBeacon) AddShare(shareKey *bls.SecretKey) error
AddShare mocks base method
func (*MockBeacon) ComputeSigningRoot ¶
func (m *MockBeacon) ComputeSigningRoot(object interface{}, domain []byte) ([32]byte, error)
ComputeSigningRoot mocks base method
func (*MockBeacon) EXPECT ¶
func (m *MockBeacon) EXPECT() *MockBeaconMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockBeacon) GetAttestationData ¶
func (m *MockBeacon) GetAttestationData(slot spec.Slot, committeeIndex spec.CommitteeIndex) (*spec.AttestationData, error)
GetAttestationData mocks base method
func (*MockBeacon) GetDomain ¶
func (m *MockBeacon) GetDomain(data *spec.AttestationData) ([]byte, error)
GetDomain mocks base method
func (*MockBeacon) GetDuties ¶
func (m *MockBeacon) GetDuties(epoch spec.Epoch, validatorIndices []spec.ValidatorIndex) ([]*spectypes.Duty, error)
GetDuties mocks base method
func (*MockBeacon) GetValidatorData ¶
func (m *MockBeacon) GetValidatorData(validatorPubKeys []spec.BLSPubKey) (map[spec.ValidatorIndex]*v1.Validator, error)
GetValidatorData mocks base method
func (*MockBeacon) RemoveShare ¶
func (m *MockBeacon) RemoveShare(pubKey string) error
RemoveShare mocks base method
func (*MockBeacon) SignAttestation ¶
func (m *MockBeacon) SignAttestation(data *spec.AttestationData, duty *spectypes.Duty, pk []byte) (*spec.Attestation, []byte, error)
SignAttestation mocks base method
func (*MockBeacon) SignRoot ¶ added in v0.3.0
func (m *MockBeacon) SignRoot(data spectypes.Root, sigType spectypes.SignatureType, pk []byte) (spectypes.Signature, error)
SignRoot mocks base method
func (*MockBeacon) SubmitAttestation ¶
func (m *MockBeacon) SubmitAttestation(attestation *spec.Attestation) error
SubmitAttestation mocks base method
func (*MockBeacon) SubscribeToCommitteeSubnet ¶
func (m *MockBeacon) SubscribeToCommitteeSubnet(subscription []*v1.BeaconCommitteeSubscription) error
SubscribeToCommitteeSubnet mocks base method
type MockBeaconMockRecorder ¶
type MockBeaconMockRecorder struct {
// contains filtered or unexported fields
}
MockBeaconMockRecorder is the mock recorder for MockBeacon
func (*MockBeaconMockRecorder) AddShare ¶
func (mr *MockBeaconMockRecorder) AddShare(shareKey interface{}) *gomock.Call
AddShare indicates an expected call of AddShare
func (*MockBeaconMockRecorder) ComputeSigningRoot ¶
func (mr *MockBeaconMockRecorder) ComputeSigningRoot(object, domain interface{}) *gomock.Call
ComputeSigningRoot indicates an expected call of ComputeSigningRoot
func (*MockBeaconMockRecorder) GetAttestationData ¶
func (mr *MockBeaconMockRecorder) GetAttestationData(slot, committeeIndex interface{}) *gomock.Call
GetAttestationData indicates an expected call of GetAttestationData
func (*MockBeaconMockRecorder) GetDomain ¶
func (mr *MockBeaconMockRecorder) GetDomain(data interface{}) *gomock.Call
GetDomain indicates an expected call of GetDomain
func (*MockBeaconMockRecorder) GetDuties ¶
func (mr *MockBeaconMockRecorder) GetDuties(epoch, validatorIndices interface{}) *gomock.Call
GetDuties indicates an expected call of GetDuties
func (*MockBeaconMockRecorder) GetValidatorData ¶
func (mr *MockBeaconMockRecorder) GetValidatorData(validatorPubKeys interface{}) *gomock.Call
GetValidatorData indicates an expected call of GetValidatorData
func (*MockBeaconMockRecorder) RemoveShare ¶ added in v0.3.0
func (mr *MockBeaconMockRecorder) RemoveShare(pubKey interface{}) *gomock.Call
RemoveShare indicates an expected call of RemoveShare
func (*MockBeaconMockRecorder) SignAttestation ¶
func (mr *MockBeaconMockRecorder) SignAttestation(data, duty, pk interface{}) *gomock.Call
SignAttestation indicates an expected call of SignAttestation
func (*MockBeaconMockRecorder) SignRoot ¶ added in v0.3.0
func (mr *MockBeaconMockRecorder) SignRoot(data, sigType, pk interface{}) *gomock.Call
SignRoot indicates an expected call of SignRoot
func (*MockBeaconMockRecorder) SubmitAttestation ¶
func (mr *MockBeaconMockRecorder) SubmitAttestation(attestation interface{}) *gomock.Call
SubmitAttestation indicates an expected call of SubmitAttestation
func (*MockBeaconMockRecorder) SubscribeToCommitteeSubnet ¶
func (mr *MockBeaconMockRecorder) SubscribeToCommitteeSubnet(subscription interface{}) *gomock.Call
SubscribeToCommitteeSubnet indicates an expected call of SubscribeToCommitteeSubnet
type MockKeyManager ¶
type MockKeyManager struct {
// contains filtered or unexported fields
}
MockKeyManager is a mock of KeyManager interface
func NewMockKeyManager ¶
func NewMockKeyManager(ctrl *gomock.Controller) *MockKeyManager
NewMockKeyManager creates a new mock instance
func (*MockKeyManager) AddShare ¶
func (m *MockKeyManager) AddShare(shareKey *bls.SecretKey) error
AddShare mocks base method
func (*MockKeyManager) EXPECT ¶
func (m *MockKeyManager) EXPECT() *MockKeyManagerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockKeyManager) RemoveShare ¶ added in v0.3.0
func (m *MockKeyManager) RemoveShare(pubKey string) error
RemoveShare mocks base method
func (*MockKeyManager) SignAttestation ¶
func (m *MockKeyManager) SignAttestation(data *spec.AttestationData, duty *spectypes.Duty, pk []byte) (*spec.Attestation, []byte, error)
SignAttestation mocks base method
type MockKeyManagerMockRecorder ¶
type MockKeyManagerMockRecorder struct {
// contains filtered or unexported fields
}
MockKeyManagerMockRecorder is the mock recorder for MockKeyManager
func (*MockKeyManagerMockRecorder) AddShare ¶
func (mr *MockKeyManagerMockRecorder) AddShare(shareKey interface{}) *gomock.Call
AddShare indicates an expected call of AddShare
func (*MockKeyManagerMockRecorder) RemoveShare ¶ added in v0.3.0
func (mr *MockKeyManagerMockRecorder) RemoveShare(pubKey interface{}) *gomock.Call
RemoveShare indicates an expected call of RemoveShare
func (*MockKeyManagerMockRecorder) SignAttestation ¶
func (mr *MockKeyManagerMockRecorder) SignAttestation(data, duty, pk interface{}) *gomock.Call
SignAttestation indicates an expected call of SignAttestation
func (*MockKeyManagerMockRecorder) SignRoot ¶ added in v0.3.0
func (mr *MockKeyManagerMockRecorder) SignRoot(data, sigType, pk interface{}) *gomock.Call
SignRoot indicates an expected call of SignRoot
type MockSigner ¶
type MockSigner struct {
// contains filtered or unexported fields
}
MockSigner is a mock of KeyManager interface
func NewMockSigner ¶
func NewMockSigner(ctrl *gomock.Controller) *MockSigner
NewMockSigner creates a new mock instance
func (*MockSigner) EXPECT ¶
func (m *MockSigner) EXPECT() *MockSignerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockSigner) SignAttestation ¶
func (m *MockSigner) SignAttestation(data *spec.AttestationData, duty *spectypes.Duty, pk []byte) (*spec.Attestation, []byte, error)
SignAttestation mocks base method
type MockSignerMockRecorder ¶
type MockSignerMockRecorder struct {
// contains filtered or unexported fields
}
MockSignerMockRecorder is the mock recorder for MockSigner
func (*MockSignerMockRecorder) SignAttestation ¶
func (mr *MockSignerMockRecorder) SignAttestation(data, duty, pk interface{}) *gomock.Call
SignAttestation indicates an expected call of SignAttestation
func (*MockSignerMockRecorder) SignRoot ¶ added in v0.3.0
func (mr *MockSignerMockRecorder) SignRoot(data, sigType, pk interface{}) *gomock.Call
SignRoot indicates an expected call of SignRoot
type MockSigningUtil ¶
type MockSigningUtil struct {
// contains filtered or unexported fields
}
MockSigningUtil is a mock of SigningUtil interface
func NewMockSigningUtil ¶
func NewMockSigningUtil(ctrl *gomock.Controller) *MockSigningUtil
NewMockSigningUtil creates a new mock instance
func (*MockSigningUtil) ComputeSigningRoot ¶
func (m *MockSigningUtil) ComputeSigningRoot(object interface{}, domain []byte) ([32]byte, error)
ComputeSigningRoot mocks base method
func (*MockSigningUtil) EXPECT ¶
func (m *MockSigningUtil) EXPECT() *MockSigningUtilMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockSigningUtil) GetDomain ¶
func (m *MockSigningUtil) GetDomain(data *spec.AttestationData) ([]byte, error)
GetDomain mocks base method
type MockSigningUtilMockRecorder ¶
type MockSigningUtilMockRecorder struct {
// contains filtered or unexported fields
}
MockSigningUtilMockRecorder is the mock recorder for MockSigningUtil
func (*MockSigningUtilMockRecorder) ComputeSigningRoot ¶
func (mr *MockSigningUtilMockRecorder) ComputeSigningRoot(object, domain interface{}) *gomock.Call
ComputeSigningRoot indicates an expected call of ComputeSigningRoot
func (*MockSigningUtilMockRecorder) GetDomain ¶
func (mr *MockSigningUtilMockRecorder) GetDomain(data interface{}) *gomock.Call
GetDomain indicates an expected call of GetDomain
type MockValidatorMetadataStorage ¶
type MockValidatorMetadataStorage struct {
// contains filtered or unexported fields
}
MockValidatorMetadataStorage is a mock of ValidatorMetadataStorage interface
func NewMockValidatorMetadataStorage ¶
func NewMockValidatorMetadataStorage(ctrl *gomock.Controller) *MockValidatorMetadataStorage
NewMockValidatorMetadataStorage creates a new mock instance
func (*MockValidatorMetadataStorage) EXPECT ¶
func (m *MockValidatorMetadataStorage) EXPECT() *MockValidatorMetadataStorageMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockValidatorMetadataStorage) UpdateValidatorMetadata ¶
func (m *MockValidatorMetadataStorage) UpdateValidatorMetadata(pk string, metadata *ValidatorMetadata) error
UpdateValidatorMetadata mocks base method
type MockValidatorMetadataStorageMockRecorder ¶
type MockValidatorMetadataStorageMockRecorder struct {
// contains filtered or unexported fields
}
MockValidatorMetadataStorageMockRecorder is the mock recorder for MockValidatorMetadataStorage
func (*MockValidatorMetadataStorageMockRecorder) UpdateValidatorMetadata ¶
func (mr *MockValidatorMetadataStorageMockRecorder) UpdateValidatorMetadata(pk, metadata interface{}) *gomock.Call
UpdateValidatorMetadata indicates an expected call of UpdateValidatorMetadata
type Network ¶
Network is a beacon chain network.
func NewNetwork ¶
NewNetwork creates a new beacon chain network.
type OnUpdated ¶
type OnUpdated func(pk string, meta *ValidatorMetadata)
OnUpdated represents a function to be called once validator's metadata was updated
type Options ¶
type Options struct { Context context.Context Logger *zap.Logger Network string `yaml:"Network" env:"NETWORK" env-default:"prater"` BeaconNodeAddr string `yaml:"BeaconNodeAddr" env:"BEACON_NODE_ADDR" env-required:"true"` Graffiti []byte DB basedb.IDb }
Options for controller struct creation
type Share ¶
type Share struct {}
Share storage model
func (*Share) CommitteeSize ¶
CommitteeSize returns the IBFT committee size
func (*Share) Deserialize ¶
Deserialize key/value to Share model
func (*Share) HasMetadata ¶
HasMetadata returns true if the validator metadata was fetched
func (*Share) HasPartialQuorum ¶ added in v0.3.2
HasPartialQuorum returns true if at least f+1 items present (cnt is the number of items). It assumes nothing about those items, not their type or structure. https://github.com/ConsenSys/qbft-formal-spec-and-verification/blob/main/dafny/spec/L1/node_auxiliary_functions.dfy#L244
func (*Share) HasQuorum ¶ added in v0.3.2
HasQuorum returns true if at least 2f+1 items are present (cnt is the number of items). It assumes nothing about those items, not their type or structure https://github.com/ConsenSys/qbft-formal-spec-and-verification/blob/main/dafny/spec/L1/node_auxiliary_functions.dfy#L259
func (*Share) HashOperators ¶
HashOperators hash all Operators keys key
func (*Share) IsOperatorIDShare ¶ added in v0.3.3
IsOperatorIDShare checks whether the share belongs to operator ID
func (*Share) IsOperatorShare ¶
IsOperatorShare checks whether the share belongs to operator TODO: probably we need to use IsOperatorIDShare instead of IsOperatorShare everywhere
func (*Share) OperatorReady ¶
OperatorReady returns true if all operator relevant data (node id, secret share, etc.) is present
func (*Share) OperatorSharePubKey ¶
OperatorSharePubKey returns the operator's public key based on the node id
func (*Share) PartialThresholdSize ¶
PartialThresholdSize returns the minimum IBFT committee members that needs to sign for a partial quorum (F+1)
func (*Share) PubKeysByID ¶
func (s *Share) PubKeysByID(ids []spectypes.OperatorID) (map[spectypes.OperatorID]*bls.PublicKey, error)
PubKeysByID returns the public keys with the associated ids
func (*Share) SetOperatorIds ¶ added in v0.3.0
SetOperatorIds set Operator ids
func (*Share) SetOperators ¶
SetOperators set Operators public keys
func (*Share) ThresholdSize ¶
ThresholdSize returns the minimum IBFT committee members that needs to sign for a quorum (2F+1)
func (*Share) VerifySignedMessage ¶
func (s *Share) VerifySignedMessage(msg *specqbft.SignedMessage) error
VerifySignedMessage returns true of signed message verifies against pks
type SigningUtil ¶
type SigningUtil interface { GetDomain(data *spec.AttestationData) ([]byte, error) ComputeSigningRoot(object interface{}, domain []byte) ([32]byte, error) }
SigningUtil is an interface for beacon node signing specific methods
type ValidatorMetadata ¶
type ValidatorMetadata struct { Balance spec.Gwei `json:"balance"` Status v1.ValidatorState `json:"status"` Index spec.ValidatorIndex `json:"index"` // pointer in order to support nil }
ValidatorMetadata represents validator metdata from beacon
func (*ValidatorMetadata) Activated ¶
func (m *ValidatorMetadata) Activated() bool
Activated returns true if the validator is not unknown. It might be pending activation or active
func (*ValidatorMetadata) Equals ¶
func (m *ValidatorMetadata) Equals(other *ValidatorMetadata) bool
Equals returns true if the given metadata is equal to current
func (*ValidatorMetadata) Exiting ¶
func (m *ValidatorMetadata) Exiting() bool
Exiting returns true if the validator is existing or exited
func (*ValidatorMetadata) IsActive ¶
func (m *ValidatorMetadata) IsActive() bool
IsActive returns true if the validator is currently active. Cant be other state
func (*ValidatorMetadata) Pending ¶
func (m *ValidatorMetadata) Pending() bool
Pending returns true if the validator is pending
func (*ValidatorMetadata) Slashed ¶
func (m *ValidatorMetadata) Slashed() bool
Slashed returns true if the validator is existing or exited due to slashing
type ValidatorMetadataStorage ¶
type ValidatorMetadataStorage interface {
UpdateValidatorMetadata(pk string, metadata *ValidatorMetadata) error
}
ValidatorMetadataStorage interface for validator metadata