Documentation ¶
Index ¶
- func AggregatorValueCheckF(signer types.BeaconSigner, network types.BeaconNetwork, ...) qbft.ProposedValueCheckF
- func BeaconVoteValueCheckF(signer types.BeaconSigner, slot phase0.Slot, ...) qbft.ProposedValueCheckF
- func ProposerValueCheckF(signer types.BeaconSigner, network types.BeaconNetwork, ...) qbft.ProposedValueCheckF
- func SyncCommitteeContributionValueCheckF(signer types.BeaconSigner, network types.BeaconNetwork, ...) qbft.ProposedValueCheckF
- type AggregatorCalls
- type AggregatorRunner
- func (r *AggregatorRunner) Decode(data []byte) error
- func (r *AggregatorRunner) Encode() ([]byte, error)
- func (r *AggregatorRunner) GetBaseRunner() *BaseRunner
- func (r *AggregatorRunner) GetBeaconNode() BeaconNode
- func (r *AggregatorRunner) GetNetwork() Network
- func (r *AggregatorRunner) GetOperatorSigner() *types.OperatorSigner
- func (r *AggregatorRunner) GetRoot() ([32]byte, error)
- func (r *AggregatorRunner) GetShare() *types.Share
- func (r *AggregatorRunner) GetSigner() types.BeaconSigner
- func (r *AggregatorRunner) GetState() *State
- func (r *AggregatorRunner) GetValCheckF() qbft.ProposedValueCheckF
- func (r *AggregatorRunner) HasRunningDuty() bool
- func (r *AggregatorRunner) ProcessConsensus(signedMsg *types.SignedSSVMessage) error
- func (r *AggregatorRunner) ProcessPostConsensus(signedMsg *types.PartialSignatureMessages) error
- func (r *AggregatorRunner) ProcessPreConsensus(signedMsg *types.PartialSignatureMessages) error
- func (r *AggregatorRunner) StartNewDuty(duty types.Duty, quorum uint64) error
- type AttesterCalls
- type BaseRunner
- func (b *BaseRunner) FallBackAndVerifyEachSignature(container *PartialSigContainer, root [32]byte, committee []*types.ShareMember, ...)
- func (b *BaseRunner) SetHighestDecidedSlot(slot spec.Slot)
- func (b *BaseRunner) ShouldProcessDuty(duty types.Duty) error
- func (b *BaseRunner) ShouldProcessNonBeaconDuty(duty types.Duty) error
- func (b *BaseRunner) ValidatePostConsensusMsg(runner Runner, psigMsgs *types.PartialSignatureMessages) error
- func (b *BaseRunner) ValidatePreConsensusMsg(runner Runner, psigMsgs *types.PartialSignatureMessages) error
- type BeaconNode
- type Committee
- func (c *Committee) Decode(data []byte) error
- func (c *Committee) Encode() ([]byte, error)
- func (c *Committee) GetRoot() ([32]byte, error)
- func (c *Committee) MarshalJSON() ([]byte, error)
- func (c *Committee) ProcessMessage(signedSSVMessage *types.SignedSSVMessage) error
- func (c *Committee) StartDuty(duty *types.CommitteeDuty) error
- func (c *Committee) UnmarshalJSON(data []byte) error
- type CommitteeRunner
- func (cr CommitteeRunner) Decode(data []byte) error
- func (cr CommitteeRunner) Encode() ([]byte, error)
- func (cr CommitteeRunner) GetBaseRunner() *BaseRunner
- func (cr CommitteeRunner) GetBeaconNode() BeaconNode
- func (cr CommitteeRunner) GetNetwork() Network
- func (cr CommitteeRunner) GetOperatorSigner() *types.OperatorSigner
- func (cr CommitteeRunner) GetRoot() ([32]byte, error)
- func (cr CommitteeRunner) GetSigner() types.BeaconSigner
- func (cr CommitteeRunner) GetValCheckF() qbft.ProposedValueCheckF
- func (cr CommitteeRunner) HasRunningDuty() bool
- func (cr *CommitteeRunner) HasSubmitted(role types.BeaconRole, valIdx phase0.ValidatorIndex) bool
- func (cr *CommitteeRunner) HasSubmittedAllValidatorDuties(attestationMap map[phase0.ValidatorIndex][32]byte, ...) bool
- func (cr CommitteeRunner) ProcessConsensus(msg *types.SignedSSVMessage) error
- func (cr CommitteeRunner) ProcessPostConsensus(signedMsg *types.PartialSignatureMessages) error
- func (cr CommitteeRunner) ProcessPreConsensus(signedMsg *types.PartialSignatureMessages) error
- func (cr *CommitteeRunner) RecordSubmission(role types.BeaconRole, valIdx phase0.ValidatorIndex)
- func (cr CommitteeRunner) StartNewDuty(duty types.Duty, quorum uint64) error
- type CreateRunnerFn
- type DomainCalls
- type DutyRunners
- type Getters
- type Network
- type PartialSigContainer
- func (ps *PartialSigContainer) AddSignature(sigMsg *types.PartialSignatureMessage)
- func (ps *PartialSigContainer) GetSignature(validatorIndex phase0.ValidatorIndex, signer types.OperatorID, ...) (types.Signature, error)
- func (ps *PartialSigContainer) GetSignatures(validatorIndex phase0.ValidatorIndex, signingRoot [32]byte) map[types.OperatorID]types.Signature
- func (ps *PartialSigContainer) HasQuorum(validatorIndex phase0.ValidatorIndex, root [32]byte) bool
- func (ps *PartialSigContainer) HasSignature(validatorIndex phase0.ValidatorIndex, signer types.OperatorID, ...) bool
- func (ps *PartialSigContainer) ReconstructSignature(root [32]byte, validatorPubKey []byte, validatorIndex phase0.ValidatorIndex) ([]byte, error)
- func (ps *PartialSigContainer) Remove(validatorIndex phase0.ValidatorIndex, signer uint64, signingRoot [32]byte)
- type ProposerCalls
- type ProposerRunner
- func (r *ProposerRunner) Decode(data []byte) error
- func (r *ProposerRunner) Encode() ([]byte, error)
- func (r *ProposerRunner) GetBaseRunner() *BaseRunner
- func (r *ProposerRunner) GetBeaconNode() BeaconNode
- func (r *ProposerRunner) GetNetwork() Network
- func (r *ProposerRunner) GetOperatorSigner() *types.OperatorSigner
- func (r *ProposerRunner) GetRoot() ([32]byte, error)
- func (r *ProposerRunner) GetShare() *types.Share
- func (r *ProposerRunner) GetSigner() types.BeaconSigner
- func (r *ProposerRunner) GetState() *State
- func (r *ProposerRunner) GetValCheckF() qbft.ProposedValueCheckF
- func (r *ProposerRunner) HasRunningDuty() bool
- func (r *ProposerRunner) ProcessConsensus(signedMsg *types.SignedSSVMessage) error
- func (r *ProposerRunner) ProcessPostConsensus(signedMsg *types.PartialSignatureMessages) error
- func (r *ProposerRunner) ProcessPreConsensus(signedMsg *types.PartialSignatureMessages) error
- func (r *ProposerRunner) StartNewDuty(duty types.Duty, quorum uint64) error
- type Runner
- func NewAggregatorRunner(beaconNetwork types.BeaconNetwork, ...) (Runner, error)
- func NewCommitteeRunner(beaconNetwork types.BeaconNetwork, ...) (Runner, error)
- func NewProposerRunner(beaconNetwork types.BeaconNetwork, ...) (Runner, error)
- func NewSyncCommitteeAggregatorRunner(beaconNetwork types.BeaconNetwork, ...) (Runner, error)
- func NewValidatorRegistrationRunner(beaconNetwork types.BeaconNetwork, ...) (Runner, error)
- func NewVoluntaryExitRunner(beaconNetwork types.BeaconNetwork, ...) (Runner, error)
- type SigningRoot
- type State
- func (pcs *State) Decode(data []byte) error
- func (pcs *State) Encode() ([]byte, error)
- func (pcs *State) GetRoot() ([32]byte, error)
- func (pcs *State) MarshalJSON() ([]byte, error)
- func (pcs *State) ReconstructBeaconSig(container *PartialSigContainer, root [32]byte, validatorPubKey []byte, ...) ([]byte, error)
- func (pcs *State) UnmarshalJSON(data []byte) error
- type SyncCommitteeAggregatorRunner
- func (r *SyncCommitteeAggregatorRunner) Decode(data []byte) error
- func (r *SyncCommitteeAggregatorRunner) Encode() ([]byte, error)
- func (r *SyncCommitteeAggregatorRunner) GetBaseRunner() *BaseRunner
- func (r *SyncCommitteeAggregatorRunner) GetBeaconNode() BeaconNode
- func (r *SyncCommitteeAggregatorRunner) GetNetwork() Network
- func (r *SyncCommitteeAggregatorRunner) GetOperatorSigner() *types.OperatorSigner
- func (r *SyncCommitteeAggregatorRunner) GetRoot() ([32]byte, error)
- func (r *SyncCommitteeAggregatorRunner) GetShare() *types.Share
- func (r *SyncCommitteeAggregatorRunner) GetSigner() types.BeaconSigner
- func (r *SyncCommitteeAggregatorRunner) GetState() *State
- func (r *SyncCommitteeAggregatorRunner) GetValCheckF() qbft.ProposedValueCheckF
- func (r *SyncCommitteeAggregatorRunner) HasRunningDuty() bool
- func (r *SyncCommitteeAggregatorRunner) ProcessConsensus(signedMsg *types.SignedSSVMessage) error
- func (r *SyncCommitteeAggregatorRunner) ProcessPostConsensus(signedMsg *types.PartialSignatureMessages) error
- func (r *SyncCommitteeAggregatorRunner) ProcessPreConsensus(signedMsg *types.PartialSignatureMessages) error
- func (r *SyncCommitteeAggregatorRunner) StartNewDuty(duty types.Duty, quorum uint64) error
- type SyncCommitteeCalls
- type SyncCommitteeContributionCalls
- type Validator
- type ValidatorRegistrationCalls
- type ValidatorRegistrationRunner
- func (r *ValidatorRegistrationRunner) Decode(data []byte) error
- func (r *ValidatorRegistrationRunner) Encode() ([]byte, error)
- func (r *ValidatorRegistrationRunner) GetBaseRunner() *BaseRunner
- func (r *ValidatorRegistrationRunner) GetBeaconNode() BeaconNode
- func (r *ValidatorRegistrationRunner) GetNetwork() Network
- func (r *ValidatorRegistrationRunner) GetOperatorSigner() *types.OperatorSigner
- func (r *ValidatorRegistrationRunner) GetRoot() ([32]byte, error)
- func (r *ValidatorRegistrationRunner) GetShare() *types.Share
- func (r *ValidatorRegistrationRunner) GetSigner() types.BeaconSigner
- func (r *ValidatorRegistrationRunner) GetState() *State
- func (r *ValidatorRegistrationRunner) GetValCheckF() qbft.ProposedValueCheckF
- func (r *ValidatorRegistrationRunner) HasRunningDuty() bool
- func (r *ValidatorRegistrationRunner) ProcessConsensus(signedMsg *types.SignedSSVMessage) error
- func (r *ValidatorRegistrationRunner) ProcessPostConsensus(signedMsg *types.PartialSignatureMessages) error
- func (r *ValidatorRegistrationRunner) ProcessPreConsensus(signedMsg *types.PartialSignatureMessages) error
- func (r *ValidatorRegistrationRunner) StartNewDuty(duty types.Duty, quorum uint64) error
- type VoluntaryExitCalls
- type VoluntaryExitRunner
- func (r *VoluntaryExitRunner) Decode(data []byte) error
- func (r *VoluntaryExitRunner) Encode() ([]byte, error)
- func (r *VoluntaryExitRunner) GetBaseRunner() *BaseRunner
- func (r *VoluntaryExitRunner) GetBeaconNode() BeaconNode
- func (r *VoluntaryExitRunner) GetNetwork() Network
- func (r *VoluntaryExitRunner) GetOperatorSigner() *types.OperatorSigner
- func (r *VoluntaryExitRunner) GetRoot() ([32]byte, error)
- func (r *VoluntaryExitRunner) GetShare() *types.Share
- func (r *VoluntaryExitRunner) GetSigner() types.BeaconSigner
- func (r *VoluntaryExitRunner) GetState() *State
- func (r *VoluntaryExitRunner) GetValCheckF() qbft.ProposedValueCheckF
- func (r *VoluntaryExitRunner) HasRunningDuty() bool
- func (r *VoluntaryExitRunner) ProcessConsensus(signedMsg *types.SignedSSVMessage) error
- func (r *VoluntaryExitRunner) ProcessPostConsensus(signedMsg *types.PartialSignatureMessages) error
- func (r *VoluntaryExitRunner) ProcessPreConsensus(signedMsg *types.PartialSignatureMessages) error
- func (r *VoluntaryExitRunner) StartNewDuty(duty types.Duty, quorum uint64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AggregatorValueCheckF ¶
func AggregatorValueCheckF( signer types.BeaconSigner, network types.BeaconNetwork, validatorPK types.ValidatorPK, validatorIndex phase0.ValidatorIndex, ) qbft.ProposedValueCheckF
func BeaconVoteValueCheckF ¶ added in v1.0.0
func BeaconVoteValueCheckF( signer types.BeaconSigner, slot phase0.Slot, sharePublicKeys []types.ShareValidatorPK, estimatedCurrentEpoch phase0.Epoch, ) qbft.ProposedValueCheckF
func ProposerValueCheckF ¶
func ProposerValueCheckF( signer types.BeaconSigner, network types.BeaconNetwork, validatorPK types.ValidatorPK, validatorIndex phase0.ValidatorIndex, sharePublicKey []byte, ) qbft.ProposedValueCheckF
func SyncCommitteeContributionValueCheckF ¶
func SyncCommitteeContributionValueCheckF( signer types.BeaconSigner, network types.BeaconNetwork, validatorPK types.ValidatorPK, validatorIndex phase0.ValidatorIndex, ) qbft.ProposedValueCheckF
Types ¶
type AggregatorCalls ¶
type AggregatorCalls interface { // SubmitAggregateSelectionProof returns an AggregateAndProof object SubmitAggregateSelectionProof(slot phase0.Slot, committeeIndex phase0.CommitteeIndex, committeeLength uint64, index phase0.ValidatorIndex, slotSig []byte) (ssz.Marshaler, spec.DataVersion, error) // SubmitSignedAggregateSelectionProof broadcasts a signed aggregator msg SubmitSignedAggregateSelectionProof(msg *phase0.SignedAggregateAndProof) error }
AggregatorCalls interface has all attestation aggregator duty specific calls
type AggregatorRunner ¶
type AggregatorRunner struct { BaseRunner *BaseRunner // contains filtered or unexported fields }
func (*AggregatorRunner) Decode ¶
func (r *AggregatorRunner) Decode(data []byte) error
func (*AggregatorRunner) Encode ¶
func (r *AggregatorRunner) Encode() ([]byte, error)
AggregatorRunner
func (*AggregatorRunner) GetBaseRunner ¶
func (r *AggregatorRunner) GetBaseRunner() *BaseRunner
func (*AggregatorRunner) GetBeaconNode ¶
func (r *AggregatorRunner) GetBeaconNode() BeaconNode
func (*AggregatorRunner) GetNetwork ¶
func (r *AggregatorRunner) GetNetwork() Network
func (*AggregatorRunner) GetOperatorSigner ¶ added in v1.0.0
func (r *AggregatorRunner) GetOperatorSigner() *types.OperatorSigner
func (*AggregatorRunner) GetRoot ¶
func (r *AggregatorRunner) GetRoot() ([32]byte, error)
func (*AggregatorRunner) GetShare ¶
func (r *AggregatorRunner) GetShare() *types.Share
func (*AggregatorRunner) GetSigner ¶
func (r *AggregatorRunner) GetSigner() types.BeaconSigner
func (*AggregatorRunner) GetState ¶
func (r *AggregatorRunner) GetState() *State
func (*AggregatorRunner) GetValCheckF ¶
func (r *AggregatorRunner) GetValCheckF() qbft.ProposedValueCheckF
func (*AggregatorRunner) HasRunningDuty ¶
func (r *AggregatorRunner) HasRunningDuty() bool
HasRunningDuty returns true if a duty is already running (StartNewDuty called and returned nil)
func (*AggregatorRunner) ProcessConsensus ¶
func (r *AggregatorRunner) ProcessConsensus(signedMsg *types.SignedSSVMessage) error
func (*AggregatorRunner) ProcessPostConsensus ¶
func (r *AggregatorRunner) ProcessPostConsensus(signedMsg *types.PartialSignatureMessages) error
func (*AggregatorRunner) ProcessPreConsensus ¶
func (r *AggregatorRunner) ProcessPreConsensus(signedMsg *types.PartialSignatureMessages) error
func (*AggregatorRunner) StartNewDuty ¶
func (r *AggregatorRunner) StartNewDuty(duty types.Duty, quorum uint64) error
type AttesterCalls ¶
type AttesterCalls interface { // GetAttestationData returns attestation data by the given slot and committee index GetAttestationData(slot phase0.Slot, committeeIndex phase0.CommitteeIndex) (*phase0.AttestationData, spec.DataVersion, error) // SubmitAttestation submit the attestation to the node SubmitAttestations(attestations []*phase0.Attestation) error }
AttesterCalls interface has all attester duty specific calls
type BaseRunner ¶
type BaseRunner struct { State *State QBFTController *qbft.Controller BeaconNetwork types.BeaconNetwork RunnerRoleType types.RunnerRole *types.OperatorSigner // contains filtered or unexported fields }
func NewBaseRunner ¶
func NewBaseRunner( state *State, share map[spec.ValidatorIndex]*types.Share, controller *qbft.Controller, beaconNetwork types.BeaconNetwork, runnerRoleType types.RunnerRole, highestDecidedSlot spec.Slot, ) *BaseRunner
func (*BaseRunner) FallBackAndVerifyEachSignature ¶
func (b *BaseRunner) FallBackAndVerifyEachSignature(container *PartialSigContainer, root [32]byte, committee []*types.ShareMember, validatorIndex spec.ValidatorIndex)
Verify each signature in container removing the invalid ones
func (*BaseRunner) SetHighestDecidedSlot ¶
func (b *BaseRunner) SetHighestDecidedSlot(slot spec.Slot)
SetHighestDecidedSlot set highestDecidedSlot for base runner
func (*BaseRunner) ShouldProcessDuty ¶
func (b *BaseRunner) ShouldProcessDuty(duty types.Duty) error
func (*BaseRunner) ShouldProcessNonBeaconDuty ¶
func (b *BaseRunner) ShouldProcessNonBeaconDuty(duty types.Duty) error
func (*BaseRunner) ValidatePostConsensusMsg ¶
func (b *BaseRunner) ValidatePostConsensusMsg(runner Runner, psigMsgs *types.PartialSignatureMessages) error
func (*BaseRunner) ValidatePreConsensusMsg ¶
func (b *BaseRunner) ValidatePreConsensusMsg(runner Runner, psigMsgs *types.PartialSignatureMessages) error
type BeaconNode ¶
type BeaconNode interface { // GetBeaconNetwork returns the beacon network the node is on GetBeaconNetwork() types.BeaconNetwork AttesterCalls ProposerCalls AggregatorCalls SyncCommitteeCalls SyncCommitteeContributionCalls ValidatorRegistrationCalls VoluntaryExitCalls DomainCalls }
type Committee ¶ added in v1.0.0
type Committee struct { Runners map[spec.Slot]*CommitteeRunner CommitteeMember types.CommitteeMember CreateRunnerFn CreateRunnerFn }
func NewCommittee ¶ added in v1.0.0
func NewCommittee( committeeMember types.CommitteeMember, share map[spec.ValidatorIndex]*types.Share, createRunnerFn CreateRunnerFn, ) *Committee
NewCommittee creates a new cluster
func (*Committee) MarshalJSON ¶ added in v1.0.0
func (*Committee) ProcessMessage ¶ added in v1.0.0
func (c *Committee) ProcessMessage(signedSSVMessage *types.SignedSSVMessage) error
ProcessMessage processes Network Message of all types
func (*Committee) StartDuty ¶ added in v1.0.0
func (c *Committee) StartDuty(duty *types.CommitteeDuty) error
StartDuty starts a new duty for the given slot
func (*Committee) UnmarshalJSON ¶ added in v1.0.0
type CommitteeRunner ¶ added in v1.0.0
type CommitteeRunner struct { BaseRunner *BaseRunner // contains filtered or unexported fields }
func (CommitteeRunner) Decode ¶ added in v1.0.0
func (cr CommitteeRunner) Decode(data []byte) error
func (CommitteeRunner) Encode ¶ added in v1.0.0
func (cr CommitteeRunner) Encode() ([]byte, error)
CommitteeRunner
func (CommitteeRunner) GetBaseRunner ¶ added in v1.0.0
func (cr CommitteeRunner) GetBaseRunner() *BaseRunner
func (CommitteeRunner) GetBeaconNode ¶ added in v1.0.0
func (cr CommitteeRunner) GetBeaconNode() BeaconNode
func (CommitteeRunner) GetNetwork ¶ added in v1.0.0
func (cr CommitteeRunner) GetNetwork() Network
func (CommitteeRunner) GetOperatorSigner ¶ added in v1.0.0
func (cr CommitteeRunner) GetOperatorSigner() *types.OperatorSigner
func (CommitteeRunner) GetRoot ¶ added in v1.0.0
func (cr CommitteeRunner) GetRoot() ([32]byte, error)
func (CommitteeRunner) GetSigner ¶ added in v1.0.0
func (cr CommitteeRunner) GetSigner() types.BeaconSigner
func (CommitteeRunner) GetValCheckF ¶ added in v1.0.0
func (cr CommitteeRunner) GetValCheckF() qbft.ProposedValueCheckF
func (CommitteeRunner) HasRunningDuty ¶ added in v1.0.0
func (cr CommitteeRunner) HasRunningDuty() bool
func (*CommitteeRunner) HasSubmitted ¶ added in v1.0.0
func (cr *CommitteeRunner) HasSubmitted(role types.BeaconRole, valIdx phase0.ValidatorIndex) bool
Returns true if there is a record of submission for the (role, validator index, slot) tuple
func (*CommitteeRunner) HasSubmittedAllValidatorDuties ¶ added in v1.0.0
func (cr *CommitteeRunner) HasSubmittedAllValidatorDuties(attestationMap map[phase0.ValidatorIndex][32]byte, syncCommitteeMap map[phase0.ValidatorIndex][32]byte) bool
Returns true if the runner has done submissions for all validators for the given slot
func (CommitteeRunner) ProcessConsensus ¶ added in v1.0.0
func (cr CommitteeRunner) ProcessConsensus(msg *types.SignedSSVMessage) error
func (CommitteeRunner) ProcessPostConsensus ¶ added in v1.0.0
func (cr CommitteeRunner) ProcessPostConsensus(signedMsg *types.PartialSignatureMessages) error
func (CommitteeRunner) ProcessPreConsensus ¶ added in v1.0.0
func (cr CommitteeRunner) ProcessPreConsensus(signedMsg *types.PartialSignatureMessages) error
func (*CommitteeRunner) RecordSubmission ¶ added in v1.0.0
func (cr *CommitteeRunner) RecordSubmission(role types.BeaconRole, valIdx phase0.ValidatorIndex)
Records a submission for the (role, validator index, slot) tuple
func (CommitteeRunner) StartNewDuty ¶ added in v1.0.0
func (cr CommitteeRunner) StartNewDuty(duty types.Duty, quorum uint64) error
type CreateRunnerFn ¶ added in v1.0.0
type CreateRunnerFn func(shareMap map[spec.ValidatorIndex]*types.Share) *CommitteeRunner
type DomainCalls ¶
type DutyRunners ¶
type DutyRunners map[types.RunnerRole]Runner
DutyRunners is a map of duty runners mapped by msg id hex.
func (DutyRunners) DutyRunnerForMsgID ¶
func (ci DutyRunners) DutyRunnerForMsgID(msgID types.MessageID) Runner
DutyRunnerForMsgID returns a Runner from the provided msg ID, or nil if not found
type Getters ¶
type Getters interface { GetBaseRunner() *BaseRunner GetBeaconNode() BeaconNode GetValCheckF() qbft.ProposedValueCheckF GetSigner() types.BeaconSigner GetOperatorSigner() *types.OperatorSigner GetNetwork() Network }
type PartialSigContainer ¶
type PartialSigContainer struct { // Signature map: validator index -> signing root -> operator id (signer) -> signature (from the signer for the validator's signing root) Signatures map[phase0.ValidatorIndex]map[SigningRoot]map[types.OperatorID]types.Signature // Quorum is the number of min signatures needed for quorum Quorum uint64 }
func NewPartialSigContainer ¶
func NewPartialSigContainer(quorum uint64) *PartialSigContainer
func (*PartialSigContainer) AddSignature ¶
func (ps *PartialSigContainer) AddSignature(sigMsg *types.PartialSignatureMessage)
func (*PartialSigContainer) GetSignature ¶
func (ps *PartialSigContainer) GetSignature(validatorIndex phase0.ValidatorIndex, signer types.OperatorID, signingRoot [32]byte) (types.Signature, error)
GetSignature returns the signature for a given root and signer
func (*PartialSigContainer) GetSignatures ¶
func (ps *PartialSigContainer) GetSignatures(validatorIndex phase0.ValidatorIndex, signingRoot [32]byte) map[types.OperatorID]types.Signature
Return signature map for given root
func (*PartialSigContainer) HasQuorum ¶
func (ps *PartialSigContainer) HasQuorum(validatorIndex phase0.ValidatorIndex, root [32]byte) bool
func (*PartialSigContainer) HasSignature ¶ added in v1.0.0
func (ps *PartialSigContainer) HasSignature(validatorIndex phase0.ValidatorIndex, signer types.OperatorID, signingRoot [32]byte) bool
HasSigner returns true if container has signature for signer and signing root, else it returns false
func (*PartialSigContainer) ReconstructSignature ¶
func (ps *PartialSigContainer) ReconstructSignature(root [32]byte, validatorPubKey []byte, validatorIndex phase0.ValidatorIndex) ([]byte, error)
func (*PartialSigContainer) Remove ¶
func (ps *PartialSigContainer) Remove(validatorIndex phase0.ValidatorIndex, signer uint64, signingRoot [32]byte)
Remove signer from signature map
type ProposerCalls ¶
type ProposerCalls interface { // GetBeaconBlock returns beacon block by the given slot, graffiti, and randao. GetBeaconBlock(slot phase0.Slot, graffiti, randao []byte) (ssz.Marshaler, spec.DataVersion, error) // SubmitBeaconBlock submit the block to the node SubmitBeaconBlock(block *api.VersionedProposal, sig phase0.BLSSignature) error // SubmitBlindedBeaconBlock submit the blinded block to the node SubmitBlindedBeaconBlock(block *api.VersionedBlindedProposal, sig phase0.BLSSignature) error }
ProposerCalls interface has all block proposer duty specific calls
type ProposerRunner ¶
type ProposerRunner struct { BaseRunner *BaseRunner // contains filtered or unexported fields }
func (*ProposerRunner) Decode ¶
func (r *ProposerRunner) Decode(data []byte) error
func (*ProposerRunner) GetBaseRunner ¶
func (r *ProposerRunner) GetBaseRunner() *BaseRunner
func (*ProposerRunner) GetBeaconNode ¶
func (r *ProposerRunner) GetBeaconNode() BeaconNode
func (*ProposerRunner) GetNetwork ¶
func (r *ProposerRunner) GetNetwork() Network
func (*ProposerRunner) GetOperatorSigner ¶ added in v1.0.0
func (r *ProposerRunner) GetOperatorSigner() *types.OperatorSigner
func (*ProposerRunner) GetRoot ¶
func (r *ProposerRunner) GetRoot() ([32]byte, error)
func (*ProposerRunner) GetShare ¶
func (r *ProposerRunner) GetShare() *types.Share
func (*ProposerRunner) GetSigner ¶
func (r *ProposerRunner) GetSigner() types.BeaconSigner
func (*ProposerRunner) GetState ¶
func (r *ProposerRunner) GetState() *State
func (*ProposerRunner) GetValCheckF ¶
func (r *ProposerRunner) GetValCheckF() qbft.ProposedValueCheckF
func (*ProposerRunner) HasRunningDuty ¶
func (r *ProposerRunner) HasRunningDuty() bool
HasRunningDuty returns true if a duty is already running (StartNewDuty called and returned nil)
func (*ProposerRunner) ProcessConsensus ¶
func (r *ProposerRunner) ProcessConsensus(signedMsg *types.SignedSSVMessage) error
func (*ProposerRunner) ProcessPostConsensus ¶
func (r *ProposerRunner) ProcessPostConsensus(signedMsg *types.PartialSignatureMessages) error
func (*ProposerRunner) ProcessPreConsensus ¶
func (r *ProposerRunner) ProcessPreConsensus(signedMsg *types.PartialSignatureMessages) error
func (*ProposerRunner) StartNewDuty ¶
func (r *ProposerRunner) StartNewDuty(duty types.Duty, quorum uint64) error
type Runner ¶
type Runner interface { types.Encoder types.Root Getters // StartNewDuty starts a new duty for the runner, returns error if can't StartNewDuty(duty types.Duty, quorum uint64) error // HasRunningDuty returns true if it has a running duty HasRunningDuty() bool // ProcessPreConsensus processes all pre-consensus msgs, returns error if can't process ProcessPreConsensus(signedMsg *types.PartialSignatureMessages) error // ProcessConsensus processes all consensus msgs, returns error if can't process ProcessConsensus(msg *types.SignedSSVMessage) error // ProcessPostConsensus processes all post-consensus msgs, returns error if can't process ProcessPostConsensus(signedMsg *types.PartialSignatureMessages) error // contains filtered or unexported methods }
func NewAggregatorRunner ¶
func NewAggregatorRunner( beaconNetwork types.BeaconNetwork, share map[phase0.ValidatorIndex]*types.Share, qbftController *qbft.Controller, beacon BeaconNode, network Network, signer types.BeaconSigner, operatorSigner *types.OperatorSigner, valCheck qbft.ProposedValueCheckF, highestDecidedSlot phase0.Slot, ) (Runner, error)
func NewCommitteeRunner ¶ added in v1.0.0
func NewCommitteeRunner(beaconNetwork types.BeaconNetwork, share map[phase0.ValidatorIndex]*types.Share, qbftController *qbft.Controller, beacon BeaconNode, network Network, signer types.BeaconSigner, operatorSigner *types.OperatorSigner, valCheck qbft.ProposedValueCheckF, ) (Runner, error)
func NewProposerRunner ¶
func NewProposerRunner( beaconNetwork types.BeaconNetwork, share map[phase0.ValidatorIndex]*types.Share, qbftController *qbft.Controller, beacon BeaconNode, network Network, signer types.BeaconSigner, operatorSigner *types.OperatorSigner, valCheck qbft.ProposedValueCheckF, highestDecidedSlot phase0.Slot, ) (Runner, error)
func NewSyncCommitteeAggregatorRunner ¶
func NewSyncCommitteeAggregatorRunner( beaconNetwork types.BeaconNetwork, share map[phase0.ValidatorIndex]*types.Share, qbftController *qbft.Controller, beacon BeaconNode, network Network, signer types.BeaconSigner, operatorSigner *types.OperatorSigner, valCheck qbft.ProposedValueCheckF, highestDecidedSlot phase0.Slot, ) (Runner, error)
func NewValidatorRegistrationRunner ¶
func NewValidatorRegistrationRunner( beaconNetwork types.BeaconNetwork, share map[phase0.ValidatorIndex]*types.Share, beacon BeaconNode, network Network, signer types.BeaconSigner, operatorSigner *types.OperatorSigner, ) (Runner, error)
func NewVoluntaryExitRunner ¶
func NewVoluntaryExitRunner( beaconNetwork types.BeaconNetwork, share map[phase0.ValidatorIndex]*types.Share, beacon BeaconNode, network Network, signer types.BeaconSigner, operatorSigner *types.OperatorSigner, ) (Runner, error)
type SigningRoot ¶ added in v1.0.0
type SigningRoot string
type State ¶
type State struct { PreConsensusContainer *PartialSigContainer PostConsensusContainer *PartialSigContainer RunningInstance *qbft.Instance DecidedValue []byte // CurrentDuty is the duty the node pulled locally from the beacon node, might be different from decided duty StartingDuty types.Duty // flags Finished bool // Finished marked true when there is a full successful cycle (pre, consensus and post) with quorum }
State holds all the relevant progress the duty execution progress
func (*State) MarshalJSON ¶ added in v1.0.0
func (*State) ReconstructBeaconSig ¶
func (pcs *State) ReconstructBeaconSig(container *PartialSigContainer, root [32]byte, validatorPubKey []byte, validatorIndex phase0.ValidatorIndex) ([]byte, error)
ReconstructBeaconSig aggregates collected partial beacon sigs
func (*State) UnmarshalJSON ¶ added in v1.0.0
type SyncCommitteeAggregatorRunner ¶
type SyncCommitteeAggregatorRunner struct { BaseRunner *BaseRunner // contains filtered or unexported fields }
func (*SyncCommitteeAggregatorRunner) Decode ¶
func (r *SyncCommitteeAggregatorRunner) Decode(data []byte) error
func (*SyncCommitteeAggregatorRunner) Encode ¶
func (r *SyncCommitteeAggregatorRunner) Encode() ([]byte, error)
SyncCommitteeAggregatorRunner
func (*SyncCommitteeAggregatorRunner) GetBaseRunner ¶
func (r *SyncCommitteeAggregatorRunner) GetBaseRunner() *BaseRunner
func (*SyncCommitteeAggregatorRunner) GetBeaconNode ¶
func (r *SyncCommitteeAggregatorRunner) GetBeaconNode() BeaconNode
func (*SyncCommitteeAggregatorRunner) GetNetwork ¶
func (r *SyncCommitteeAggregatorRunner) GetNetwork() Network
func (*SyncCommitteeAggregatorRunner) GetOperatorSigner ¶ added in v1.0.0
func (r *SyncCommitteeAggregatorRunner) GetOperatorSigner() *types.OperatorSigner
func (*SyncCommitteeAggregatorRunner) GetRoot ¶
func (r *SyncCommitteeAggregatorRunner) GetRoot() ([32]byte, error)
func (*SyncCommitteeAggregatorRunner) GetShare ¶
func (r *SyncCommitteeAggregatorRunner) GetShare() *types.Share
func (*SyncCommitteeAggregatorRunner) GetSigner ¶
func (r *SyncCommitteeAggregatorRunner) GetSigner() types.BeaconSigner
func (*SyncCommitteeAggregatorRunner) GetState ¶
func (r *SyncCommitteeAggregatorRunner) GetState() *State
func (*SyncCommitteeAggregatorRunner) GetValCheckF ¶
func (r *SyncCommitteeAggregatorRunner) GetValCheckF() qbft.ProposedValueCheckF
func (*SyncCommitteeAggregatorRunner) HasRunningDuty ¶
func (r *SyncCommitteeAggregatorRunner) HasRunningDuty() bool
HasRunningDuty returns true if a duty is already running (StartNewDuty called and returned nil)
func (*SyncCommitteeAggregatorRunner) ProcessConsensus ¶
func (r *SyncCommitteeAggregatorRunner) ProcessConsensus(signedMsg *types.SignedSSVMessage) error
func (*SyncCommitteeAggregatorRunner) ProcessPostConsensus ¶
func (r *SyncCommitteeAggregatorRunner) ProcessPostConsensus(signedMsg *types.PartialSignatureMessages) error
func (*SyncCommitteeAggregatorRunner) ProcessPreConsensus ¶
func (r *SyncCommitteeAggregatorRunner) ProcessPreConsensus(signedMsg *types.PartialSignatureMessages) error
func (*SyncCommitteeAggregatorRunner) StartNewDuty ¶
func (r *SyncCommitteeAggregatorRunner) StartNewDuty(duty types.Duty, quorum uint64) error
type SyncCommitteeCalls ¶
type SyncCommitteeCalls interface { // GetSyncMessageBlockRoot returns beacon block root for sync committee GetSyncMessageBlockRoot(slot phase0.Slot) (phase0.Root, spec.DataVersion, error) // SubmitSyncMessage submits a signed sync committee msg SubmitSyncMessages(msgs []*altair.SyncCommitteeMessage) error }
SyncCommitteeCalls interface has all sync committee duty specific calls
type SyncCommitteeContributionCalls ¶
type SyncCommitteeContributionCalls interface { // IsSyncCommitteeAggregator returns true if aggregator IsSyncCommitteeAggregator(proof []byte) (bool, error) // SyncCommitteeSubnetID returns sync committee subnet ID from subcommittee index SyncCommitteeSubnetID(index phase0.CommitteeIndex) (uint64, error) // GetSyncCommitteeContribution returns a types.Contributions object GetSyncCommitteeContribution(slot phase0.Slot, selectionProofs []phase0.BLSSignature, subnetIDs []uint64) (ssz.Marshaler, spec.DataVersion, error) // SubmitSignedContributionAndProof broadcasts to the network SubmitSignedContributionAndProof(contribution *altair.SignedContributionAndProof) error }
SyncCommitteeContributionCalls interface has all sync committee contribution duty specific calls
type Validator ¶
type Validator struct { DutyRunners DutyRunners Network Network Beacon BeaconNode CommitteeMember *types.CommitteeMember Signer types.BeaconSigner OperatorSigner *types.OperatorSigner }
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 ¶
func NewValidator( network Network, beacon BeaconNode, committeeMember *types.CommitteeMember, share *types.Share, signer types.BeaconSigner, operatorSigner *types.OperatorSigner, runners map[types.RunnerRole]Runner, ) *Validator
func (*Validator) ProcessMessage ¶
func (v *Validator) ProcessMessage(signedSSVMessage *types.SignedSSVMessage) error
ProcessMessage processes Network Message of all types
type ValidatorRegistrationCalls ¶
type ValidatorRegistrationCalls interface { // SubmitValidatorRegistration submits a validator registration SubmitValidatorRegistration(pubkey []byte, feeRecipient bellatrix.ExecutionAddress, sig phase0.BLSSignature) error }
ValidatorRegistrationCalls interface has all validator registration duty specific calls
type ValidatorRegistrationRunner ¶
type ValidatorRegistrationRunner struct { BaseRunner *BaseRunner // contains filtered or unexported fields }
func (*ValidatorRegistrationRunner) Decode ¶
func (r *ValidatorRegistrationRunner) Decode(data []byte) error
func (*ValidatorRegistrationRunner) Encode ¶
func (r *ValidatorRegistrationRunner) Encode() ([]byte, error)
ValidatorRegistrationRunner
func (*ValidatorRegistrationRunner) GetBaseRunner ¶
func (r *ValidatorRegistrationRunner) GetBaseRunner() *BaseRunner
func (*ValidatorRegistrationRunner) GetBeaconNode ¶
func (r *ValidatorRegistrationRunner) GetBeaconNode() BeaconNode
func (*ValidatorRegistrationRunner) GetNetwork ¶
func (r *ValidatorRegistrationRunner) GetNetwork() Network
func (*ValidatorRegistrationRunner) GetOperatorSigner ¶ added in v1.0.0
func (r *ValidatorRegistrationRunner) GetOperatorSigner() *types.OperatorSigner
func (*ValidatorRegistrationRunner) GetRoot ¶
func (r *ValidatorRegistrationRunner) GetRoot() ([32]byte, error)
func (*ValidatorRegistrationRunner) GetShare ¶
func (r *ValidatorRegistrationRunner) GetShare() *types.Share
func (*ValidatorRegistrationRunner) GetSigner ¶
func (r *ValidatorRegistrationRunner) GetSigner() types.BeaconSigner
func (*ValidatorRegistrationRunner) GetState ¶
func (r *ValidatorRegistrationRunner) GetState() *State
func (*ValidatorRegistrationRunner) GetValCheckF ¶
func (r *ValidatorRegistrationRunner) GetValCheckF() qbft.ProposedValueCheckF
func (*ValidatorRegistrationRunner) HasRunningDuty ¶
func (r *ValidatorRegistrationRunner) HasRunningDuty() bool
HasRunningDuty returns true if a duty is already running (StartNewDuty called and returned nil)
func (*ValidatorRegistrationRunner) ProcessConsensus ¶
func (r *ValidatorRegistrationRunner) ProcessConsensus(signedMsg *types.SignedSSVMessage) error
func (*ValidatorRegistrationRunner) ProcessPostConsensus ¶
func (r *ValidatorRegistrationRunner) ProcessPostConsensus(signedMsg *types.PartialSignatureMessages) error
func (*ValidatorRegistrationRunner) ProcessPreConsensus ¶
func (r *ValidatorRegistrationRunner) ProcessPreConsensus(signedMsg *types.PartialSignatureMessages) error
func (*ValidatorRegistrationRunner) StartNewDuty ¶
func (r *ValidatorRegistrationRunner) StartNewDuty(duty types.Duty, quorum uint64) error
type VoluntaryExitCalls ¶
type VoluntaryExitCalls interface { // SubmitVoluntaryExit submits a validator voluntary exit SubmitVoluntaryExit(voluntaryExit *phase0.SignedVoluntaryExit) error }
VoluntaryExitCalls interface has all validator voluntary exit duty specific calls
type VoluntaryExitRunner ¶
type VoluntaryExitRunner struct { BaseRunner *BaseRunner // contains filtered or unexported fields }
ValidatorDuty runner for validator voluntary exit duty
func (*VoluntaryExitRunner) Decode ¶
func (r *VoluntaryExitRunner) Decode(data []byte) error
func (*VoluntaryExitRunner) Encode ¶
func (r *VoluntaryExitRunner) Encode() ([]byte, error)
VoluntaryExitRunner
func (*VoluntaryExitRunner) GetBaseRunner ¶
func (r *VoluntaryExitRunner) GetBaseRunner() *BaseRunner
func (*VoluntaryExitRunner) GetBeaconNode ¶
func (r *VoluntaryExitRunner) GetBeaconNode() BeaconNode
func (*VoluntaryExitRunner) GetNetwork ¶
func (r *VoluntaryExitRunner) GetNetwork() Network
func (*VoluntaryExitRunner) GetOperatorSigner ¶ added in v1.0.0
func (r *VoluntaryExitRunner) GetOperatorSigner() *types.OperatorSigner
func (*VoluntaryExitRunner) GetRoot ¶
func (r *VoluntaryExitRunner) GetRoot() ([32]byte, error)
func (*VoluntaryExitRunner) GetShare ¶
func (r *VoluntaryExitRunner) GetShare() *types.Share
func (*VoluntaryExitRunner) GetSigner ¶
func (r *VoluntaryExitRunner) GetSigner() types.BeaconSigner
func (*VoluntaryExitRunner) GetState ¶
func (r *VoluntaryExitRunner) GetState() *State
func (*VoluntaryExitRunner) GetValCheckF ¶
func (r *VoluntaryExitRunner) GetValCheckF() qbft.ProposedValueCheckF
func (*VoluntaryExitRunner) HasRunningDuty ¶
func (r *VoluntaryExitRunner) HasRunningDuty() bool
HasRunningDuty returns true if a duty is already running (StartNewDuty called and returned nil)
func (*VoluntaryExitRunner) ProcessConsensus ¶
func (r *VoluntaryExitRunner) ProcessConsensus(signedMsg *types.SignedSSVMessage) error
func (*VoluntaryExitRunner) ProcessPostConsensus ¶
func (r *VoluntaryExitRunner) ProcessPostConsensus(signedMsg *types.PartialSignatureMessages) error
func (*VoluntaryExitRunner) ProcessPreConsensus ¶
func (r *VoluntaryExitRunner) ProcessPreConsensus(signedMsg *types.PartialSignatureMessages) error
ProcessPreConsensus Check for quorum of partial signatures over VoluntaryExit and, if has quorum, constructs SignedVoluntaryExit and submits to BeaconNode
func (*VoluntaryExitRunner) StartNewDuty ¶
func (r *VoluntaryExitRunner) StartNewDuty(duty types.Duty, quorum uint64) error