qbftstorage

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeRoundStore

type ChangeRoundStore interface {
	// GetLastChangeRoundMsg returns the latest broadcasted msg from the instance
	GetLastChangeRoundMsg(identifier message.Identifier, signers ...message.OperatorID) ([]*message.SignedMessage, error)
	// SaveLastChangeRoundMsg returns the latest broadcasted msg from the instance
	SaveLastChangeRoundMsg(msg *message.SignedMessage) error
	// CleanLastChangeRound cleans last change round message of some validator, should be called upon controller init
	CleanLastChangeRound(identifier message.Identifier)
}

ChangeRoundStore manages change round data

type DecidedMsgStore

type DecidedMsgStore interface {
	GetLastDecided(identifier message.Identifier) (*message.SignedMessage, error)
	// SaveLastDecided saves the given decided message, after checking that it is indeed the highest
	SaveLastDecided(signedMsg ...*message.SignedMessage) error
	// GetDecided returns historical decided messages in the given range
	GetDecided(identifier message.Identifier, from message.Height, to message.Height) ([]*message.SignedMessage, error)
	// SaveDecided saves historical decided messages
	SaveDecided(signedMsg ...*message.SignedMessage) error
}

DecidedMsgStore manages persistence of messages

type InstanceStore

type InstanceStore interface {
	// SaveCurrentInstance saves the state for the current running (not yet decided) instance
	SaveCurrentInstance(identifier message.Identifier, state *qbft.State) error
	// GetCurrentInstance returns the state for the current running (not yet decided) instance
	GetCurrentInstance(identifier message.Identifier) (*qbft.State, bool, error)
}

InstanceStore manages instance data

type QBFTStore

type QBFTStore interface {
	DecidedMsgStore
	InstanceStore
	ChangeRoundStore
}

QBFTStore is the store used by QBFT components

func NewQBFTStore

func NewQBFTStore(db basedb.IDb, logger *zap.Logger, instanceType string) QBFTStore

NewQBFTStore create new ibft storage

Jump to

Keyboard shortcuts

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