github.com/koko1123/flow-go-1@v0.29.6/consensus/hotstuff/communicator.go (about)

     1  package hotstuff
     2  
     3  import (
     4  	"time"
     5  
     6  	"github.com/koko1123/flow-go-1/model/flow"
     7  )
     8  
     9  // Communicator is the component that allows the HotStuff core algorithm to
    10  // communicate with the other actors of the consensus process.
    11  type Communicator interface {
    12  
    13  	// SendVote sends a vote for the given parameters to the specified recipient.
    14  	SendVote(blockID flow.Identifier, view uint64, sigData []byte, recipientID flow.Identifier) error
    15  
    16  	// BroadcastProposal broadcasts the given block proposal to all actors of
    17  	// the consensus process.
    18  	BroadcastProposal(proposal *flow.Header) error
    19  
    20  	// BroadcastProposalWithDelay broadcasts the given block proposal to all actors of
    21  	// the consensus process.
    22  	// delay is to hold the proposal before broadcasting it. Useful to control the block production rate.
    23  	BroadcastProposalWithDelay(proposal *flow.Header, delay time.Duration) error
    24  }