ssv

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: GPL-3.0 Imports: 18 Imported by: 7

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,
	sharePublicKey []byte,
) qbft.ProposedValueCheckF

func ProposerValueCheckF added in v0.2.7

func ProposerValueCheckF(
	signer types.BeaconSigner,
	network types.BeaconNetwork,
	validatorPK types.ValidatorPK,
	validatorIndex phase0.ValidatorIndex,
	sharePublicKey []byte,
) 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, 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 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() ([32]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 *types.SignedPartialSignatureMessage) error

func (*AggregatorRunner) ProcessPreConsensus added in v0.2.7

func (r *AggregatorRunner) ProcessPreConsensus(signedMsg *types.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) (ssz.Marshaler, spec.DataVersion, 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() ([32]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 *types.SignedPartialSignatureMessage) error

func (*AttesterRunner) ProcessPreConsensus added in v0.2.7

func (r *AttesterRunner) ProcessPreConsensus(signedMsg *types.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
	// contains filtered or unexported fields
}

func NewBaseRunner added in v0.3.1

func NewBaseRunner(
	state *State,
	share *types.Share,
	controller *qbft.Controller,
	beaconNetwork types.BeaconNetwork,
	beaconRoleType types.BeaconRole,
	highestDecidedSlot spec.Slot,
) *BaseRunner

func (*BaseRunner) FallBackAndVerifyEachSignature added in v0.3.7

func (b *BaseRunner) FallBackAndVerifyEachSignature(container *PartialSigContainer, root [32]byte)

Verify each signature in container removing the invalid ones

func (*BaseRunner) SetHighestDecidedSlot added in v0.3.1

func (b *BaseRunner) SetHighestDecidedSlot(slot spec.Slot)

SetHighestDecidedSlot set highestDecidedSlot for base runner

func (*BaseRunner) ShouldProcessDuty added in v0.3.2

func (b *BaseRunner) ShouldProcessDuty(duty *types.Duty) error

func (*BaseRunner) ShouldProcessNonBeaconDuty added in v0.3.4

func (b *BaseRunner) ShouldProcessNonBeaconDuty(duty *types.Duty) error

func (*BaseRunner) ValidatePostConsensusMsg added in v0.3.0

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

func (*BaseRunner) ValidatePreConsensusMsg added in v0.3.0

func (b *BaseRunner) ValidatePreConsensusMsg(runner Runner, signedMsg *types.SignedPartialSignatureMessage) 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 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 *types.PartialSignatureMessage)

func (*PartialSigContainer) GetSignature added in v0.3.7

func (ps *PartialSigContainer) GetSignature(signer types.OperatorID, signingRoot [32]byte) (types.Signature, error)

Return signature for given root and signer

func (*PartialSigContainer) GetSignatures added in v0.3.7

func (ps *PartialSigContainer) GetSignatures(signingRoot [32]byte) map[types.OperatorID][]byte

Return signature map for given root

func (*PartialSigContainer) HasQuorum

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

func (*PartialSigContainer) HasSigner added in v0.3.7

func (ps *PartialSigContainer) HasSigner(signer types.OperatorID, signingRoot [32]byte) bool

Returns if container has signature for signer and signing root

func (*PartialSigContainer) ReconstructSignature

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

func (*PartialSigContainer) Remove added in v0.3.7

func (ps *PartialSigContainer) Remove(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)
	// GetBlindedBeaconBlock returns blinded beacon block by the given slot, graffiti, and randao.
	GetBlindedBeaconBlock(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 added in v0.2.7

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 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() ([32]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 *types.SignedPartialSignatureMessage) error

func (*ProposerRunner) ProcessPreConsensus added in v0.2.7

func (r *ProposerRunner) ProcessPreConsensus(signedMsg *types.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 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 *types.SignedPartialSignatureMessage) error
	// ProcessConsensus processes all consensus msgs, returns error if can't process
	ProcessConsensus(msg *qbft.SignedMessage) error
	// ProcessPostConsensus processes all post-consensus msgs, returns error if can't process
	ProcessPostConsensus(signedMsg *types.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,
	operatorSigner types.OperatorSigner,
	valCheck qbft.ProposedValueCheckF,
	highestDecidedSlot phase0.Slot,
) Runner

func NewAttesterRunner added in v0.3.9

func NewAttesterRunner(
	beaconNetwork types.BeaconNetwork,
	share *types.Share,
	qbftController *qbft.Controller,
	beacon BeaconNode,
	network Network,
	signer types.KeyManager,
	operatorSigner types.OperatorSigner,
	valCheck qbft.ProposedValueCheckF,
	highestDecidedSlot phase0.Slot,
) 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,
	operatorSigner types.OperatorSigner,
	valCheck qbft.ProposedValueCheckF,
	highestDecidedSlot phase0.Slot,
) 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,
	operatorSigner types.OperatorSigner,
	valCheck qbft.ProposedValueCheckF,
	highestDecidedSlot phase0.Slot,
) 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,
	operatorSigner types.OperatorSigner,
	valCheck qbft.ProposedValueCheckF,
	highestDecidedSlot phase0.Slot,
) Runner

func NewValidatorRegistrationRunner added in v0.3.0

func NewValidatorRegistrationRunner(
	beaconNetwork types.BeaconNetwork,
	share *types.Share,
	beacon BeaconNode,
	network Network,
	signer types.KeyManager,
	operatorSigner types.OperatorSigner,
) Runner

func NewVoluntaryExitRunner added in v0.3.2

func NewVoluntaryExitRunner(
	beaconNetwork types.BeaconNetwork,
	share *types.Share,
	beacon BeaconNode,
	network Network,
	signer types.KeyManager,
	operatorSigner types.OperatorSigner,
) Runner

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() ([32]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 [32]byte, validatorPubKey []byte) ([]byte, error)

ReconstructBeaconSig aggregates collected partial beacon sigs

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() ([32]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 *types.SignedPartialSignatureMessage) error

func (*SyncCommitteeAggregatorRunner) ProcessPreConsensus added in v0.2.7

func (r *SyncCommitteeAggregatorRunner) ProcessPreConsensus(signedMsg *types.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(slot phase0.Slot) (phase0.Root, spec.DataVersion, 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 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 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() ([32]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 *types.SignedPartialSignatureMessage) error

func (*SyncCommitteeRunner) ProcessPreConsensus added in v0.2.7

func (r *SyncCommitteeRunner) ProcessPreConsensus(signedMsg *types.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
	Share             *types.Share
	Signer            types.KeyManager
	OperatorSigner    types.OperatorSigner
	SignatureVerifier types.SignatureVerifier
}

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,
	operatorSigner types.OperatorSigner,
	runners map[types.BeaconRole]Runner,
	signatureVerifier types.SignatureVerifier,
) *Validator

func (*Validator) ProcessMessage

func (v *Validator) ProcessMessage(signedSSVMessage *types.SignedSSVMessage) 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 ValidatorRegistrationCalls added in v0.3.1

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 added in v0.3.0

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

func (*ValidatorRegistrationRunner) Decode added in v0.3.0

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

Decode returns error if decoding failed

func (*ValidatorRegistrationRunner) Encode added in v0.3.0

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

Encode returns the encoded struct in bytes or error

func (*ValidatorRegistrationRunner) GetBaseRunner added in v0.3.0

func (r *ValidatorRegistrationRunner) GetBaseRunner() *BaseRunner

func (*ValidatorRegistrationRunner) GetBeaconNode added in v0.3.0

func (r *ValidatorRegistrationRunner) GetBeaconNode() BeaconNode

func (*ValidatorRegistrationRunner) GetNetwork added in v0.3.0

func (r *ValidatorRegistrationRunner) GetNetwork() Network

func (*ValidatorRegistrationRunner) GetRoot added in v0.3.0

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

GetRoot returns the root used for signing and verification

func (*ValidatorRegistrationRunner) GetShare added in v0.3.0

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

func (*ValidatorRegistrationRunner) GetSigner added in v0.3.0

func (*ValidatorRegistrationRunner) GetState added in v0.3.0

func (r *ValidatorRegistrationRunner) GetState() *State

func (*ValidatorRegistrationRunner) GetValCheckF added in v0.3.0

func (*ValidatorRegistrationRunner) HasRunningDuty added in v0.3.0

func (r *ValidatorRegistrationRunner) HasRunningDuty() bool

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

func (*ValidatorRegistrationRunner) ProcessConsensus added in v0.3.0

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

func (*ValidatorRegistrationRunner) ProcessPostConsensus added in v0.3.0

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

func (*ValidatorRegistrationRunner) ProcessPreConsensus added in v0.3.0

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

func (*ValidatorRegistrationRunner) StartNewDuty added in v0.3.0

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

type VoluntaryExitCalls added in v0.3.2

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 added in v0.3.2

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

Duty runner for validator voluntary exit duty

func (*VoluntaryExitRunner) Decode added in v0.3.2

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

Decode returns error if decoding failed

func (*VoluntaryExitRunner) Encode added in v0.3.2

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

Encode returns the encoded struct in bytes or error

func (*VoluntaryExitRunner) GetBaseRunner added in v0.3.2

func (r *VoluntaryExitRunner) GetBaseRunner() *BaseRunner

func (*VoluntaryExitRunner) GetBeaconNode added in v0.3.2

func (r *VoluntaryExitRunner) GetBeaconNode() BeaconNode

func (*VoluntaryExitRunner) GetNetwork added in v0.3.2

func (r *VoluntaryExitRunner) GetNetwork() Network

func (*VoluntaryExitRunner) GetRoot added in v0.3.2

func (r *VoluntaryExitRunner) GetRoot() ([32]byte, error)

GetRoot returns the root used for signing and verification

func (*VoluntaryExitRunner) GetShare added in v0.3.2

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

func (*VoluntaryExitRunner) GetSigner added in v0.3.2

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

func (*VoluntaryExitRunner) GetState added in v0.3.2

func (r *VoluntaryExitRunner) GetState() *State

func (*VoluntaryExitRunner) GetValCheckF added in v0.3.2

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

func (*VoluntaryExitRunner) HasRunningDuty added in v0.3.2

func (r *VoluntaryExitRunner) HasRunningDuty() bool

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

func (*VoluntaryExitRunner) ProcessConsensus added in v0.3.2

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

func (*VoluntaryExitRunner) ProcessPostConsensus added in v0.3.2

func (r *VoluntaryExitRunner) ProcessPostConsensus(signedMsg *types.SignedPartialSignatureMessage) error

func (*VoluntaryExitRunner) ProcessPreConsensus added in v0.3.2

func (r *VoluntaryExitRunner) ProcessPreConsensus(signedMsg *types.SignedPartialSignatureMessage) error

ProcessPreConsensus Check for quorum of partial signatures over VoluntaryExit and, if has quorum, constructs SignedVoluntaryExit and submits to BeaconNode

func (*VoluntaryExitRunner) StartNewDuty added in v0.3.2

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

Jump to

Keyboard shortcuts

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