types

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: GPL-3.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MaxPossibleShareSize = 1245
	MaxAllowedShareSize  = MaxPossibleShareSize * 8 // Leaving some room for protocol updates and calculation mistakes.
)

Variables

View Source
var (
	MetricsSignaturesVerifications = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: "ssv_signature_verifications",
		Help: "Number of signatures verifications",
	}, []string{})
)

Functions

func ComputeClusterIDHash added in v0.4.7

func ComputeClusterIDHash(address common.Address, operatorIds []uint64) []byte

ComputeClusterIDHash will compute cluster ID hash with given owner address and operator ids

func ComputeQuorumAndPartialQuorum added in v0.5.4

func ComputeQuorumAndPartialQuorum(committeeSize int) (quorum uint64, partialQuorum uint64)

func DeserializeBLSPublicKey added in v0.4.7

func DeserializeBLSPublicKey(b []byte) (bls.PublicKey, error)

DeserializeBLSPublicKey deserializes a bls.PublicKey from bytes, caching the result to avoid repeated deserialization.

func GetDefaultDomain

func GetDefaultDomain() spectypes.DomainType

GetDefaultDomain returns the global domain used across the system DEPRECATED: use networkconfig.NetworkConfig.Domain instead

func ReconstructSignature added in v0.4.7

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

func SetDefaultDomain

func SetDefaultDomain(d spectypes.DomainType)

SetDefaultDomain updates the global domain used across the system allows injecting domain for testnets DEPRECATED: use networkconfig.NetworkConfig.Domain instead

func ValidCommitteeSize added in v1.1.0

func ValidCommitteeSize(committeeSize int) bool

func VerifyByOperators added in v0.4.7

func VerifyByOperators(s spectypes.Signature, data spectypes.MessageSignature, domain spectypes.DomainType, sigType spectypes.SignatureType, operators []*spectypes.Operator) error

VerifyByOperators verifies signature by the provided operators This is a copy of a function with the same name from the spec, except for it's use of DeserializeBLSPublicKey function and bounded.CGO

TODO: rethink this function and consider moving/refactoring it.

func VerifyReconstructedSignature added in v0.4.7

func VerifyReconstructedSignature(sig *bls.Sign, validatorPubKey []byte, root [32]byte) error

Types

type EventMsg

type EventMsg struct {
	Type EventType
	Data []byte
}

func (*EventMsg) Decode

func (m *EventMsg) Decode(data []byte) error

Decode returns error if decoding failed

func (*EventMsg) Encode

func (m *EventMsg) Encode() ([]byte, error)

Encode returns a msg encoded bytes or error

func (*EventMsg) GetExecuteDutyData

func (m *EventMsg) GetExecuteDutyData() (*ExecuteDutyData, error)

func (*EventMsg) GetTimeoutData

func (m *EventMsg) GetTimeoutData() (*TimeoutData, error)

type EventType

type EventType int
const (
	// Timeout in order to run timeoutData process
	Timeout EventType = iota
	// ExecuteDuty for when to start duty runner
	ExecuteDuty
)

func (EventType) String

func (e EventType) String() string

type ExecuteDutyData

type ExecuteDutyData struct {
	Duty *types.Duty
}

type Metadata

type Metadata struct {
	BeaconMetadata *beaconprotocol.ValidatorMetadata
	OwnerAddress   common.Address
	Liquidated     bool
}

Metadata represents metadata of SSVShare.

type SSVShare

type SSVShare struct {
	spectypes.Share
	Metadata
}

SSVShare is a combination of spectypes.Share and its Metadata.

func (*SSVShare) BelongsToOperator

func (s *SSVShare) BelongsToOperator(operatorID spectypes.OperatorID) bool

BelongsToOperator checks whether the share belongs to operator.

func (*SSVShare) Decode

func (s *SSVShare) Decode(data []byte) error

Decode decodes SSVShare using gob.

func (*SSVShare) Encode

func (s *SSVShare) Encode() ([]byte, error)

Encode encodes SSVShare using gob.

func (*SSVShare) HasBeaconMetadata

func (s *SSVShare) HasBeaconMetadata() bool

HasBeaconMetadata checks whether the BeaconMetadata field is not nil.

func (*SSVShare) SetFeeRecipient added in v0.4.7

func (s *SSVShare) SetFeeRecipient(feeRecipient bellatrix.ExecutionAddress)

type TimeoutData

type TimeoutData struct {
	Height qbft.Height
	Round  qbft.Round
}

Jump to

Keyboard shortcuts

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