batchfetcher

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewModule

func NewModule(mc *ModuleConfig, epochNr t.EpochNr, clientProgress *clientprogress.ClientProgress) modules.Module

NewModule returns a new batch fetcher module. The batch fetcher receives events output by the ordering protocol (e.g. ISS) and relays them to the application in the same order. It replaces the DeliverCert events from the input stream by the corresponding ProvideTransactions that it obtains from the availability layer. It keeps track of the current epoch (by observing the relayed NewEpoch events) and automatically requests the transactions from the correct instance of the availability module.

The batch fetcher also deduplicates the transactions, guaranteeing that each transaction is output only the first time it appears in a batch. For this purpose, the batch fetcher maintains information about which transactions have been delivered and provides it to the checkpoint module when relaying a state snapshot request to the application. Analogously, when relaying a RestoreState event, it restores its state (including the delivered transactions) using the relayed information.

Types

type ModuleConfig

type ModuleConfig struct {
	Self         t.ModuleID // Own ID.
	Availability t.ModuleID // ID of the factory module containing the availability modules.
	Checkpoint   t.ModuleID // ID of the checkpoint factory module to which to submit client progress.
	Destination  t.ModuleID // ID of the module to deliver the produced event stream to (usually the application).
}

ModuleConfig determines the IDs of the modules the batch fetcher interacts with.

func DefaultModuleConfig

func DefaultModuleConfig() *ModuleConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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