matching

package
v0.38.0-rc.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2025 License: AGPL-3.0 Imports: 25 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.17.6

type Config struct {
	SealingThreshold    uint // threshold between sealed and finalized blocks
	MaxResultsToRequest uint // maximum number of receipts to request
}

Config is a structure of values that configure behavior of matching engine

func DefaultConfig added in v0.17.6

func DefaultConfig() Config

type Core added in v0.15.0

type Core struct {
	// contains filtered or unexported fields
}

Core represents the matching business logic, used to process receipts received from p2p network. Performs processing of pending receipts, storing of receipts and re-requesting missing execution receipts.

func NewCore added in v0.15.0

func NewCore(
	log zerolog.Logger,
	tracer module.Tracer,
	metrics module.ConsensusMetrics,
	mempool module.MempoolMetrics,
	state protocol.State,
	headersDB storage.Headers,
	receiptsDB storage.ExecutionReceipts,
	receipts mempool.ExecutionTree,
	pendingReceipts mempool.PendingReceipts,
	seals mempool.IncorporatedResultSeals,
	receiptValidator module.ReceiptValidator,
	receiptRequester module.Requester,
	config Config,
) *Core

func (*Core) OnBlockFinalization added in v0.19.0

func (c *Core) OnBlockFinalization() error

func (*Core) ProcessReceipt added in v0.17.6

func (c *Core) ProcessReceipt(receipt *flow.ExecutionReceipt) error

ProcessReceipt processes a new execution receipt. Any error indicates an unexpected problem in the protocol logic. The node's internal state might be corrupted. Hence, returned errors should be treated as fatal.

type Engine

type Engine struct {
	component.Component
	// contains filtered or unexported fields
}

Engine is a wrapper struct for `Core` which implements consensus algorithm. Engine is responsible for handling incoming messages, queueing for processing, broadcasting proposals.

func NewEngine added in v0.15.0

func NewEngine(
	log zerolog.Logger,
	net network.EngineRegistry,
	me module.Local,
	engineMetrics module.EngineMetrics,
	mempool module.MempoolMetrics,
	state protocol.State,
	receipts storage.ExecutionReceipts,
	index storage.Index,
	core sealing.MatchingCore) (*Engine, error)

func (*Engine) HandleReceipt

func (e *Engine) HandleReceipt(originID flow.Identifier, receipt flow.Entity)

HandleReceipt ingests receipts from the Requester module, adding them to the queue.

func (*Engine) OnBlockIncorporated added in v0.14.3

func (e *Engine) OnBlockIncorporated(incorporatedBlock *model.Block)

OnBlockIncorporated implements the `OnBlockIncorporated` callback from the `hotstuff.FinalizationConsumer` CAUTION: the input to this callback is treated as trusted; precautions should be taken that messages from external nodes cannot be considered as inputs to this function

func (*Engine) OnFinalizedBlock added in v0.14.1

func (e *Engine) OnFinalizedBlock(*model.Block)

OnFinalizedBlock implements the `OnFinalizedBlock` callback from the `hotstuff.FinalizationConsumer` CAUTION: the input to this callback is treated as trusted; precautions should be taken that messages from external nodes cannot be considered as inputs to this function

func (*Engine) Process

func (e *Engine) Process(channel channels.Channel, originID flow.Identifier, event interface{}) error

Process receives events from the network and checks their type, before enqueuing them to be processed by a worker in a non-blocking manner. No errors expected during normal operation (errors are logged instead).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL