types

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: GPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ShifuTestnet is the domain for shifu testnet
	// NOTE: do not use directly unless you want to check domain,
	//       i.e. use GetDefaultDomain() to get the current domain.
	ShifuTestnet   = spectypes.DomainType("shifu")
	ShifuTestnetV2 = spectypes.DomainType("shifu-v2")
)

Functions

func GetDefaultDomain

func GetDefaultDomain() spectypes.DomainType

GetDefaultDomain returns the global domain used across the system

func SetDefaultDomain

func SetDefaultDomain(d spectypes.DomainType)

SetDefaultDomain updates the global domain used across the system allows injecting domain for testnets

Types

type EventMsg

type EventMsg struct {
	Type EventType
	Data []byte
}

func (*EventMsg) Decode

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

Decode returns error if decoding failed

func (*EventMsg) Encode

func (msg *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   string
	Operators      [][]byte // TODO: remove; get operator ID from the first event with operator public key
	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(operatorPubKey string) bool

BelongsToOperator checks whether the share belongs to operator.

func (*SSVShare) BelongsToOperatorID

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

BelongsToOperatorID checks whether the share belongs to operator ID.

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

func (s *SSVShare) SetOperators(pks [][]byte)

SetOperators sets operators public keys.

type State

type State struct {
	Share                           *spectypes.Share
	ID                              []byte // instance Identifier
	Round                           specqbft.Round
	Height                          specqbft.Height
	LastPreparedRound               specqbft.Round
	LastPreparedValue               []byte
	ProposalAcceptedForCurrentRound *specqbft.SignedMessage
	Decided                         bool
	DecidedValue                    []byte

	ProposeContainer     *specqbft.MsgContainer
	PrepareContainer     *specqbft.MsgContainer
	CommitContainer      *specqbft.MsgContainer
	RoundChangeContainer *specqbft.MsgContainer
}

func (*State) Decode

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

Decode returns error if decoding failed

func (*State) Encode

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

Encode returns a msg encoded bytes or error

func (*State) GetRoot

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

GetRoot returns the state's deterministic root

type TimeoutData

type TimeoutData struct {
	Height qbft.Height
}

Jump to

Keyboard shortcuts

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