Documentation ¶
Overview ¶
Package ingest implements an engine for receiving transactions that need to be packaged into a collection.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // how much buffer time there is between a transaction being ingested by a // collection node and being included in a collection and block ExpiryBuffer uint // the maximum transaction gas limit MaxGasLimit uint64 // whether or not we check that transaction scripts are parse-able CheckScriptsParse bool // the maximum address index we accept MaxAddressIndex uint64 // how many extra nodes in the responsible cluster we propagate transactions to // (we always send to at least one) PropagationRedundancy uint // the maximum transaction byte size limit MaxTransactionByteSize uint64 // maximum collection byte size, it acts as hard limit max for the tx size. MaxCollectionByteSize uint64 // maximum number of un-processed transaction messages to hold in the queue. MaxMessageQueueSize uint }
Config defines configuration for the transaction ingest engine.
func DefaultConfig ¶
func DefaultConfig() Config
type Engine ¶
type Engine struct { *component.ComponentManager // contains filtered or unexported fields }
Engine is the transaction ingestion engine, which ensures that new transactions are delegated to the correct collection cluster, and prepared to be included in a collection.
func New ¶
func New( log zerolog.Logger, net network.Network, state protocol.State, engMetrics module.EngineMetrics, mempoolMetrics module.MempoolMetrics, colMetrics module.CollectionMetrics, me module.Local, chain flow.Chain, pools *epochs.TransactionPools, config Config, ) (*Engine, error)
New creates a new collection ingest engine.
func (*Engine) Process ¶
func (e *Engine) Process(channel network.Channel, originID flow.Identifier, event interface{}) error
Process processes a transaction message from the network and enqueues the message. Validation and ingestion is performed in the processQueuedTransactions worker.
func (*Engine) ProcessTransaction ¶ added in v0.25.0
func (e *Engine) ProcessTransaction(tx *flow.TransactionBody) error
ProcessTransaction processes a transaction message submitted from another local component. The transaction is validated and ingested synchronously. This is used by the GRPC API, for transactions from Access nodes.