collection

package
v0.22.8 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 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.

func (*Finalizer) MakeValid

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

MakeValid marks a block as having passed HotStuff validation.

Jump to

Keyboard shortcuts

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