Documentation ¶
Index ¶
- type DefaultPaceMaker
- func (pm *DefaultPaceMaker) AddEvent(eventType maxbftpb.ConsStateType) *timeservice.TimerEvent
- func (pm *DefaultPaceMaker) CurView() uint64
- func (pm *DefaultPaceMaker) GetMonitorEvent() *timeservice.TimerEvent
- func (pm *DefaultPaceMaker) OnTimeout(event *timeservice.TimerEvent) *timeservice.TimerEvent
- func (pm *DefaultPaceMaker) Start()
- func (pm *DefaultPaceMaker) Stop()
- func (pm *DefaultPaceMaker) SwitchEpoch(lastFinalView uint64, round, roundInterval, roundMax uint64)
- func (pm *DefaultPaceMaker) TimeoutChannel() <-chan *timeservice.TimerEvent
- func (pm *DefaultPaceMaker) UpdateWithProposal(proposal *maxbftpb.ProposalData, isNextViewLeader bool) (*timeservice.TimerEvent, bool)
- func (pm *DefaultPaceMaker) UpdateWithQc(qc *maxbftpb.QuorumCert) (*timeservice.TimerEvent, bool)
- func (pm *DefaultPaceMaker) UpdateWithView(view uint64) bool
- type PaceMaker
- type ViewEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultPaceMaker ¶
type DefaultPaceMaker struct {
// contains filtered or unexported fields
}
DefaultPaceMaker is the default implementation of PaceMaker interface
func (*DefaultPaceMaker) AddEvent ¶
func (pm *DefaultPaceMaker) AddEvent(eventType maxbftpb.ConsStateType) *timeservice.TimerEvent
AddEvent adds an event to the time_service
func (*DefaultPaceMaker) CurView ¶
func (pm *DefaultPaceMaker) CurView() uint64
CurView returns the current view of consensus
func (*DefaultPaceMaker) GetMonitorEvent ¶
func (pm *DefaultPaceMaker) GetMonitorEvent() *timeservice.TimerEvent
GetMonitorEvent export timer event of the monitor that only be called in replay wal mode.
func (*DefaultPaceMaker) OnTimeout ¶
func (pm *DefaultPaceMaker) OnTimeout(event *timeservice.TimerEvent) *timeservice.TimerEvent
OnTimeout push the local node state machine by a timer event and process the timer event
func (*DefaultPaceMaker) SwitchEpoch ¶
func (pm *DefaultPaceMaker) SwitchEpoch(lastFinalView uint64, round, roundInterval, roundMax uint64)
SwitchEpoch Sets the state of the new epoch
func (*DefaultPaceMaker) TimeoutChannel ¶
func (pm *DefaultPaceMaker) TimeoutChannel() <-chan *timeservice.TimerEvent
TimeoutChannel get the timeout event channel
func (*DefaultPaceMaker) UpdateWithProposal ¶
func (pm *DefaultPaceMaker) UpdateWithProposal( proposal *maxbftpb.ProposalData, isNextViewLeader bool) (*timeservice.TimerEvent, bool)
UpdateWithProposal push the local node state machine by a proposal
func (*DefaultPaceMaker) UpdateWithQc ¶
func (pm *DefaultPaceMaker) UpdateWithQc(qc *maxbftpb.QuorumCert) (*timeservice.TimerEvent, bool)
UpdateWithQc push the local node state machine by a qc
func (*DefaultPaceMaker) UpdateWithView ¶
func (pm *DefaultPaceMaker) UpdateWithView(view uint64) bool
UpdateWithView push the local node state machine by a view when replay wal
type PaceMaker ¶
type PaceMaker interface { Start() Stop() CurView() uint64 TimeoutChannel() <-chan *timeservice.TimerEvent OnTimeout(event *timeservice.TimerEvent) *timeservice.TimerEvent UpdateWithQc(qc *maxbftpb.QuorumCert) (*timeservice.TimerEvent, bool) UpdateWithProposal( proposal *maxbftpb.ProposalData, isNextViewLeader bool) (*timeservice.TimerEvent, bool) UpdateWithView(view uint64) bool AddEvent(stateType maxbftpb.ConsStateType) *timeservice.TimerEvent GetMonitorEvent() *timeservice.TimerEvent SwitchEpoch(lastFinalView uint64, round, roundInterval, roundMax uint64) }
PaceMaker defines interface of consensus pacemaker of maxBft, used to maintain the activity of consensus algorithms