consensus

package
v0.26.11 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: AGPL-3.0 Imports: 11 Imported by: 2 modules, 8 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCleanup

func WithCleanup(cleanup CleanupFunc) func(*Finalizer)

Types

type CleanupFunc

type CleanupFunc func(blockID flow.Identifier) error

CleanupFunc is called after a block was finalized to allow other components to execute cleanup operations.

func CleanupMempools

func CleanupMempools(
	collector module.MempoolMetrics,
	spans module.ConsensusMetrics,
	payloads storage.Payloads,
	guarantees mempool.Guarantees,
	seals mempool.IncorporatedResultSeals) CleanupFunc

func CleanupNothing

func CleanupNothing() CleanupFunc

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 fully finalized to the persistent protocol state.

func NewFinalizer

func NewFinalizer(db *badger.DB,
	headers storage.Headers,
	state protocol.MutableState,
	tracer module.Tracer,
	options ...func(*Finalizer)) *Finalizer

NewFinalizer creates a new finalizer for the temporary state.

func (*Finalizer) MakeFinal

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

MakeFinal will finalize the block with the given ID and clean up the memory pools after it.

This assumes that guarantees and seals are already in persistent state when 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