Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithBlockTimer ¶ added in v0.20.0
func WithBlockTimer(timer protocol.BlockTimer) func(*Config)
func WithMaxGuaranteeCount ¶ added in v0.13.0
func WithMaxReceiptCount ¶ added in v0.14.0
func WithMaxSealCount ¶
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is the builder for consensus block payloads. Upon providing a payload hash, it also memorizes which entities were included into the payload.
func NewBuilder ¶
func NewBuilder( metrics module.MempoolMetrics, state protocol.ParticipantState, headers storage.Headers, seals storage.Seals, index storage.Index, blocks storage.Blocks, resultsDB storage.ExecutionResults, receiptsDB storage.ExecutionReceipts, mutableProtocolState protocol.MutableProtocolState, guarPool mempool.Guarantees, sealPool mempool.IncorporatedResultSeals, recPool mempool.ExecutionTree, tracer module.Tracer, options ...func(*Config), ) (*Builder, error)
NewBuilder creates a new block builder.
func (*Builder) BuildOn ¶
func (b *Builder) BuildOn(parentID flow.Identifier, setter func(*flow.Header) error, sign func(*flow.Header) error) (*flow.Header, error)
BuildOn generates a new payload that is valid with respect to the parent being built upon, with the view being provided by the consensus algorithm. The builder stores the block and validates it against the protocol state before returning it. The specified parent block must exist in the protocol state.
NOTE: Since the block is stored within Builder, HotStuff MUST propose the block once BuildOn successfully returns.
# Errors This function does not produce any expected errors. However, it will pass through all errors returned by `setter` and `sign`. Callers must be aware of possible error returns from the `setter` and `sign` arguments they provide, and handle them accordingly when handling errors returned from BuildOn.
type InsertableReceipts ¶ added in v0.16.0
type InsertableReceipts struct {
// contains filtered or unexported fields
}