Documentation ¶
Index ¶
- type Distributor
- func (p *Distributor) AddConsumer(consumer hotstuff.Consumer)
- func (p *Distributor) OnBlockIncorporated(block *model.Block)
- func (p *Distributor) OnDoubleProposeDetected(block1, block2 *model.Block)
- func (p *Distributor) OnDoubleTimeoutDetected(timeout *model.TimeoutObject, altTimeout *model.TimeoutObject)
- func (p *Distributor) OnDoubleVotingDetected(vote1, vote2 *model.Vote)
- func (p *Distributor) OnEventProcessed()
- func (p *Distributor) OnFinalizedBlock(block *model.Block)
- func (p *Distributor) OnInvalidTimeoutDetected(timeout *model.TimeoutObject)
- func (p *Distributor) OnInvalidVoteDetected(vote *model.Vote)
- func (p *Distributor) OnLocalTimeout(currentView uint64)
- func (p *Distributor) OnOwnProposal(proposal *flow.Header, targetPublicationTime time.Time)
- func (p *Distributor) OnOwnTimeout(timeout *model.TimeoutObject)
- func (p *Distributor) OnOwnVote(blockID flow.Identifier, view uint64, sigData []byte, ...)
- func (p *Distributor) OnPartialTc(currentView uint64, partialTc *hotstuff.PartialTcCreated)
- func (p *Distributor) OnQcTriggeredViewChange(qc *flow.QuorumCertificate, newView uint64)
- func (p *Distributor) OnReceiveProposal(currentView uint64, proposal *model.Proposal)
- func (p *Distributor) OnReceiveQc(currentView uint64, qc *flow.QuorumCertificate)
- func (p *Distributor) OnReceiveTc(currentView uint64, tc *flow.TimeoutCertificate)
- func (p *Distributor) OnStart(currentView uint64)
- func (p *Distributor) OnStartingTimeout(timerInfo model.TimerInfo)
- func (p *Distributor) OnTcTriggeredViewChange(tc *flow.TimeoutCertificate, newView uint64)
- func (p *Distributor) OnViewChange(oldView, newView uint64)
- func (p *Distributor) OnVoteForInvalidBlockDetected(vote *model.Vote, invalidProposal *model.Proposal)
- type FinalizationDistributor
- func (p *FinalizationDistributor) AddConsumer(consumer hotstuff.FinalizationConsumer)
- func (p *FinalizationDistributor) AddOnBlockFinalizedConsumer(consumer OnBlockFinalizedConsumer)
- func (p *FinalizationDistributor) AddOnBlockIncorporatedConsumer(consumer OnBlockIncorporatedConsumer)
- func (p *FinalizationDistributor) OnBlockIncorporated(block *model.Block)
- func (p *FinalizationDistributor) OnDoubleProposeDetected(block1, block2 *model.Block)
- func (p *FinalizationDistributor) OnFinalizedBlock(block *model.Block)
- type OnBlockFinalizedConsumer
- type OnBlockIncorporatedConsumer
- type QCCreatedDistributor
- type TimeoutCollectorDistributor
- func (d *TimeoutCollectorDistributor) AddConsumer(consumer hotstuff.TimeoutCollectorConsumer)
- func (d *TimeoutCollectorDistributor) OnNewQcDiscovered(qc *flow.QuorumCertificate)
- func (d *TimeoutCollectorDistributor) OnNewTcDiscovered(tc *flow.TimeoutCertificate)
- func (d *TimeoutCollectorDistributor) OnPartialTcCreated(view uint64, newestQC *flow.QuorumCertificate, ...)
- func (d *TimeoutCollectorDistributor) OnTcConstructedFromTimeouts(tc *flow.TimeoutCertificate)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Distributor ¶
type Distributor struct {
// contains filtered or unexported fields
}
Distributor distributes notifications to a list of subscribers (event consumers).
It allows thread-safe subscription of multiple consumers to events.
func NewDistributor ¶
func NewDistributor() *Distributor
func (*Distributor) AddConsumer ¶
func (p *Distributor) AddConsumer(consumer hotstuff.Consumer)
AddConsumer adds an a event consumer to the Distributor
func (*Distributor) OnBlockIncorporated ¶
func (p *Distributor) OnBlockIncorporated(block *model.Block)
func (*Distributor) OnDoubleProposeDetected ¶
func (p *Distributor) OnDoubleProposeDetected(block1, block2 *model.Block)
func (*Distributor) OnDoubleTimeoutDetected ¶ added in v0.29.0
func (p *Distributor) OnDoubleTimeoutDetected(timeout *model.TimeoutObject, altTimeout *model.TimeoutObject)
func (*Distributor) OnDoubleVotingDetected ¶
func (p *Distributor) OnDoubleVotingDetected(vote1, vote2 *model.Vote)
func (*Distributor) OnEventProcessed ¶
func (p *Distributor) OnEventProcessed()
func (*Distributor) OnFinalizedBlock ¶
func (p *Distributor) OnFinalizedBlock(block *model.Block)
func (*Distributor) OnInvalidTimeoutDetected ¶ added in v0.29.0
func (p *Distributor) OnInvalidTimeoutDetected(timeout *model.TimeoutObject)
func (*Distributor) OnInvalidVoteDetected ¶
func (p *Distributor) OnInvalidVoteDetected(vote *model.Vote)
func (*Distributor) OnLocalTimeout ¶ added in v0.29.0
func (p *Distributor) OnLocalTimeout(currentView uint64)
func (*Distributor) OnOwnProposal ¶ added in v0.29.0
func (p *Distributor) OnOwnProposal(proposal *flow.Header, targetPublicationTime time.Time)
func (*Distributor) OnOwnTimeout ¶ added in v0.29.0
func (p *Distributor) OnOwnTimeout(timeout *model.TimeoutObject)
func (*Distributor) OnOwnVote ¶ added in v0.29.0
func (p *Distributor) OnOwnVote(blockID flow.Identifier, view uint64, sigData []byte, recipientID flow.Identifier)
func (*Distributor) OnPartialTc ¶ added in v0.29.0
func (p *Distributor) OnPartialTc(currentView uint64, partialTc *hotstuff.PartialTcCreated)
func (*Distributor) OnQcTriggeredViewChange ¶
func (p *Distributor) OnQcTriggeredViewChange(qc *flow.QuorumCertificate, newView uint64)
func (*Distributor) OnReceiveProposal ¶
func (p *Distributor) OnReceiveProposal(currentView uint64, proposal *model.Proposal)
func (*Distributor) OnReceiveQc ¶ added in v0.29.0
func (p *Distributor) OnReceiveQc(currentView uint64, qc *flow.QuorumCertificate)
func (*Distributor) OnReceiveTc ¶ added in v0.29.0
func (p *Distributor) OnReceiveTc(currentView uint64, tc *flow.TimeoutCertificate)
func (*Distributor) OnStart ¶ added in v0.29.0
func (p *Distributor) OnStart(currentView uint64)
func (*Distributor) OnStartingTimeout ¶
func (p *Distributor) OnStartingTimeout(timerInfo model.TimerInfo)
func (*Distributor) OnTcTriggeredViewChange ¶ added in v0.29.0
func (p *Distributor) OnTcTriggeredViewChange(tc *flow.TimeoutCertificate, newView uint64)
func (*Distributor) OnViewChange ¶ added in v0.29.0
func (p *Distributor) OnViewChange(oldView, newView uint64)
func (*Distributor) OnVoteForInvalidBlockDetected ¶ added in v0.23.9
func (p *Distributor) OnVoteForInvalidBlockDetected(vote *model.Vote, invalidProposal *model.Proposal)
type FinalizationDistributor ¶ added in v0.17.6
type FinalizationDistributor struct { notifications.NoopConsumer // contains filtered or unexported fields }
FinalizationDistributor ingests finalization events from hotstuff and distributes it to subscribers.
func NewFinalizationDistributor ¶ added in v0.17.6
func NewFinalizationDistributor() *FinalizationDistributor
func (*FinalizationDistributor) AddConsumer ¶ added in v0.19.0
func (p *FinalizationDistributor) AddConsumer(consumer hotstuff.FinalizationConsumer)
func (*FinalizationDistributor) AddOnBlockFinalizedConsumer ¶ added in v0.17.6
func (p *FinalizationDistributor) AddOnBlockFinalizedConsumer(consumer OnBlockFinalizedConsumer)
func (*FinalizationDistributor) AddOnBlockIncorporatedConsumer ¶ added in v0.17.6
func (p *FinalizationDistributor) AddOnBlockIncorporatedConsumer(consumer OnBlockIncorporatedConsumer)
func (*FinalizationDistributor) OnBlockIncorporated ¶ added in v0.17.6
func (p *FinalizationDistributor) OnBlockIncorporated(block *model.Block)
func (*FinalizationDistributor) OnDoubleProposeDetected ¶ added in v0.17.6
func (p *FinalizationDistributor) OnDoubleProposeDetected(block1, block2 *model.Block)
func (*FinalizationDistributor) OnFinalizedBlock ¶ added in v0.17.6
func (p *FinalizationDistributor) OnFinalizedBlock(block *model.Block)
type OnBlockFinalizedConsumer ¶ added in v0.17.6
type OnBlockIncorporatedConsumer ¶ added in v0.17.6
type QCCreatedDistributor ¶ added in v0.23.9
type QCCreatedDistributor struct {
// contains filtered or unexported fields
}
QCCreatedDistributor ingests events about QC creation from hotstuff and distributes them to subscribers. Objects are concurrency safe. NOTE: it can be refactored to work without lock since usually we never subscribe after startup. Mostly list of observers is static.
func NewQCCreatedDistributor ¶ added in v0.23.9
func NewQCCreatedDistributor() *QCCreatedDistributor
func (*QCCreatedDistributor) AddConsumer ¶ added in v0.23.9
func (d *QCCreatedDistributor) AddConsumer(consumer hotstuff.QCCreatedConsumer)
func (*QCCreatedDistributor) OnQcConstructedFromVotes ¶ added in v0.23.9
func (d *QCCreatedDistributor) OnQcConstructedFromVotes(qc *flow.QuorumCertificate)
type TimeoutCollectorDistributor ¶ added in v0.29.0
type TimeoutCollectorDistributor struct {
// contains filtered or unexported fields
}
TimeoutCollectorDistributor ingests events from hotstuff and distributes them to subscribers. Concurrently safe TODO: investigate if this can be updated using atomics to prevent locking on mutex since we always add all consumers before delivering events.
func NewTimeoutCollectorDistributor ¶ added in v0.29.0
func NewTimeoutCollectorDistributor() *TimeoutCollectorDistributor
func (*TimeoutCollectorDistributor) AddConsumer ¶ added in v0.29.0
func (d *TimeoutCollectorDistributor) AddConsumer(consumer hotstuff.TimeoutCollectorConsumer)
func (*TimeoutCollectorDistributor) OnNewQcDiscovered ¶ added in v0.29.0
func (d *TimeoutCollectorDistributor) OnNewQcDiscovered(qc *flow.QuorumCertificate)
func (*TimeoutCollectorDistributor) OnNewTcDiscovered ¶ added in v0.29.0
func (d *TimeoutCollectorDistributor) OnNewTcDiscovered(tc *flow.TimeoutCertificate)
func (*TimeoutCollectorDistributor) OnPartialTcCreated ¶ added in v0.29.0
func (d *TimeoutCollectorDistributor) OnPartialTcCreated(view uint64, newestQC *flow.QuorumCertificate, lastViewTC *flow.TimeoutCertificate)
func (*TimeoutCollectorDistributor) OnTcConstructedFromTimeouts ¶ added in v0.29.0
func (d *TimeoutCollectorDistributor) OnTcConstructedFromTimeouts(tc *flow.TimeoutCertificate)