Documentation ¶
Index ¶
- type Pacemaker
- func (p *Pacemaker) GetCurrentLevel() uint64
- func (p *Pacemaker) GetEpochId() uint64
- func (p *Pacemaker) GetHeight() uint64
- func (p *Pacemaker) GetHighestTCLevel() uint64
- func (p *Pacemaker) GetTC() *maxbftpb.QuorumCert
- func (p *Pacemaker) ProcessCertificates(qc *maxbftpb.QuorumCert, tc *maxbftpb.QuorumCert, hcLevel uint64) bool
- func (p *Pacemaker) ProcessLocalTimeout(level uint64) bool
- func (p *Pacemaker) SetEpochId(epochId uint64)
- func (p *Pacemaker) SetupTimeout()
- func (p *Pacemaker) UpdateTC(tc *maxbftpb.QuorumCert)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pacemaker ¶
type Pacemaker struct {
// contains filtered or unexported fields
}
Pacemaker govern the advancement of levels and height in the local node. The Pacemaker keeps track of qc and tc; which qc is proposal type, tc is newView type.
func NewPacemaker ¶
func NewPacemaker(logger protocol.Logger, index uint64, height uint64, commitLevel uint64, epochId uint64, ts *timeservice.TimerService) *Pacemaker
NewPacemaker init a pacemaker
func (*Pacemaker) GetCurrentLevel ¶
GetCurrentLevel get current level
func (*Pacemaker) GetEpochId ¶
func (*Pacemaker) GetHighestTCLevel ¶
GetHighestTCLevel get highest timeout qc' level
func (*Pacemaker) ProcessCertificates ¶
func (p *Pacemaker) ProcessCertificates(qc *maxbftpb.QuorumCert, tc *maxbftpb.QuorumCert, hcLevel uint64) bool
ProcessCertificates Push status of consensus to the next block height or level, and set a local timeout `ConsStateType_PACE_MAKER` when a new level is reached. height The height of the received QC hqcLevel The highest QC in local node htcLevel The tc level in incoming msg(proposal or vote), hcLevel The latest committed level in local node When the consensus enters the next level, return true, otherwise return false. func (p *Pacemaker) ProcessCertificates(height, hqcLevel, htcLevel, hcLevel uint64) bool {
func (*Pacemaker) ProcessLocalTimeout ¶
ProcessLocalTimeout process local timeout, setup pacemaker ticker
func (*Pacemaker) SetEpochId ¶
func (*Pacemaker) SetupTimeout ¶
func (p *Pacemaker) SetupTimeout()
func (*Pacemaker) UpdateTC ¶
func (p *Pacemaker) UpdateTC(tc *maxbftpb.QuorumCert)
UpdateTC update incoming tc, update internal state