consensus

package
v0.22.9-patch-2-reduce... Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: AGPL-3.0 Imports: 20 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFollower

func NewFollower(log zerolog.Logger, committee hotstuff.Committee, headers storage.Headers, updater module.Finalizer,
	verifier hotstuff.Verifier, notifier hotstuff.FinalizationConsumer, rootHeader *flow.Header,
	rootQC *flow.QuorumCertificate, finalized *flow.Header, pending []*flow.Header) (*hotstuff.FollowerLoop, error)

func NewParticipant

func NewParticipant(
	log zerolog.Logger,
	notifier hotstuff.Consumer,
	metrics module.HotstuffMetrics,
	headers storage.Headers,
	committee hotstuff.Committee,
	builder module.Builder,
	updater module.Finalizer,
	persist hotstuff.Persister,
	signer hotstuff.SignerVerifier,
	communicator hotstuff.Communicator,
	rootHeader *flow.Header,
	rootQC *flow.QuorumCertificate,
	finalized *flow.Header,
	pending []*flow.Header,
	options ...Option,
) (*hotstuff.EventLoop, error)

NewParticipant initialize the EventLoop instance and recover the forks' state with all pending block

Types

type Option

type Option func(*ParticipantConfig)

func WithBlockRateDelay

func WithBlockRateDelay(delay time.Duration) Option

func WithInitialTimeout

func WithInitialTimeout(timeout time.Duration) Option

func WithMinTimeout

func WithMinTimeout(timeout time.Duration) Option

func WithStartupTime added in v0.22.4

func WithStartupTime(time time.Time) Option

func WithTimeoutDecreaseFactor

func WithTimeoutDecreaseFactor(factor float64) Option

func WithTimeoutIncreaseFactor

func WithTimeoutIncreaseFactor(factor float64) Option

func WithVoteAggregationTimeoutFraction

func WithVoteAggregationTimeoutFraction(fraction float64) Option

type ParticipantConfig

type ParticipantConfig struct {
	StartupTime                time.Time     // the time when consensus participant enters first view
	TimeoutInitial             time.Duration // the initial timeout for the pacemaker
	TimeoutMinimum             time.Duration // the minimum timeout for the pacemaker
	TimeoutAggregationFraction float64       // the percentage part of the timeout period reserved for vote aggregation
	TimeoutIncreaseFactor      float64       // the factor at which the timeout grows when timeouts occur
	TimeoutDecreaseFactor      float64       // the factor at which the timeout grows when timeouts occur
	BlockRateDelay             time.Duration // a delay to broadcast block proposal in order to control the block production rate
}

Jump to

Keyboard shortcuts

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