strategy

package
v0.2.1-rc.6 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 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 *message.SignedMessage) (*message.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 ...*message.SignedMessage) (*message.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 message.Identifier, from, to *message.SignedMessage, pip pipelines.SignedMessagePipeline) error
	// UpdateDecided updates the given decided message and returns the updated version (could include new signers)
	UpdateDecided(msg *message.SignedMessage) (*message.SignedMessage, error)
	// GetDecided returns historical decided messages
	GetDecided(identifier message.Identifier, heightRange ...message.Height) ([]*message.SignedMessage, error)
	// GetLastDecided returns height decided messages
	GetLastDecided(identifier message.Identifier) (*message.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