strategy

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSigners added in v0.3.0

func CheckSigners(local, msg *specqbft.SignedMessage) (*specqbft.SignedMessage, bool)

CheckSigners will return the decided message with more signers if both are with the same height

func UpdateLastDecided added in v0.3.0

func UpdateLastDecided(logger *zap.Logger, store qbftstorage.DecidedMsgStore, signedMsgs ...*specqbft.SignedMessage) (*specqbft.SignedMessage, error)

UpdateLastDecided saves last decided message if its height is larger than persisted height

Types

type Decided

type Decided interface {
	// Sync performs a sync with the other peers in the network
	Sync(ctx context.Context, identifier []byte, from, to *specqbft.SignedMessage) ([]*specqbft.SignedMessage, error)
	// UpdateDecided updates the given decided message and returns the updated version (could include new signers)
	UpdateDecided(msg *specqbft.SignedMessage) (*specqbft.SignedMessage, error)
	// GetDecided returns historical decided messages
	GetDecided(identifier []byte, heightRange ...specqbft.Height) ([]*specqbft.SignedMessage, error)
	// GetLastDecided returns height decided messages
	GetLastDecided(identifier []byte) (*specqbft.SignedMessage, error)
}

Decided helps to decouple light from full-node mode where the node is saving decided history. in light mode, the node doesn't save history, only last/highest decided messages.

type Mode

type Mode int32

Mode represents an internal mode of the node. from user POV it can configure it as a fullnode, but since v1 we will use a quiet fullnode for fullnodes.

const (
	// ModeLightNode is the light mode, default for v1
	ModeLightNode Mode = iota
	// ModeFullNode is a full node mode, default for v0
	ModeFullNode
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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