collections

package
v0.2.1-rc.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IbftStorage

type IbftStorage struct {
	// contains filtered or unexported fields
}

IbftStorage struct instanceType is what separates different iBFT eth2 duty types (attestation, proposal and aggregation)

func NewIbft

func NewIbft(db basedb.IDb, logger *zap.Logger, prefix string) IbftStorage

NewIbft create new ibft storage

func (*IbftStorage) GetCurrentInstance

func (i *IbftStorage) GetCurrentInstance(identifier []byte) (*proto.State, bool, error)

GetCurrentInstance func implementation

func (*IbftStorage) GetDecided

func (i *IbftStorage) GetDecided(identifier []byte, seqNumber uint64) (*proto.SignedMessage, bool, error)

GetDecided returns a signed message for an ibft instance which decided by identifier

func (*IbftStorage) GetDecidedInRange added in v0.1.8

func (i *IbftStorage) GetDecidedInRange(identifier []byte, from uint64, to uint64) ([]*proto.SignedMessage, error)

GetDecidedInRange returns decided message in the given range

func (*IbftStorage) GetHighestDecidedInstance

func (i *IbftStorage) GetHighestDecidedInstance(identifier []byte) (*proto.SignedMessage, bool, error)

GetHighestDecidedInstance gets a signed message for an ibft instance which is the highest

func (*IbftStorage) SaveCurrentInstance

func (i *IbftStorage) SaveCurrentInstance(identifier []byte, state *proto.State) error

SaveCurrentInstance func implementation

func (*IbftStorage) SaveDecided

func (i *IbftStorage) SaveDecided(signedMsg *proto.SignedMessage) error

SaveDecided func implementation

func (*IbftStorage) SaveDecidedMessages added in v0.1.8

func (i *IbftStorage) SaveDecidedMessages(msgs []*proto.SignedMessage) error

SaveDecidedMessages func implementation

func (*IbftStorage) SaveHighestDecidedInstance

func (i *IbftStorage) SaveHighestDecidedInstance(signedMsg *proto.SignedMessage) error

SaveHighestDecidedInstance saves a signed message for an ibft instance which is currently highest

type Iibft

type Iibft interface {
	// SaveCurrentInstance saves the state for the current running (not yet decided) instance
	SaveCurrentInstance(identifier []byte, state *proto.State) error
	// GetCurrentInstance returns the state for the current running (not yet decided) instance
	GetCurrentInstance(identifier []byte) (*proto.State, bool, error)
	// SaveDecided saves a signed message for an ibft instance with decided justification
	SaveDecided(signedMsg *proto.SignedMessage) error
	// SaveDecidedMessages saves the given decided messages
	SaveDecidedMessages(msgs []*proto.SignedMessage) error
	// GetDecided returns a signed message for an ibft instance which decided by identifier
	GetDecided(identifier []byte, seqNumber uint64) (*proto.SignedMessage, bool, error)
	// GetDecidedInRange returns decided message in the given range
	GetDecidedInRange(identifier []byte, from uint64, to uint64) ([]*proto.SignedMessage, error)
	// SaveHighestDecidedInstance saves a signed message for an ibft instance which is currently highest
	SaveHighestDecidedInstance(signedMsg *proto.SignedMessage) error
	// GetHighestDecidedInstance gets a signed message for an ibft instance which is the highest
	GetHighestDecidedInstance(identifier []byte) (*proto.SignedMessage, bool, error)
}

Iibft is an interface for persisting chain data

Jump to

Keyboard shortcuts

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