liveness

package
v0.0.0-...-8d456d7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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

func (p *Pacemaker) GetCurrentLevel() uint64

GetCurrentLevel get current level

func (*Pacemaker) GetEpochId

func (p *Pacemaker) GetEpochId() uint64

func (*Pacemaker) GetHeight

func (p *Pacemaker) GetHeight() uint64

GetHeight get height

func (*Pacemaker) GetHighestTCLevel

func (p *Pacemaker) GetHighestTCLevel() uint64

GetHighestTCLevel get highest timeout qc' level

func (*Pacemaker) GetTC

func (p *Pacemaker) GetTC() *maxbftpb.QuorumCert

GetTC get timeout qc

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

func (p *Pacemaker) ProcessLocalTimeout(level uint64) bool

ProcessLocalTimeout process local timeout, setup pacemaker ticker

func (*Pacemaker) SetEpochId

func (p *Pacemaker) SetEpochId(epochId uint64)

func (*Pacemaker) SetupTimeout

func (p *Pacemaker) SetupTimeout()

func (*Pacemaker) UpdateTC

func (p *Pacemaker) UpdateTC(tc *maxbftpb.QuorumCert)

UpdateTC update incoming tc, update internal state

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL