ibft

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 34 Imported by: 3

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")
)
View Source
var (
	ErrVotingNotSupported = errors.New("voting is not supported")
	ErrHeaderNotFound     = errors.New("header not found")
)

Functions

func CalcMaxFaultyNodes added in v0.6.0

func CalcMaxFaultyNodes(s validators.Validators) int

func CalcProposer added in v0.6.0

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 added in v0.4.0

func LegacyQuorumSize(set validators.Validators) int

LegacyQuorumSize returns the legacy quorum size for the given validator set

func OptimalQuorumSize added in v0.4.0

func OptimalQuorumSize(set validators.Validators) int

OptimalQuorumSize returns the optimal quorum size for the given validator set

Types

type IBFTConsensus added in v0.5.0

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

IBFTConsensus is a convenience wrapper for the go-ibft package

type QuorumImplementation added in v0.4.0

type QuorumImplementation func(validators.Validators) int

type Votable added in v0.6.0

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