collection

package
v0.37.0-crescendo-RC5 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: AGPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finalizer

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

Finalizer is a simple wrapper around our temporary state to clean up after a block has been finalized. This involves removing the transactions within the finalized collection from the mempool and updating the finalized boundary in the cluster state.

func NewFinalizer

func NewFinalizer(
	db *badger.DB,
	transactions mempool.Transactions,
	prov network.Engine,
	metrics module.CollectionMetrics,
) *Finalizer

NewFinalizer creates a new finalizer for collection nodes.

func (*Finalizer) MakeFinal

func (f *Finalizer) MakeFinal(blockID flow.Identifier) error

MakeFinal handles finalization logic for a block.

The newly finalized block, and all un-finalized ancestors, are marked as finalized in the cluster state. All transactions included in the collections within the finalized blocks are removed from the mempool.

This assumes that transactions are added to persistent state when they are included in a block proposal. Between entering the non-finalized chain state and being finalized, entities should be present in both the volatile memory pools and persistent storage. No errors are expected during normal operation.

Jump to

Keyboard shortcuts

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