ibft

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 33 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultEpochSize = 100000
	IbftKeyName      = "validator.key"
	KeyEpochSize     = "epochSize"
)

Variables

View Source
var (
	ErrInvalidHookParam             = errors.New("invalid IBFT hook param passed in")
	ErrProposerSealByNonValidator   = errors.New("proposer seal by non-validator")
	ErrInvalidMixHash               = errors.New("invalid mixhash")
	ErrInvalidSha3Uncles            = errors.New("invalid sha3 uncles")
	ErrWrongDifficulty              = errors.New("wrong difficulty")
	ErrParentCommittedSealsNotFound = errors.New("parent committed seals not found")
)
View Source
var (
	ErrVotingNotSupported = errors.New("voting is not supported")
	ErrHeaderNotFound     = errors.New("header not found")
)

Functions

func CalcMaxFaultyNodes

func CalcMaxFaultyNodes(s validators.Validators) int

func CalcProposer

func CalcProposer(
	validators validators.Validators,
	round uint64,
	lastProposer types.Address,
) validators.Validator

func Factory

func Factory(params *consensus.Params) (consensus.Consensus, error)

Factory implements the base consensus Factory method

func LegacyQuorumSize

func LegacyQuorumSize(set validators.Validators) int

LegacyQuorumSize returns the legacy quorum size for the given validator set

func OptimalQuorumSize

func OptimalQuorumSize(set validators.Validators) int

OptimalQuorumSize returns the optimal quorum size for the given validator set

Types

type IBFTConsensus

type IBFTConsensus struct {
	*core.IBFT
	// contains filtered or unexported fields
}

IBFTConsensus is a convenience wrapper for the plg-ibft package

type QuorumImplementation

type QuorumImplementation func(validators.Validators) int

type Votable

type Votable interface {
	Votes(uint64) ([]*store.Vote, error)
	Candidates() []*store.Candidate
	Propose(validators.Validator, bool, types.Address) error
}

Votable is an interface of the ValidatorStore with vote function

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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