eventloop

package
v0.38.0-preview.0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: AGPL-3.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventLoop

type EventLoop struct {
	*component.ComponentManager
	// contains filtered or unexported fields
}

EventLoop buffers all incoming events to the hotstuff EventHandler, and feeds EventHandler one event at a time.

func NewEventLoop

func NewEventLoop(
	log zerolog.Logger,
	metrics module.HotstuffMetrics,
	mempoolMetrics module.MempoolMetrics,
	eventHandler hotstuff.EventHandler,
	startTime time.Time,
) (*EventLoop, error)

NewEventLoop creates an instance of EventLoop.

func (*EventLoop) OnNewQcDiscovered added in v0.29.0

func (el *EventLoop) OnNewQcDiscovered(qc *flow.QuorumCertificate)

OnNewQcDiscovered pushes already validated QCs that were submitted from TimeoutAggregator to the event handler

func (*EventLoop) OnNewTcDiscovered added in v0.29.0

func (el *EventLoop) OnNewTcDiscovered(tc *flow.TimeoutCertificate)

OnNewTcDiscovered pushes already validated TCs that were submitted from TimeoutAggregator to the event handler

func (*EventLoop) OnPartialTcCreated added in v0.29.0

func (el *EventLoop) OnPartialTcCreated(view uint64, newestQC *flow.QuorumCertificate, lastViewTC *flow.TimeoutCertificate)

OnPartialTcCreated created a hotstuff.PartialTcCreated payload and pushes it into partialTcCreated buffered channel for further processing by EventHandler. Since we use buffered channel this function can block if buffer is full.

func (*EventLoop) OnQcConstructedFromVotes added in v0.29.0

func (el *EventLoop) OnQcConstructedFromVotes(qc *flow.QuorumCertificate)

OnQcConstructedFromVotes implements hotstuff.VoteCollectorConsumer and pushes received qc into processing pipeline.

func (*EventLoop) OnTcConstructedFromTimeouts added in v0.29.0

func (el *EventLoop) OnTcConstructedFromTimeouts(tc *flow.TimeoutCertificate)

OnTcConstructedFromTimeouts pushes the received TC to the timeoutCertificates channel

func (*EventLoop) OnTimeoutProcessed added in v0.31.0

func (el *EventLoop) OnTimeoutProcessed(timeout *model.TimeoutObject)

OnTimeoutProcessed implements hotstuff.TimeoutCollectorConsumer and is no-op

func (*EventLoop) OnVoteProcessed added in v0.31.0

func (el *EventLoop) OnVoteProcessed(vote *model.Vote)

OnVoteProcessed implements hotstuff.VoteCollectorConsumer and is no-op

func (*EventLoop) SubmitProposal

func (el *EventLoop) SubmitProposal(proposal *model.SignedProposal)

SubmitProposal pushes the received block to the proposals channel

Jump to

Keyboard shortcuts

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