Documentation ¶
Index ¶
- Variables
- type BlockContainer
- type Finalizer
- func (r *Finalizer) AddBlock(block *model.Block) error
- func (r *Finalizer) FinalizedBlock() *model.Block
- func (r *Finalizer) FinalizedBlockQC() *flow.QuorumCertificate
- func (r *Finalizer) FinalizedView() uint64
- func (r *Finalizer) GetBlock(blockID flow.Identifier) (*model.Block, bool)
- func (r *Finalizer) GetBlocksForView(view uint64) []*model.Block
- func (r *Finalizer) IsKnownBlock(block *model.Block) bool
- func (r *Finalizer) IsProcessingNeeded(block *model.Block) bool
- func (r *Finalizer) IsSafeBlock(block *model.Block) bool
- func (r *Finalizer) LockedBlock() *model.Block
- func (r *Finalizer) LockedBlockQC() *flow.QuorumCertificate
- func (r *Finalizer) VerifyBlock(block *model.Block) error
Constants ¶
This section is empty.
Variables ¶
var ErrPrunedAncestry = errors.New("cannot resolve pruned ancestry")
ErrPrunedAncestry is a sentinel error: cannot resolve ancestry of block due to pruning
Functions ¶
This section is empty.
Types ¶
type BlockContainer ¶
BlockContainer wraps a block to implement forest.Vertex In addition, it holds some additional properties for efficient processing of blocks by the Finalizer
func (*BlockContainer) Level ¶
func (b *BlockContainer) Level() uint64
func (*BlockContainer) Parent ¶
func (b *BlockContainer) Parent() (flow.Identifier, uint64)
func (*BlockContainer) VertexID ¶
func (b *BlockContainer) VertexID() flow.Identifier
functions implementing forest.vertex
type Finalizer ¶
type Finalizer struct {
// contains filtered or unexported fields
}
Finalizer implements HotStuff finalization logic
func (*Finalizer) AddBlock ¶
ProcessBlock adds `block` to the consensus state. Calling this method with previously-processed blocks leaves the consensus state invariant (though, it will potentially cause some duplicate processing). UNVALIDATED: expects block to pass Finalizer.VerifyBlock(block)
func (*Finalizer) FinalizedBlock ¶
func (*Finalizer) FinalizedBlockQC ¶
func (r *Finalizer) FinalizedBlockQC() *flow.QuorumCertificate
func (*Finalizer) FinalizedView ¶
func (*Finalizer) GetBlocksForView ¶
GetBlock returns all known blocks for the given
func (*Finalizer) IsKnownBlock ¶
IsKnownBlock checks whether block is known. UNVALIDATED: expects block to pass Finalizer.VerifyBlock(block)
func (*Finalizer) IsProcessingNeeded ¶
isProcessingNeeded performs basic checks whether or not block needs processing only considering the block's height and Hash Returns false if any of the following conditions applies
- block view is _below_ the most recently finalized block
- known block
UNVALIDATED: expects block to pass Finalizer.VerifyBlock(block)
func (*Finalizer) IsSafeBlock ¶
IsSafeBlock returns true if block is safe to vote for (according to the definition in https://arxiv.org/abs/1803.05069v6). NO MODIFICATION of consensus state (read only) UNVALIDATED: expects block to pass Finalizer.VerifyBlock(block)
func (*Finalizer) LockedBlock ¶
func (*Finalizer) LockedBlockQC ¶
func (r *Finalizer) LockedBlockQC() *flow.QuorumCertificate