github.com/koko1123/flow-go-1@v0.29.6/consensus/hotstuff/event_handler.go (about) 1 package hotstuff 2 3 import ( 4 "time" 5 6 "github.com/koko1123/flow-go-1/consensus/hotstuff/model" 7 "github.com/koko1123/flow-go-1/model/flow" 8 ) 9 10 // EventHandler runs a state machine to process proposals, QC and local timeouts. 11 type EventHandler interface { 12 13 // OnQCConstructed processes a valid qc constructed by internal vote aggregator. 14 OnQCConstructed(qc *flow.QuorumCertificate) error 15 16 // OnReceiveProposal processes a block proposal received from another HotStuff 17 // consensus participant. 18 OnReceiveProposal(proposal *model.Proposal) error 19 20 // OnLocalTimeout will check if there was a local timeout. 21 OnLocalTimeout() error 22 23 // TimeoutChannel returs a channel that sends a signal on timeout. 24 TimeoutChannel() <-chan time.Time 25 26 // Start starts the event handler. 27 Start() error 28 }