message

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const EntryNotFoundError = "EntryNotFoundError"

EntryNotFoundError is the error message for when an entry is not found

View Source
const (
	SSVSyncMsgType spectypes.MsgType = 4
)

SSVSyncMsgType extension for spec msg type

Variables

This section is empty.

Functions

func Aggregate added in v0.3.0

func Aggregate(signedMsg *qbft.SignedMessage, s spectypes.MessageSignature) error

Aggregate is a utility that helps to ensure sorted signers

func MsgTypeToString added in v0.3.0

func MsgTypeToString(mt spectypes.MsgType) string

MsgTypeToString extension for spec msg type. convert spec msg type to string

func RoleTypeFromString

func RoleTypeFromString(rt string) spectypes.BeaconRole

RoleTypeFromString returns RoleType from string

func ToMessageID added in v0.3.0

func ToMessageID(b []byte) spectypes.MessageID

ToMessageID extension for spec msg id, returns spec messageID

func ValidatePartialSigMsg added in v0.3.0

func ValidatePartialSigMsg(signedMsg *specssv.SignedPartialSignatureMessage, committee []*spectypes.Operator, slot spec.Slot) error

ValidatePartialSigMsg validates the signed partial signature message | NOTE: using this code and not from spec until duty runner is implemented

Types

type Encoder

type Encoder interface {
	// Encode encodes the message
	Encode() ([]byte, error)
	// Decode decodes the message
	Decode(data []byte) error
}

Encoder encodes or decodes the message

type Operator

type Operator struct {
	OperatorID spectypes.OperatorID
	PubKey     []byte
}

Operator represents an SSV operator node

func (*Operator) GetID

func (n *Operator) GetID() spectypes.OperatorID

GetID returns the node's ID

func (*Operator) GetPublicKey

func (n *Operator) GetPublicKey() []byte

GetPublicKey returns the public key with which the node is identified with

type OperatorID

type OperatorID uint64

OperatorID is a unique ID for the node, used to create shares and verify msgs

type RoleType

type RoleType int

RoleType type of the validator role for a specific duty

const (
	RoleTypeUnknown RoleType = iota
	RoleTypeAttester
	RoleTypeAggregator
	RoleTypeProposer
)

List of roles

func (RoleType) String

func (r RoleType) String() string

String returns name of the role

type StatusCode

type StatusCode uint32

StatusCode is the response status code

const (
	// StatusUnknown represents an unknown state
	StatusUnknown StatusCode = iota
	// StatusSuccess means the request went successfully
	StatusSuccess
	// StatusNotFound means the desired objects were not found
	StatusNotFound
	// StatusError means that the node experienced some general error
	StatusError
	// StatusBadRequest means the request was bad
	StatusBadRequest
	// StatusInternalError means that the node experienced an internal error
	StatusInternalError
	// StatusBackoff means we exceeded rate limits for the protocol
	StatusBackoff
)

func (*StatusCode) String

func (sc *StatusCode) String() string

type SyncMessage

type SyncMessage struct {
	// Protocol is the protocol of the message
	// TODO: remove after v0
	Protocol SyncMsgType
	// Params holds request parameters
	Params *SyncParams
	// Data holds the results
	Data []*specqbft.SignedMessage
	// Status is the status code of the operation
	Status StatusCode
}

SyncMessage is the message being passed in sync operations

func (*SyncMessage) Decode

func (sm *SyncMessage) Decode(data []byte) error

Decode decodes the message

func (*SyncMessage) Encode

func (sm *SyncMessage) Encode() ([]byte, error)

Encode encodes the message

func (*SyncMessage) UpdateResults

func (sm *SyncMessage) UpdateResults(err error, results ...*specqbft.SignedMessage)

UpdateResults updates the given sync message with results or potential error

type SyncMsgType

type SyncMsgType int32

SyncMsgType represent the type of sync messages TODO: remove after v0

const (
	// LastDecidedType is the last decided message type
	LastDecidedType SyncMsgType = iota
	// LastChangeRoundType is the last change round message type
	LastChangeRoundType
	// DecidedHistoryType is the decided history message type
	DecidedHistoryType
)

type SyncParams

type SyncParams struct {
	// Height of the message, it can hold up to 2 items to specify a range or a single item for specific height
	Height []specqbft.Height
	// Identifier of the message
	Identifier spectypes.MessageID
}

SyncParams holds parameters for sync operations

Jump to

Keyboard shortcuts

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