ibft

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

README

SSV - IBFT



Blox IBFT implementation
Codebase Structure
How to start SSV environment locally?

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReportDecided added in v0.0.20

func ReportDecided(pk string, msg *proto.SignedMessage)

ReportDecided reports on a decided message

Types

type Controller added in v0.1.2

type Controller interface {
	// Init should be called after creating an Controller instance to init the instance, sync it, etc.
	Init() error

	// StartInstance starts a new instance by the given options
	StartInstance(opts ControllerStartInstanceOptions) (*InstanceResult, error)

	// NextSeqNumber returns the previous decided instance seq number + 1
	// In case it's the first instance it returns 0
	NextSeqNumber() (uint64, error)

	// GetIBFTCommittee returns a map of the iBFT committee where the key is the member's id.
	GetIBFTCommittee() map[uint64]*proto.Node

	// GetIdentifier returns ibft identifier made of public key and role (type)
	GetIdentifier() []byte
}

Controller represents behavior of the Controller

type ControllerStartInstanceOptions added in v0.1.2

type ControllerStartInstanceOptions struct {
	Logger     *zap.Logger
	ValueCheck valcheck.ValueCheck
	SeqNumber  uint64
	Value      []byte
	// RequireMinPeers flag to require minimum peers before starting an instance
	// useful for tests where we want (sometimes) to avoid networking
	RequireMinPeers bool
}

ControllerStartInstanceOptions defines type for Controller instance options

type Instance

type Instance interface {
	Pipelines
	Init()
	Start(inputValue []byte) error
	Stop()
	State() *proto.State
	ForceDecide(msg *proto.SignedMessage)
	GetStageChan() chan proto.RoundState
	GetLastChangeRoundMsg() *proto.SignedMessage
	CommittedAggregatedMsg() (*proto.SignedMessage, error)
}

Instance represents an iBFT instance (a single sequence number)

type InstanceResult added in v0.0.5

type InstanceResult struct {
	Decided bool
	Msg     *proto.SignedMessage
}

InstanceResult is a struct holding the result of a single iBFT instance

type Pipelines added in v0.1.2

type Pipelines interface {
	// PrePrepareMsgPipeline is the full processing msg pipeline for a pre-prepare msg
	PrePrepareMsgPipeline() pipeline.Pipeline
	// PrepareMsgPipeline is the full processing msg pipeline for a prepare msg
	PrepareMsgPipeline() pipeline.Pipeline
	// CommitMsgValidationPipeline is a msg validation ONLY pipeline
	CommitMsgValidationPipeline() pipeline.Pipeline
	// CommitMsgPipeline is the full processing msg pipeline for a commit msg
	CommitMsgPipeline() pipeline.Pipeline
	// DecidedMsgPipeline is a specific full processing pipeline for a decided msg
	DecidedMsgPipeline() pipeline.Pipeline
	// changeRoundMsgValidationPipeline is a msg validation ONLY pipeline for a change round msg
	ChangeRoundMsgValidationPipeline() pipeline.Pipeline
	// ChangeRoundMsgPipeline is the full processing msg pipeline for a change round msg
	ChangeRoundMsgPipeline() pipeline.Pipeline
}

Pipelines holds all major instance pipeline implementations

Jump to

Keyboard shortcuts

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