Documentation ¶
Index ¶
- type Distributor
- func (p *Distributor) AddConsumer(consumer hotstuff.Consumer)
- func (p *Distributor) OnBlockIncorporated(block *model.Block)
- func (p *Distributor) OnCurrentViewDetails(currentView, finalizedView uint64, currentLeader flow.Identifier)
- 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(err model.InvalidTimeoutError)
- func (p *Distributor) OnInvalidVoteDetected(err model.InvalidVoteError)
- 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(oldView uint64, newView uint64, qc *flow.QuorumCertificate)
- 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(oldView uint64, newView uint64, tc *flow.TimeoutCertificate)
- func (p *Distributor) OnTimeoutProcessed(timeout *model.TimeoutObject)
- func (p *Distributor) OnViewChange(oldView, newView uint64)
- func (p *Distributor) OnVoteForInvalidBlockDetected(vote *model.Vote, invalidProposal *model.Proposal)
- func (p *Distributor) OnVoteProcessed(vote *model.Vote)
- 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 event consumer to the Distributor
func (*Distributor) OnBlockIncorporated ¶
func (p *Distributor) OnBlockIncorporated(block *model.Block)
func (*Distributor) OnCurrentViewDetails ¶ added in v0.29.6
func (p *Distributor) OnCurrentViewDetails(currentView, finalizedView uint64, currentLeader flow.Identifier)
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(err model.InvalidTimeoutError)
func (*Distributor) OnInvalidVoteDetected ¶
func (p *Distributor) OnInvalidVoteDetected(err model.InvalidVoteError)
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(oldView uint64, newView uint64, qc *flow.QuorumCertificate)
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(oldView uint64, newView uint64, tc *flow.TimeoutCertificate)
func (*Distributor) OnTimeoutProcessed ¶ added in v0.29.6
func (p *Distributor) OnTimeoutProcessed(timeout *model.TimeoutObject)
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)
func (*Distributor) OnVoteProcessed ¶ added in v0.29.6
func (p *Distributor) OnVoteProcessed(vote *model.Vote)
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)