consensus

package
v0.33.36-pebble-storage Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: AGPL-3.0 Imports: 13 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCleanup

func WithCleanup(cleanup CleanupFunc) func(*Finalizer)

func WithCleanupPebble

func WithCleanupPebble(cleanup CleanupFunc) func(*FinalizerPebble)

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.FollowerState,
	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. No errors are expected during normal operation.

type FinalizerPebble

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

FinalizerPebble is a simple wrapper around our temporary state to clean up after a block has been fully finalized to the persistent protocol state.

func NewFinalizerPebble

func NewFinalizerPebble(db *pebble.DB,
	headers storage.Headers,
	state protocol.FollowerState,
	tracer module.Tracer,
	options ...func(*FinalizerPebble)) *FinalizerPebble

NewFinalizerPebble creates a new finalizer for the temporary state.

func (*FinalizerPebble) MakeFinal

func (f *FinalizerPebble) 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. 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