ssv

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

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,
) alea.ProposedValueCheckF

func AttesterValueCheckF

func AttesterValueCheckF(
	signer types.BeaconSigner,
	network types.BeaconNetwork,
	validatorPK types.ValidatorPK,
	validatorIndex phase0.ValidatorIndex,
	sharePublicKey []byte,
) alea.ProposedValueCheckF

func ProposerValueCheckF

func ProposerValueCheckF(
	signer types.BeaconSigner,
	network types.BeaconNetwork,
	validatorPK types.ValidatorPK,
	validatorIndex phase0.ValidatorIndex,
	sharePublicKey []byte,
) alea.ProposedValueCheckF

func SyncCommitteeContributionValueCheckF

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

func SyncCommitteeValueCheckF

func SyncCommitteeValueCheckF(
	signer types.BeaconSigner,
	network types.BeaconNetwork,
	validatorPK types.ValidatorPK,
	validatorIndex phase0.ValidatorIndex,
) alea.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) (*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

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

func (*AggregatorRunner) Decode

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

Decode returns error if decoding failed

func (*AggregatorRunner) Encode

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

Encode returns the encoded struct in bytes or error

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) GetRoot

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

GetRoot returns the root used for signing and verification

func (*AggregatorRunner) GetShare

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

func (*AggregatorRunner) GetSigner

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

func (*AggregatorRunner) GetState

func (r *AggregatorRunner) GetState() *State

func (*AggregatorRunner) GetValCheckF

func (r *AggregatorRunner) GetValCheckF() alea.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 *alea.SignedMessage) error

func (*AggregatorRunner) ProcessPostConsensus

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

func (*AggregatorRunner) ProcessPreConsensus

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

func (*AggregatorRunner) StartNewDuty

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

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

func (*AttesterRunner) Decode

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

Decode returns error if decoding failed

func (*AttesterRunner) Encode

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

Encode returns the encoded struct in bytes or error

func (*AttesterRunner) GetBaseRunner

func (r *AttesterRunner) GetBaseRunner() *BaseRunner

func (*AttesterRunner) GetBeaconNode

func (r *AttesterRunner) GetBeaconNode() BeaconNode

func (*AttesterRunner) GetNetwork

func (r *AttesterRunner) GetNetwork() Network

func (*AttesterRunner) GetRoot

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

GetRoot returns the root used for signing and verification

func (*AttesterRunner) GetShare

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

func (*AttesterRunner) GetSigner

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

func (*AttesterRunner) GetState

func (r *AttesterRunner) GetState() *State

func (*AttesterRunner) GetValCheckF

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

func (*AttesterRunner) HasRunningDuty

func (r *AttesterRunner) HasRunningDuty() bool

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

func (*AttesterRunner) ProcessConsensus

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

func (*AttesterRunner) ProcessPostConsensus

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

func (*AttesterRunner) ProcessPreConsensus

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

func (*AttesterRunner) StartNewDuty

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

type BaseRunner

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

func (*BaseRunner) ValidatePostConsensusMsg

func (b *BaseRunner) ValidatePostConsensusMsg(runner Runner, signedMsg *SignedPartialSignatureMessage) error

func (*BaseRunner) ValidatePreConsensusMsg

func (b *BaseRunner) ValidatePreConsensusMsg(runner Runner, signedMsg *SignedPartialSignatureMessage) error

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

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

type Getters interface {
	GetBaseRunner() *BaseRunner
	GetBeaconNode() BeaconNode
	GetValCheckF() alea.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)

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
	// ValidatorRegistrationPartialSig is a partial signature over a ValidatorRegistration object
	ValidatorRegistrationPartialSig
)

type PartialSignatureMessage

type PartialSignatureMessage struct {
	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

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)
	// GetBlindedBeaconBlock returns blinded beacon block by the given slot and committee index
	GetBlindedBeaconBlock(slot phase0.Slot, committeeIndex phase0.CommitteeIndex, graffiti, randao []byte) (*bellatrix2.BlindedBeaconBlock, error)
	// SubmitBeaconBlock submit the block to the node
	SubmitBeaconBlock(block *bellatrix.SignedBeaconBlock) error
	// SubmitBlindedBeaconBlock submit the blinded block to the node
	SubmitBlindedBeaconBlock(block *bellatrix2.SignedBlindedBeaconBlock) error
}

ProposerCalls interface has all block proposer duty specific calls

type ProposerRunner

type ProposerRunner struct {
	BaseRunner *BaseRunner
	// ProducesBlindedBlocks is true when the runner will only produce blinded blocks
	ProducesBlindedBlocks bool
	// contains filtered or unexported fields
}

func (*ProposerRunner) Decode

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

Decode returns error if decoding failed

func (*ProposerRunner) Encode

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

Encode returns the encoded struct in bytes or 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) GetRoot

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

GetRoot returns the root used for signing and verification

func (*ProposerRunner) GetShare

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

func (*ProposerRunner) GetSigner

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

func (*ProposerRunner) GetState

func (r *ProposerRunner) GetState() *State

func (*ProposerRunner) GetValCheckF

func (r *ProposerRunner) GetValCheckF() alea.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 *alea.SignedMessage) error

func (*ProposerRunner) ProcessPostConsensus

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

func (*ProposerRunner) ProcessPreConsensus

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

func (*ProposerRunner) StartNewDuty

func (r *ProposerRunner) StartNewDuty(duty *types.Duty) 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) 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 *SignedPartialSignatureMessage) error
	// ProcessConsensus processes all consensus msgs, returns error if can't process
	ProcessConsensus(msg *alea.SignedMessage) error
	// ProcessPostConsensus processes all post-consensus msgs, returns error if can't process
	ProcessPostConsensus(signedMsg *SignedPartialSignatureMessage) error
	// contains filtered or unexported methods
}

func NewAggregatorRunner

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

func NewAttesterRunnner

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

func NewProposerRunner

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

func NewSyncCommitteeAggregatorRunner

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

func NewSyncCommitteeRunner

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

func NewValidatorRegistrationRunner

func NewValidatorRegistrationRunner(
	beaconNetwork types.BeaconNetwork,
	share *types.Share,
	beacon BeaconNode,
	network Network,
	signer types.KeyManager,
) 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        *alea.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

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

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

ReconstructBeaconSig aggregates collected partial beacon sigs

type SyncCommitteeAggregatorRunner

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

func (*SyncCommitteeAggregatorRunner) Decode

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

Decode returns error if decoding failed

func (*SyncCommitteeAggregatorRunner) Encode

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

Encode returns the encoded struct in bytes or error

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) GetRoot

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

GetRoot returns the root used for signing and verification

func (*SyncCommitteeAggregatorRunner) GetShare

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

func (*SyncCommitteeAggregatorRunner) GetSigner

func (*SyncCommitteeAggregatorRunner) GetState

func (r *SyncCommitteeAggregatorRunner) GetState() *State

func (*SyncCommitteeAggregatorRunner) GetValCheckF

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 *alea.SignedMessage) error

func (*SyncCommitteeAggregatorRunner) ProcessPostConsensus

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

func (*SyncCommitteeAggregatorRunner) ProcessPreConsensus

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

func (*SyncCommitteeAggregatorRunner) StartNewDuty

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

type SyncCommitteeCalls

type SyncCommitteeCalls interface {
	// GetSyncMessageBlockRoot returns beacon block root for sync committee
	GetSyncMessageBlockRoot(slot phase0.Slot) (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 {
	// 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
	GetSyncCommitteeContribution(slot phase0.Slot, subnetID uint64) (*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

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

func (*SyncCommitteeRunner) Decode

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

Decode returns error if decoding failed

func (*SyncCommitteeRunner) Encode

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

Encode returns the encoded struct in bytes or error

func (*SyncCommitteeRunner) GetBaseRunner

func (r *SyncCommitteeRunner) GetBaseRunner() *BaseRunner

func (*SyncCommitteeRunner) GetBeaconNode

func (r *SyncCommitteeRunner) GetBeaconNode() BeaconNode

func (*SyncCommitteeRunner) GetNetwork

func (r *SyncCommitteeRunner) GetNetwork() Network

func (*SyncCommitteeRunner) GetRoot

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

GetRoot returns the root used for signing and verification

func (*SyncCommitteeRunner) GetShare

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

func (*SyncCommitteeRunner) GetSigner

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

func (*SyncCommitteeRunner) GetState

func (r *SyncCommitteeRunner) GetState() *State

func (*SyncCommitteeRunner) GetValCheckF

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

func (*SyncCommitteeRunner) HasRunningDuty

func (r *SyncCommitteeRunner) HasRunningDuty() bool

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

func (*SyncCommitteeRunner) ProcessConsensus

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

func (*SyncCommitteeRunner) ProcessPostConsensus

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

func (*SyncCommitteeRunner) ProcessPreConsensus

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

func (*SyncCommitteeRunner) StartNewDuty

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

type Validator

type Validator struct {
	DutyRunners DutyRunners
	Network     Network
	Beacon      BeaconNode
	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,
	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

type ValidatorRegistrationRunner

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

func (*ValidatorRegistrationRunner) Decode

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

Decode returns error if decoding failed

func (*ValidatorRegistrationRunner) Encode

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

Encode returns the encoded struct in bytes or error

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) GetRoot

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

GetRoot returns the root used for signing and verification

func (*ValidatorRegistrationRunner) GetShare

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

func (*ValidatorRegistrationRunner) GetSigner

func (*ValidatorRegistrationRunner) GetState

func (r *ValidatorRegistrationRunner) GetState() *State

func (*ValidatorRegistrationRunner) GetValCheckF

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 *alea.SignedMessage) error

func (*ValidatorRegistrationRunner) ProcessPostConsensus

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

func (*ValidatorRegistrationRunner) ProcessPreConsensus

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

func (*ValidatorRegistrationRunner) StartNewDuty

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

Jump to

Keyboard shortcuts

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