Documentation ¶
Index ¶
- func NewFollower(log zerolog.Logger, committee hotstuff.Committee, headers storage.Headers, ...) (*hotstuff.FollowerLoop, error)
- func NewForks(final *flow.Header, headers storage.Headers, updater module.Finalizer, ...) (hotstuff.Forks, error)
- func NewParticipant(log zerolog.Logger, metrics module.HotstuffMetrics, builder module.Builder, ...) (*eventloop.EventLoop, error)
- func NewValidator(metrics module.HotstuffMetrics, committee hotstuff.Committee, ...) hotstuff.Validator
- func NewVoteAggregator(log zerolog.Logger, lowestRetainedView uint64, notifier hotstuff.Consumer, ...) (hotstuff.VoteAggregator, error)
- type HotstuffModules
- type Option
- func WithBlockRateDelay(delay time.Duration) Option
- func WithConfigRegistrar(reg updatable_configs.Registrar) Option
- func WithInitialTimeout(timeout time.Duration) Option
- func WithMinTimeout(timeout time.Duration) Option
- func WithStartupTime(time time.Time) Option
- func WithTimeoutDecreaseFactor(factor float64) Option
- func WithTimeoutIncreaseFactor(factor float64) Option
- func WithVoteAggregationTimeoutFraction(fraction float64) Option
- type ParticipantConfig
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 NewForks ¶
func NewForks(final *flow.Header, headers storage.Headers, updater module.Finalizer, notifier hotstuff.Consumer, rootHeader *flow.Header, rootQC *flow.QuorumCertificate) (hotstuff.Forks, error)
NewForks creates new consensus forks manager
func NewParticipant ¶
func NewParticipant( log zerolog.Logger, metrics module.HotstuffMetrics, builder module.Builder, communicator hotstuff.Communicator, finalized *flow.Header, pending []*flow.Header, modules *HotstuffModules, options ...Option, ) (*eventloop.EventLoop, error)
NewParticipant initialize the EventLoop instance with needed dependencies
func NewValidator ¶
func NewValidator(metrics module.HotstuffMetrics, committee hotstuff.Committee, forks hotstuff.ForksReader) hotstuff.Validator
NewValidator creates new instance of hotstuff validator needed for votes & proposal validation
func NewVoteAggregator ¶
func NewVoteAggregator( log zerolog.Logger, lowestRetainedView uint64, notifier hotstuff.Consumer, voteProcessorFactory hotstuff.VoteProcessorFactory, distributor *pubsub.FinalizationDistributor, ) (hotstuff.VoteAggregator, error)
NewVoteAggregator creates new VoteAggregator and recover the Forks' state with all pending block
Types ¶
type HotstuffModules ¶
type HotstuffModules struct { Notifier hotstuff.Consumer // observer for hotstuff events Committee hotstuff.Committee // consensus committee Signer hotstuff.Signer // signer of proposal & votes Persist hotstuff.Persister // last state of consensus participant FinalizationDistributor *pubsub.FinalizationDistributor // observer for finalization events, used by compliance engine QCCreatedDistributor *pubsub.QCCreatedDistributor // observer for qc created event, used by leader Forks hotstuff.Forks // information about multiple forks Validator hotstuff.Validator // validator of proposals & votes Aggregator hotstuff.VoteAggregator // aggregator of votes, used by leader }
HotstuffModules is a helper structure to encapsulate dependencies to create a hotStuff participant.
type Option ¶
type Option func(*ParticipantConfig)
func WithBlockRateDelay ¶
func WithConfigRegistrar ¶
func WithConfigRegistrar(reg updatable_configs.Registrar) Option
func WithInitialTimeout ¶
func WithMinTimeout ¶
func WithStartupTime ¶
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 Registrar updatable_configs.Registrar // optional: for registering HotStuff configs as dynamically configurable }
func DefaultParticipantConfig ¶
func DefaultParticipantConfig() ParticipantConfig
Directories ¶
Path | Synopsis |
---|---|
committees
(c) 2020 Dapper Labs - ALL RIGHTS RESERVED
|
(c) 2020 Dapper Labs - ALL RIGHTS RESERVED |
Click to show internal directories.
Click to hide internal directories.