Documentation
¶
Index ¶
- func CmpBlockHeight(b1, b2 Block) int
- func IsThreeChain(b, b1, b2 Block) bool
- type Block
- type Driver
- type Hotstuff
- func (hs *Hotstuff) CanVote(bNew Block) bool
- func (hs *Hotstuff) CheckLivenessRule(bNew Block) bool
- func (hs *Hotstuff) CheckSafetyRule(bNew Block) bool
- func (s Hotstuff) GetBExec() Block
- func (s Hotstuff) GetBLeaf() Block
- func (s Hotstuff) GetBLock() Block
- func (s Hotstuff) GetBVote() Block
- func (s Hotstuff) GetQCHigh() QC
- func (s Hotstuff) GetVoteCount() int
- func (s Hotstuff) GetVotes() []Vote
- func (s Hotstuff) IsProposing() bool
- func (hs *Hotstuff) OnPropose() Block
- func (hs *Hotstuff) OnReceiveProposal(bNew Block)
- func (hs *Hotstuff) OnReceiveVote(v Vote)
- func (s Hotstuff) SubscribeNewQCHigh() *emitter.Subscription
- func (hs *Hotstuff) Update(bNew Block)
- func (hs *Hotstuff) UpdateQCHigh(qc QC)
- type QC
- type Vote
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CmpBlockHeight ¶
CmpBlockHeight compares two blocks by height
func IsThreeChain ¶
IsThreeChain checks whether the blocks satisfy three chain rule
Types ¶
type Driver ¶
type Driver interface { MajorityCount() int CreateLeaf(parent Block, qc QC, height uint64) Block CreateQC(votes []Vote) QC BroadcastProposal(blk Block) VoteBlock(blk Block) Commit(blk Block) }
Driver godoc
type Hotstuff ¶
type Hotstuff struct {
// contains filtered or unexported fields
}
Hotstuff consensus engine
func (*Hotstuff) CheckLivenessRule ¶
CheckLivenessRule returns true if the qc referenced block of the given block is higher than b_Lock
func (*Hotstuff) CheckSafetyRule ¶
CheckSafetyRule returns true if the given block extends from b_Lock
func (Hotstuff) GetVoteCount ¶
func (s Hotstuff) GetVoteCount() int
func (Hotstuff) IsProposing ¶
func (s Hotstuff) IsProposing() bool
func (*Hotstuff) OnReceiveProposal ¶
OnReceiveProposal is called when a new proposal is received
func (*Hotstuff) OnReceiveVote ¶
OnReceiveVote is called when received a vote
func (Hotstuff) SubscribeNewQCHigh ¶
func (s Hotstuff) SubscribeNewQCHigh() *emitter.Subscription
func (*Hotstuff) UpdateQCHigh ¶
UpdateQCHigh replaces qcHigh if the block of given qc is higher than the qcHigh block
Click to show internal directories.
Click to hide internal directories.