Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultRoundTimeout = 6000 DefaultRoundTimeoutInterval = 500 )
Variables ¶
View Source
var ( RoundTimeout time.Duration RoundTimeoutInterval time.Duration )
Functions ¶
func GetEventTimeout ¶
func GetEventTimeout(evtType TimerEventType, roundIndex int32) time.Duration
GetEventTimeout returns the time duration per event type and consensus roundIndex
Types ¶
type TimerEvent ¶
type TimerEvent struct { Index uint64 // Index of the local node in the validator collection of the current epoch Level uint64 // level in the consensus Height uint64 // Height in the consensus EpochId uint64 // EpochId in the consensus LevelIndex uint64 // diff in the committed level and current level Duration time.Duration // timeout PreBlkHash []byte // only used in proposed event State maxbftpb.ConsStateType // Monitored events }
TimerEvent defines a timer event
func (*TimerEvent) String ¶
func (t *TimerEvent) String() string
type TimerEventType ¶
type TimerEventType int
TimerEventType defines the consensus event type
const ( PROPOSAL_BLOCK_TIMEOUT TimerEventType = iota VOTE_BLOCK_TIMEOUT ROUND_TIMEOUT )
Events: proposal block, vote block, get transaction, empty block, commit block, heartbeat
type TimerService ¶
type TimerService struct {
// contains filtered or unexported fields
}
TimerService provides timer service
func NewTimerService ¶
func NewTimerService(log *logger.CMLogger) *TimerService
NewTimerService initializes an instance of timer service
func (*TimerService) AddEvent ¶
func (ts *TimerService) AddEvent(event *TimerEvent)
AddEvent adds an timer event to timer channel
func (*TimerService) GetFiredCh ¶
func (ts *TimerService) GetFiredCh() <-chan *TimerEvent
GetFiredCh returns a channel to receive events
Click to show internal directories.
Click to hide internal directories.