Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core contains the central business logic for the collector clusters' compliance engine. It is responsible for handling communication for the embedded consensus algorithm. CAUTION with CONCURRENCY:
- At the moment, compliance.Core _can not_ process blocks concurrently. Callers of `OnBlockProposal` need to ensure single-threaded access.
- The only exception is calls to `ProcessFinalizedView`, which is the only concurrency-safe method of compliance.Core
func NewCore ¶
func NewCore( log zerolog.Logger, collector module.EngineMetrics, mempool module.MempoolMetrics, hotstuffMetrics module.HotstuffMetrics, collectionMetrics module.CollectionMetrics, proposalViolationNotifier hotstuff.ProposalViolationConsumer, headers storage.Headers, state clusterkv.MutableState, pending module.PendingClusterBlockBuffer, sync module.BlockRequester, validator hotstuff.Validator, hotstuff module.HotStuff, voteAggregator hotstuff.VoteAggregator, timeoutAggregator hotstuff.TimeoutAggregator, config compliance.Config, ) (*Core, error)
NewCore instantiates the business logic for the collector clusters' compliance engine.
func (*Core) OnBlockProposal ¶
OnBlockProposal handles incoming block proposals. No errors are expected during normal operation.
func (*Core) ProcessFinalizedBlock ¶ added in v0.29.0
ProcessFinalizedBlock performs pruning of stale data based on finalization event removes pending blocks below the finalized view
type Engine ¶
type Engine struct { component.Component hotstuff.FinalizationConsumer // contains filtered or unexported fields }
Engine is a wrapper struct for `Core` which implements cluster consensus algorithm. Engine is responsible for handling incoming messages, queueing for processing, broadcasting proposals. Implements collection.Compliance interface.
func (*Engine) OnClusterBlockProposal ¶ added in v0.29.0
func (e *Engine) OnClusterBlockProposal(proposal flow.Slashable[*messages.ClusterBlockProposal])
OnClusterBlockProposal feeds a new block proposal into the processing pipeline. Incoming proposals are queued and eventually dispatched by worker.
func (*Engine) OnSyncedClusterBlock ¶ added in v0.29.0
func (e *Engine) OnSyncedClusterBlock(syncedBlock flow.Slashable[*messages.ClusterBlockProposal])
OnSyncedClusterBlock feeds a block obtained from sync proposal into the processing pipeline. Incoming proposals are queued and eventually dispatched by worker.