collections

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 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, instanceType 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) 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) 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
	// GetDecided returns a signed message for an ibft instance which decided by identifier
	GetDecided(identifier []byte, seqNumber uint64) (*proto.SignedMessage, bool, 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