ibft

package
v0.0.0-...-4898c27 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

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 go-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