Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Recover ¶
Recover is a utility method for recovering the HotStuff state after a restart. It receives the list `pending` containing _all_ blocks that
- have passed the compliance layer and stored in the protocol state
- descend from the latest finalized block
- are listed in ancestor-first order (i.e. for any block B ∈ pending, B's parent must be listed before B, unless B's parent is the latest finalized block)
CAUTION: all pending blocks are required to be valid (guaranteed if the block passed the compliance layer)
Types ¶
type BlockScanner ¶ added in v0.31.0
type BlockScanner func(proposal *model.SignedProposal) error
BlockScanner describes a function for ingesting pending blocks. Any returned errors are considered fatal.
func CollectParentQCs ¶ added in v0.31.0
func CollectParentQCs(collector Collector[*flow.QuorumCertificate]) BlockScanner
CollectParentQCs collects all parent QCs included in the blocks descending from the latest finalized block. Caution, input blocks must be valid.
func CollectTCs ¶ added in v0.31.0
func CollectTCs(collector Collector[*flow.TimeoutCertificate]) BlockScanner
CollectTCs collect all TCs included in the blocks descending from the latest finalized block. Caution, input blocks must be valid.
func ForksState ¶ added in v0.31.0
func ForksState(forks hotstuff.Forks) BlockScanner
ForksState recovers Forks' internal state of blocks descending from the latest finalized block. Caution, input blocks must be valid and in parent-first order (unless parent is the latest finalized block).
func VoteAggregatorState ¶ added in v0.31.0
func VoteAggregatorState(voteAggregator hotstuff.VoteAggregator) BlockScanner
VoteAggregatorState recovers the VoteAggregator's internal state as follows:
- Add all blocks descending from the latest finalized block to accept votes. Those blocks should be rapidly pruned as the node catches up.
Caution: input blocks must be valid.
type Collector ¶ added in v0.31.0
type Collector[T any] struct { // contains filtered or unexported fields }
Collector for objects of generic type. Essentially, it is a stateful list. Safe to be passed by value. Retrieve() returns the current state of the list and is unaffected by subsequent appends.