ssv

package
v0.2.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2022 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregatorValueCheckF added in v0.2.7

func AggregatorValueCheckF(
	signer types.BeaconSigner,
	network types.BeaconNetwork,
	validatorPK types.ValidatorPK,
	validatorIndex phase0.ValidatorIndex,
) qbft.ProposedValueCheckF

func AttesterValueCheckF added in v0.2.7

func AttesterValueCheckF(
	signer types.BeaconSigner,
	network types.BeaconNetwork,
	validatorPK types.ValidatorPK,
	validatorIndex phase0.ValidatorIndex,
) qbft.ProposedValueCheckF

func ProposerValueCheckF added in v0.2.7

func ProposerValueCheckF(
	signer types.BeaconSigner,
	network types.BeaconNetwork,
	validatorPK types.ValidatorPK,
	validatorIndex phase0.ValidatorIndex,
) qbft.ProposedValueCheckF

func SyncCommitteeContributionValueCheckF added in v0.2.7

func SyncCommitteeContributionValueCheckF(
	signer types.BeaconSigner,
	network types.BeaconNetwork,
	validatorPK types.ValidatorPK,
	validatorIndex phase0.ValidatorIndex,
) qbft.ProposedValueCheckF

func SyncCommitteeValueCheckF added in v0.2.7

func SyncCommitteeValueCheckF(
	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, slotSig []byte) (*phase0.AggregateAndProof, error)
	// SubmitSignedAggregateSelectionProof broadcasts a signed aggregator msg
	SubmitSignedAggregateSelectionProof(msg *phase0.SignedAggregateAndProof) error
}

AggregatorCalls interface has all attestation aggregator duty specific calls

type AggregatorRunner added in v0.2.7

type AggregatorRunner struct {
	BaseRunner *BaseRunner
	// contains filtered or unexported fields
}

func (*AggregatorRunner) Decode added in v0.2.7

func (r *AggregatorRunner) Decode(data []byte) error

Decode returns error if decoding failed

func (*AggregatorRunner) Encode added in v0.2.7

func (r *AggregatorRunner) Encode() ([]byte, error)

Encode returns the encoded struct in bytes or error

func (*AggregatorRunner) GetBaseRunner added in v0.2.7

func (r *AggregatorRunner) GetBaseRunner() *BaseRunner

func (*AggregatorRunner) GetBeaconNode added in v0.2.7

func (r *AggregatorRunner) GetBeaconNode() BeaconNode

func (*AggregatorRunner) GetNetwork added in v0.2.7

func (r *AggregatorRunner) GetNetwork() Network

func (*AggregatorRunner) GetRoot added in v0.2.7

func (r *AggregatorRunner) GetRoot() ([]byte, error)

GetRoot returns the root used for signing and verification

func (*AggregatorRunner) GetShare added in v0.2.7

func (r *AggregatorRunner) GetShare() *types.Share

func (*AggregatorRunner) GetSigner added in v0.2.7

func (r *AggregatorRunner) GetSigner() types.KeyManager

func (*AggregatorRunner) GetState added in v0.2.7

func (r *AggregatorRunner) GetState() *State

func (*AggregatorRunner) GetValCheckF added in v0.2.7

func (r *AggregatorRunner) GetValCheckF() qbft.ProposedValueCheckF

func (*AggregatorRunner) HasRunningDuty added in v0.2.7

func (r *AggregatorRunner) HasRunningDuty() bool

HasRunningDuty returns true if a duty is already running (StartNewDuty called and returned nil)

func (*AggregatorRunner) ProcessConsensus added in v0.2.7

func (r *AggregatorRunner) ProcessConsensus(signedMsg *qbft.SignedMessage) error

func (*AggregatorRunner) ProcessPostConsensus added in v0.2.7

func (r *AggregatorRunner) ProcessPostConsensus(signedMsg *SignedPartialSignatureMessage) error

func (*AggregatorRunner) ProcessPreConsensus added in v0.2.7

func (r *AggregatorRunner) ProcessPreConsensus(signedMsg *SignedPartialSignatureMessage) error

func (*AggregatorRunner) StartNewDuty added in v0.2.7

func (r *AggregatorRunner) StartNewDuty(duty *types.Duty) 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, error)
	// SubmitAttestation submit the attestation to the node
	SubmitAttestation(attestation *phase0.Attestation) error
}

AttesterCalls interface has all attester duty specific calls

type AttesterRunner added in v0.2.7

type AttesterRunner struct {
	BaseRunner *BaseRunner
	// contains filtered or unexported fields
}

func (*AttesterRunner) Decode added in v0.2.7

func (r *AttesterRunner) Decode(data []byte) error

Decode returns error if decoding failed

func (*AttesterRunner) Encode added in v0.2.7

func (r *AttesterRunner) Encode() ([]byte, error)

Encode returns the encoded struct in bytes or error

func (*AttesterRunner) GetBaseRunner added in v0.2.7

func (r *AttesterRunner) GetBaseRunner() *BaseRunner

func (*AttesterRunner) GetBeaconNode added in v0.2.7

func (r *AttesterRunner) GetBeaconNode() BeaconNode

func (*AttesterRunner) GetNetwork added in v0.2.7

func (r *AttesterRunner) GetNetwork() Network

func (*AttesterRunner) GetRoot added in v0.2.7

func (r *AttesterRunner) GetRoot() ([]byte, error)

GetRoot returns the root used for signing and verification

func (*AttesterRunner) GetShare added in v0.2.7

func (r *AttesterRunner) GetShare() *types.Share

func (*AttesterRunner) GetSigner added in v0.2.7

func (r *AttesterRunner) GetSigner() types.KeyManager

func (*AttesterRunner) GetState added in v0.2.7

func (r *AttesterRunner) GetState() *State

func (*AttesterRunner) GetValCheckF added in v0.2.7

func (r *AttesterRunner) GetValCheckF() qbft.ProposedValueCheckF

func (*AttesterRunner) HasRunningDuty added in v0.2.7

func (r *AttesterRunner) HasRunningDuty() bool

HasRunningDuty returns true if a duty is already running (StartNewDuty called and returned nil)

func (*AttesterRunner) ProcessConsensus added in v0.2.7

func (r *AttesterRunner) ProcessConsensus(signedMsg *qbft.SignedMessage) error

func (*AttesterRunner) ProcessPostConsensus added in v0.2.7

func (r *AttesterRunner) ProcessPostConsensus(signedMsg *SignedPartialSignatureMessage) error

func (*AttesterRunner) ProcessPreConsensus added in v0.2.7

func (r *AttesterRunner) ProcessPreConsensus(signedMsg *SignedPartialSignatureMessage) error

func (*AttesterRunner) StartNewDuty added in v0.2.7

func (r *AttesterRunner) StartNewDuty(duty *types.Duty) error

type BaseRunner added in v0.2.7

type BaseRunner struct {
	State          *State
	Share          *types.Share
	QBFTController *qbft.Controller
	BeaconNetwork  types.BeaconNetwork
	BeaconRoleType types.BeaconRole
}

func (*BaseRunner) HashRunningDuty added in v0.2.7

func (b *BaseRunner) HashRunningDuty() bool

type BeaconNode

type BeaconNode interface {
	// GetBeaconNetwork returns the beacon network the node is on
	GetBeaconNetwork() types.BeaconNetwork
	AttesterCalls
	ProposerCalls
	AggregatorCalls
	SyncCommitteeCalls
	SyncCommitteeContributionCalls
	DomainCalls
}

type DomainCalls added in v0.2.7

type DomainCalls interface {
	DomainData(epoch phase0.Epoch, domain phase0.DomainType) (phase0.Domain, error)
}

type DutyRunners

type DutyRunners map[types.BeaconRole]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 added in v0.2.7

type Getters interface {
	GetBaseRunner() *BaseRunner
	GetBeaconNode() BeaconNode
	GetValCheckF() qbft.ProposedValueCheckF
	GetSigner() types.KeyManager
	GetNetwork() Network
}

type Network

type Network interface {
	p2p.Broadcaster
}

Network is the network interface for SSV

type PartialSigContainer

type PartialSigContainer struct {
	Signatures map[string]map[types.OperatorID][]byte
	// 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 *PartialSignatureMessage) error

func (*PartialSigContainer) HasQuorum

func (ps *PartialSigContainer) HasQuorum(root []byte) bool

func (*PartialSigContainer) ReconstructSignature

func (ps *PartialSigContainer) ReconstructSignature(root, validatorPubKey []byte) ([]byte, error)

type PartialSigMsgType

type PartialSigMsgType uint64
const (
	// PostConsensusPartialSig is a partial signature over a decided duty (attestation data, block, etc)
	PostConsensusPartialSig PartialSigMsgType = iota
	// RandaoPartialSig is a partial signature over randao reveal
	RandaoPartialSig
	// SelectionProofPartialSig is a partial signature for aggregator selection proof
	SelectionProofPartialSig
	// ContributionProofs is the partial selection proofs for sync committee contributions (it's an array of sigs)
	ContributionProofs
)

type PartialSignatureMessage

type PartialSignatureMessage struct {
	Slot             spec.Slot // Slot represents the slot for which the partial BN signature is for
	PartialSignature []byte    // The Beacon chain partial Signature for a duty
	SigningRoot      []byte    // the root signed in PartialSignature
	Signer           types.OperatorID
}

PartialSignatureMessage is a msg for partial Beacon chain related signatures (like partial attestation, block, randao sigs)

func (*PartialSignatureMessage) Decode

func (pcsm *PartialSignatureMessage) Decode(data []byte) error

Decode returns error if decoding failed

func (*PartialSignatureMessage) Encode

func (pcsm *PartialSignatureMessage) Encode() ([]byte, error)

Encode returns a msg encoded bytes or error

func (*PartialSignatureMessage) GetRoot

func (pcsm *PartialSignatureMessage) GetRoot() ([]byte, error)

func (*PartialSignatureMessage) Validate

func (pcsm *PartialSignatureMessage) Validate() error

type PartialSignatureMessages

type PartialSignatureMessages struct {
	Type     PartialSigMsgType
	Messages []*PartialSignatureMessage
}

func (*PartialSignatureMessages) Decode

func (msgs *PartialSignatureMessages) Decode(data []byte) error

Decode returns error if decoding failed

func (*PartialSignatureMessages) Encode

func (msgs *PartialSignatureMessages) Encode() ([]byte, error)

Encode returns a msg encoded bytes or error

func (PartialSignatureMessages) GetRoot

func (msgs PartialSignatureMessages) GetRoot() ([]byte, error)

GetRoot returns the root used for signing and verification

func (PartialSignatureMessages) Validate added in v0.2.7

func (msgs PartialSignatureMessages) Validate() error

type PartialSignatureMetaData

type PartialSignatureMetaData struct {
	ContributionSubCommitteeIndex uint64
}

type ProposerCalls

type ProposerCalls interface {
	// GetBeaconBlock returns beacon block by the given slot and committee index
	GetBeaconBlock(slot phase0.Slot, committeeIndex phase0.CommitteeIndex, graffiti, randao []byte) (*bellatrix.BeaconBlock, error)
	// SubmitBeaconBlock submit the block to the node
	SubmitBeaconBlock(block *bellatrix.SignedBeaconBlock) error
}

ProposerCalls interface has all block proposer duty specific calls

type ProposerRunner added in v0.2.7

type ProposerRunner struct {
	BaseRunner *BaseRunner
	// contains filtered or unexported fields
}

func (*ProposerRunner) Decode added in v0.2.7

func (r *ProposerRunner) Decode(data []byte) error

Decode returns error if decoding failed

func (*ProposerRunner) Encode added in v0.2.7

func (r *ProposerRunner) Encode() ([]byte, error)

Encode returns the encoded struct in bytes or error

func (*ProposerRunner) GetBaseRunner added in v0.2.7

func (r *ProposerRunner) GetBaseRunner() *BaseRunner

func (*ProposerRunner) GetBeaconNode added in v0.2.7

func (r *ProposerRunner) GetBeaconNode() BeaconNode

func (*ProposerRunner) GetNetwork added in v0.2.7

func (r *ProposerRunner) GetNetwork() Network

func (*ProposerRunner) GetRoot added in v0.2.7

func (r *ProposerRunner) GetRoot() ([]byte, error)

GetRoot returns the root used for signing and verification

func (*ProposerRunner) GetShare added in v0.2.7

func (r *ProposerRunner) GetShare() *types.Share

func (*ProposerRunner) GetSigner added in v0.2.7

func (r *ProposerRunner) GetSigner() types.KeyManager

func (*ProposerRunner) GetState added in v0.2.7

func (r *ProposerRunner) GetState() *State

func (*ProposerRunner) GetValCheckF added in v0.2.7

func (r *ProposerRunner) GetValCheckF() qbft.ProposedValueCheckF

func (*ProposerRunner) HasRunningDuty added in v0.2.7

func (r *ProposerRunner) HasRunningDuty() bool

HasRunningDuty returns true if a duty is already running (StartNewDuty called and returned nil)

func (*ProposerRunner) ProcessConsensus added in v0.2.7

func (r *ProposerRunner) ProcessConsensus(signedMsg *qbft.SignedMessage) error

func (*ProposerRunner) ProcessPostConsensus added in v0.2.7

func (r *ProposerRunner) ProcessPostConsensus(signedMsg *SignedPartialSignatureMessage) error

func (*ProposerRunner) ProcessPreConsensus added in v0.2.7

func (r *ProposerRunner) ProcessPreConsensus(signedMsg *SignedPartialSignatureMessage) error

func (*ProposerRunner) StartNewDuty added in v0.2.7

func (r *ProposerRunner) StartNewDuty(duty *types.Duty) error

type Runner

type Runner interface {
	types.Encoder
	types.Root
	Getters

	StartNewDuty(duty *types.Duty) error
	HasRunningDuty() bool
	ProcessPreConsensus(signedMsg *SignedPartialSignatureMessage) error
	ProcessConsensus(msg *qbft.SignedMessage) error
	ProcessPostConsensus(signedMsg *SignedPartialSignatureMessage) error
	// contains filtered or unexported methods
}

func NewAggregatorRunner added in v0.2.7

func NewAggregatorRunner(
	beaconNetwork types.BeaconNetwork,
	share *types.Share,
	qbftController *qbft.Controller,
	beacon BeaconNode,
	network Network,
	signer types.KeyManager,
	valCheck qbft.ProposedValueCheckF,
) Runner

func NewAttesterRunnner added in v0.2.7

func NewAttesterRunnner(
	beaconNetwork types.BeaconNetwork,
	share *types.Share,
	qbftController *qbft.Controller,
	beacon BeaconNode,
	network Network,
	signer types.KeyManager,
	valCheck qbft.ProposedValueCheckF,
) Runner

func NewProposerRunner added in v0.2.7

func NewProposerRunner(
	beaconNetwork types.BeaconNetwork,
	share *types.Share,
	qbftController *qbft.Controller,
	beacon BeaconNode,
	network Network,
	signer types.KeyManager,
	valCheck qbft.ProposedValueCheckF,
) Runner

func NewSyncCommitteeAggregatorRunner added in v0.2.7

func NewSyncCommitteeAggregatorRunner(
	beaconNetwork types.BeaconNetwork,
	share *types.Share,
	qbftController *qbft.Controller,
	beacon BeaconNode,
	network Network,
	signer types.KeyManager,
	valCheck qbft.ProposedValueCheckF,
) Runner

func NewSyncCommitteeRunner added in v0.2.7

func NewSyncCommitteeRunner(
	beaconNetwork types.BeaconNetwork,
	share *types.Share,
	qbftController *qbft.Controller,
	beacon BeaconNode,
	network Network,
	signer types.KeyManager,
	valCheck qbft.ProposedValueCheckF,
) Runner

type SignedPartialSignatureMessage

type SignedPartialSignatureMessage struct {
	Message   PartialSignatureMessages
	Signature types.Signature
	Signer    types.OperatorID
}

SignedPartialSignatureMessage is an operator's signature over PartialSignatureMessage

func (*SignedPartialSignatureMessage) Aggregate

func (spcsm *SignedPartialSignatureMessage) Aggregate(signedMsg types.MessageSignature) error

func (*SignedPartialSignatureMessage) Decode

func (spcsm *SignedPartialSignatureMessage) Decode(data []byte) error

Decode returns error if decoding failed

func (*SignedPartialSignatureMessage) Encode

func (spcsm *SignedPartialSignatureMessage) Encode() ([]byte, error)

Encode returns a msg encoded bytes or error

func (*SignedPartialSignatureMessage) GetRoot

func (spcsm *SignedPartialSignatureMessage) GetRoot() ([]byte, error)

func (*SignedPartialSignatureMessage) GetSignature

func (spcsm *SignedPartialSignatureMessage) GetSignature() types.Signature

func (*SignedPartialSignatureMessage) GetSigners

func (spcsm *SignedPartialSignatureMessage) GetSigners() []types.OperatorID

func (*SignedPartialSignatureMessage) MatchedSigners

func (spcsm *SignedPartialSignatureMessage) MatchedSigners(ids []types.OperatorID) bool

MatchedSigners returns true if the provided Signer ids are equal to GetSignerIds() without order significance

func (*SignedPartialSignatureMessage) Validate

func (spcsm *SignedPartialSignatureMessage) Validate() error

type State

type State struct {
	PreConsensusContainer  *PartialSigContainer
	PostConsensusContainer *PartialSigContainer
	RunningInstance        *qbft.Instance
	DecidedValue           *types.ConsensusData
	// 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 NewRunnerState added in v0.2.7

func NewRunnerState(quorum uint64, duty *types.Duty) *State

func (*State) Decode

func (pcs *State) Decode(data []byte) error

Decode returns error if decoding failed

func (*State) Encode

func (pcs *State) Encode() ([]byte, error)

Encode returns the encoded struct in bytes or error

func (*State) GetRoot

func (pcs *State) GetRoot() ([]byte, error)

GetRoot returns the root used for signing and verification

func (*State) ReconstructBeaconSig added in v0.2.7

func (pcs *State) ReconstructBeaconSig(container *PartialSigContainer, root, validatorPubKey []byte) ([]byte, error)

ReconstructBeaconSig aggregates collected partial beacon sigs

type Storage

type Storage interface {
}

Storage is a persistent storage for the SSV

type SyncCommitteeAggregatorRunner added in v0.2.7

type SyncCommitteeAggregatorRunner struct {
	BaseRunner *BaseRunner
	// contains filtered or unexported fields
}

func (*SyncCommitteeAggregatorRunner) Decode added in v0.2.7

func (r *SyncCommitteeAggregatorRunner) Decode(data []byte) error

Decode returns error if decoding failed

func (*SyncCommitteeAggregatorRunner) Encode added in v0.2.7

func (r *SyncCommitteeAggregatorRunner) Encode() ([]byte, error)

Encode returns the encoded struct in bytes or error

func (*SyncCommitteeAggregatorRunner) GetBaseRunner added in v0.2.7

func (r *SyncCommitteeAggregatorRunner) GetBaseRunner() *BaseRunner

func (*SyncCommitteeAggregatorRunner) GetBeaconNode added in v0.2.7

func (r *SyncCommitteeAggregatorRunner) GetBeaconNode() BeaconNode

func (*SyncCommitteeAggregatorRunner) GetNetwork added in v0.2.7

func (r *SyncCommitteeAggregatorRunner) GetNetwork() Network

func (*SyncCommitteeAggregatorRunner) GetRoot added in v0.2.7

func (r *SyncCommitteeAggregatorRunner) GetRoot() ([]byte, error)

GetRoot returns the root used for signing and verification

func (*SyncCommitteeAggregatorRunner) GetShare added in v0.2.7

func (r *SyncCommitteeAggregatorRunner) GetShare() *types.Share

func (*SyncCommitteeAggregatorRunner) GetSigner added in v0.2.7

func (*SyncCommitteeAggregatorRunner) GetState added in v0.2.7

func (r *SyncCommitteeAggregatorRunner) GetState() *State

func (*SyncCommitteeAggregatorRunner) GetValCheckF added in v0.2.7

func (*SyncCommitteeAggregatorRunner) HasRunningDuty added in v0.2.7

func (r *SyncCommitteeAggregatorRunner) HasRunningDuty() bool

HasRunningDuty returns true if a duty is already running (StartNewDuty called and returned nil)

func (*SyncCommitteeAggregatorRunner) ProcessConsensus added in v0.2.7

func (r *SyncCommitteeAggregatorRunner) ProcessConsensus(signedMsg *qbft.SignedMessage) error

func (*SyncCommitteeAggregatorRunner) ProcessPostConsensus added in v0.2.7

func (r *SyncCommitteeAggregatorRunner) ProcessPostConsensus(signedMsg *SignedPartialSignatureMessage) error

func (*SyncCommitteeAggregatorRunner) ProcessPreConsensus added in v0.2.7

func (r *SyncCommitteeAggregatorRunner) ProcessPreConsensus(signedMsg *SignedPartialSignatureMessage) error

func (*SyncCommitteeAggregatorRunner) StartNewDuty added in v0.2.7

func (r *SyncCommitteeAggregatorRunner) StartNewDuty(duty *types.Duty) error

type SyncCommitteeCalls

type SyncCommitteeCalls interface {
	// GetSyncMessageBlockRoot returns beacon block root for sync committee
	GetSyncMessageBlockRoot() (phase0.Root, error)
	// SubmitSyncMessage submits a signed sync committee msg
	SubmitSyncMessage(msg *altair.SyncCommitteeMessage) error
}

SyncCommitteeCalls interface has all sync committee duty specific calls

type SyncCommitteeContributionCalls

type SyncCommitteeContributionCalls interface {
	// GetSyncSubcommitteeIndex returns sync committee indexes for aggregator
	GetSyncSubcommitteeIndex(slot phase0.Slot, pubKey phase0.BLSPubKey) ([]uint64, error)
	// IsSyncCommitteeAggregator returns tru if aggregator
	IsSyncCommitteeAggregator(proof []byte) (bool, error)
	// SyncCommitteeSubnetID returns sync committee subnet ID from subcommittee index
	SyncCommitteeSubnetID(subCommitteeID uint64) (uint64, error)
	// GetSyncCommitteeContribution returns
	GetSyncCommitteeContribution(slot phase0.Slot, subnetID uint64, pubKey phase0.BLSPubKey) (*altair.SyncCommitteeContribution, error)
	// SubmitSignedContributionAndProof broadcasts to the network
	SubmitSignedContributionAndProof(contribution *altair.SignedContributionAndProof) error
}

SyncCommitteeContributionCalls interface has all sync committee contribution duty specific calls

type SyncCommitteeRunner added in v0.2.7

type SyncCommitteeRunner struct {
	BaseRunner *BaseRunner
	// contains filtered or unexported fields
}

func (*SyncCommitteeRunner) Decode added in v0.2.7

func (r *SyncCommitteeRunner) Decode(data []byte) error

Decode returns error if decoding failed

func (*SyncCommitteeRunner) Encode added in v0.2.7

func (r *SyncCommitteeRunner) Encode() ([]byte, error)

Encode returns the encoded struct in bytes or error

func (*SyncCommitteeRunner) GetBaseRunner added in v0.2.7

func (r *SyncCommitteeRunner) GetBaseRunner() *BaseRunner

func (*SyncCommitteeRunner) GetBeaconNode added in v0.2.7

func (r *SyncCommitteeRunner) GetBeaconNode() BeaconNode

func (*SyncCommitteeRunner) GetNetwork added in v0.2.7

func (r *SyncCommitteeRunner) GetNetwork() Network

func (*SyncCommitteeRunner) GetRoot added in v0.2.7

func (r *SyncCommitteeRunner) GetRoot() ([]byte, error)

GetRoot returns the root used for signing and verification

func (*SyncCommitteeRunner) GetShare added in v0.2.7

func (r *SyncCommitteeRunner) GetShare() *types.Share

func (*SyncCommitteeRunner) GetSigner added in v0.2.7

func (r *SyncCommitteeRunner) GetSigner() types.KeyManager

func (*SyncCommitteeRunner) GetState added in v0.2.7

func (r *SyncCommitteeRunner) GetState() *State

func (*SyncCommitteeRunner) GetValCheckF added in v0.2.7

func (r *SyncCommitteeRunner) GetValCheckF() qbft.ProposedValueCheckF

func (*SyncCommitteeRunner) HasRunningDuty added in v0.2.7

func (r *SyncCommitteeRunner) HasRunningDuty() bool

HasRunningDuty returns true if a duty is already running (StartNewDuty called and returned nil)

func (*SyncCommitteeRunner) ProcessConsensus added in v0.2.7

func (r *SyncCommitteeRunner) ProcessConsensus(signedMsg *qbft.SignedMessage) error

func (*SyncCommitteeRunner) ProcessPostConsensus added in v0.2.7

func (r *SyncCommitteeRunner) ProcessPostConsensus(signedMsg *SignedPartialSignatureMessage) error

func (*SyncCommitteeRunner) ProcessPreConsensus added in v0.2.7

func (r *SyncCommitteeRunner) ProcessPreConsensus(signedMsg *SignedPartialSignatureMessage) error

func (*SyncCommitteeRunner) StartNewDuty added in v0.2.7

func (r *SyncCommitteeRunner) StartNewDuty(duty *types.Duty) error

type Validator

type Validator struct {
	DutyRunners DutyRunners
	Network     Network
	Beacon      BeaconNode
	Storage     Storage
	Share       *types.Share
	Signer      types.KeyManager
}

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,
	storage Storage,
	share *types.Share,
	signer types.KeyManager,
	runners map[types.BeaconRole]Runner,
) *Validator

func (*Validator) ProcessMessage

func (v *Validator) ProcessMessage(msg *types.SSVMessage) error

ProcessMessage processes Network Message of all types

func (*Validator) StartDuty

func (v *Validator) StartDuty(duty *types.Duty) error

StartDuty starts a duty for the validator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL