tiered

package
v1.22.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTieredEngine

func NewTieredEngine(config dtypes.TieredBlockDBConfig, logger logrus.FieldLogger) (types.BlockDbEngine, error)

NewTieredEngine creates a new tiered storage engine.

Types

type TieredEngine

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

TieredEngine combines Pebble (cache) and S3 (primary storage) in a tiered architecture. Reads check cache first, then fall back to S3. Writes go to both (write-through).

func (*TieredEngine) AddBlock

func (e *TieredEngine) AddBlock(
	ctx context.Context,
	slot uint64,
	root []byte,
	dataCb func() (*types.BlockData, error),
) (bool, bool, error)

AddBlock stores block data using write-through to both cache and S3. Returns (added, updated, error).

func (*TieredEngine) Close

func (e *TieredEngine) Close() error

Close closes both storage engines.

func (*TieredEngine) GetBlock

func (e *TieredEngine) GetBlock(
	ctx context.Context,
	slot uint64,
	root []byte,
	flags types.BlockDataFlags,
	parseBlock func(uint64, []byte) (any, error),
	parsePayload func(uint64, []byte) (any, error),
) (*types.BlockData, error)

GetBlock retrieves block data with selective loading. Checks cache first, fetches missing components from S3.

func (*TieredEngine) GetStoredComponents

func (e *TieredEngine) GetStoredComponents(ctx context.Context, slot uint64, root []byte) (types.BlockDataFlags, error)

GetStoredComponents returns which components exist for a block. Checks cache first, then S3.

Jump to

Keyboard shortcuts

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