Documentation
¶
Index ¶
- func CreateLeaf(parent *data.Block, cmds []data.Command, qc *data.QuorumCert, height int) *data.Block
- type Event
- type EventType
- type HotStuffCore
- func (hs *HotStuffCore) AddCommand(command data.Command)
- func (hs *HotStuffCore) Close()
- func (hs *HotStuffCore) CreateProposal() *data.Block
- func (hs *HotStuffCore) GetEvents() chan Event
- func (hs *HotStuffCore) GetExec() chan []data.Command
- func (hs *HotStuffCore) GetHeight() int
- func (hs *HotStuffCore) GetLeaf() *data.Block
- func (hs *HotStuffCore) GetQCHigh() *data.QuorumCert
- func (hs *HotStuffCore) GetVotedHeight() int
- func (hs *HotStuffCore) OnReceiveNewView(qc *data.QuorumCert)
- func (hs *HotStuffCore) OnReceiveProposal(block *data.Block) (*data.PartialCert, error)
- func (hs *HotStuffCore) OnReceiveVote(cert *data.PartialCert)
- func (hs *HotStuffCore) SetLeaf(block *data.Block)
- func (hs *HotStuffCore) UpdateQCHigh(qc *data.QuorumCert) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HotStuffCore ¶
type HotStuffCore struct {
Config *config.ReplicaConfig
Blocks data.BlockStorage
SigCache *data.SignatureCache
// contains filtered or unexported fields
}
HotStuffCore is the safety core of the HotStuffCore protocol
func (*HotStuffCore) AddCommand ¶
func (hs *HotStuffCore) AddCommand(command data.Command)
func (*HotStuffCore) Close ¶
func (hs *HotStuffCore) Close()
Close frees resources held by HotStuff and closes backend connections
func (*HotStuffCore) CreateProposal ¶
func (hs *HotStuffCore) CreateProposal() *data.Block
CreateProposal creates a new proposal
func (*HotStuffCore) GetEvents ¶
func (hs *HotStuffCore) GetEvents() chan Event
func (*HotStuffCore) GetExec ¶
func (hs *HotStuffCore) GetExec() chan []data.Command
func (*HotStuffCore) GetHeight ¶
func (hs *HotStuffCore) GetHeight() int
GetHeight returns the height of the tree
func (*HotStuffCore) GetLeaf ¶
func (hs *HotStuffCore) GetLeaf() *data.Block
GetLeaf returns the current leaf node of the tree
func (*HotStuffCore) GetQCHigh ¶
func (hs *HotStuffCore) GetQCHigh() *data.QuorumCert
GetQCHigh returns the highest valid Quorum Certificate known to the hotstuff instance.
func (*HotStuffCore) GetVotedHeight ¶
func (hs *HotStuffCore) GetVotedHeight() int
GetVotedHeight returns the height that was last voted at
func (*HotStuffCore) OnReceiveNewView ¶
func (hs *HotStuffCore) OnReceiveNewView(qc *data.QuorumCert)
OnReceiveNewView handles the leader's response to receiving a NewView rpc from a replica
func (*HotStuffCore) OnReceiveProposal ¶
func (hs *HotStuffCore) OnReceiveProposal(block *data.Block) (*data.PartialCert, error)
OnReceiveProposal handles a replica's response to the Proposal from the leader
func (*HotStuffCore) OnReceiveVote ¶
func (hs *HotStuffCore) OnReceiveVote(cert *data.PartialCert)
OnReceiveVote handles an incoming vote from a replica
func (*HotStuffCore) SetLeaf ¶
func (hs *HotStuffCore) SetLeaf(block *data.Block)
SetLeaf sets the leaf node of the tree
func (*HotStuffCore) UpdateQCHigh ¶
func (hs *HotStuffCore) UpdateQCHigh(qc *data.QuorumCert) bool
UpdateQCHigh updates the qc held by the paceMaker, to the newest qc.