ssv

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: GPL-3.0 Imports: 20 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,
) 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
	Share          map[spec.ValidatorIndex]*types.Share
	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
	Share           map[spec.ValidatorIndex]*types.Share
}

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) Decode added in v1.0.0

func (c *Committee) Decode(data []byte) error

func (*Committee) Encode added in v1.0.0

func (c *Committee) Encode() ([]byte, error)

Committee

func (*Committee) GetRoot added in v1.0.0

func (c *Committee) GetRoot() ([32]byte, error)

func (*Committee) MarshalJSON added in v1.0.0

func (c *Committee) MarshalJSON() ([]byte, error)

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

func (c *Committee) UnmarshalJSON(data []byte) error

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 DomainCalls interface {
	DomainData(epoch phase0.Epoch, domain phase0.DomainType) (phase0.Domain, error)
}

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 Network

type Network interface {
	p2p.Broadcaster
}

Network is the network interface for SSV

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

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

ProposerRunner

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 NewRunnerState

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

func (*State) Decode

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

func (*State) Encode

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

State

func (*State) GetRoot

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

func (*State) MarshalJSON added in v1.0.0

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

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

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

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 (*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 *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
	Share           *types.Share
	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

func (*Validator) StartDuty

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

StartDuty starts a duty for the validator

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 (*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 *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

Jump to

Keyboard shortcuts

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