strategy

package
v0.2.0-rc Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveLastDecided

func SaveLastDecided(logger *zap.Logger, store qbftstorage.DecidedMsgStore, signedMsgs ...*message.SignedMessage) error

SaveLastDecided 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, pip pipelines.SignedMessagePipeline) error
	// ValidateHeight validates the height of the given message
	ValidateHeight(msg *message.SignedMessage) (bool, error)
	// IsMsgKnown checks if the given decided message is known
	IsMsgKnown(msg *message.SignedMessage) (bool, *message.SignedMessage, error)
	// SaveLateCommit saves a commit message that arrived late
	SaveLateCommit(msg *message.SignedMessage) error
	// UpdateDecided updates the given decided message
	UpdateDecided(msg *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)
	// SaveDecided saves historical decided messages
	SaveDecided(signedMsg ...*message.SignedMessage) error
}

Decided helps to decouple regular from full-node mode where the node is saving decided history. in regular mode, the node only cares about last decided messages.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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