tiered

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 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) AddEpochDuties added in v1.24.0

func (e *TieredEngine) AddEpochDuties(ctx context.Context, duties *types.EpochDuties) (int64, error)

AddEpochDuties stores duties write-through to S3 (primary) and the Pebble cache.

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) GetEpochDuties added in v1.24.0

func (e *TieredEngine) GetEpochDuties(ctx context.Context, firstSlot uint64) (*types.EpochDuties, error)

GetEpochDuties retrieves the full duties, checking the cache first.

func (*TieredEngine) GetSlotCommittees added in v1.24.0

func (e *TieredEngine) GetSlotCommittees(ctx context.Context, firstSlot uint64, slot uint64) ([][]uint64, error)

GetSlotCommittees reads a slot's committees, checking the cache first and populating it from S3 on a miss.

func (*TieredEngine) GetSlotPtc added in v1.24.0

func (e *TieredEngine) GetSlotPtc(ctx context.Context, firstSlot uint64, slot uint64) ([]uint64, error)

GetSlotPtc reads a slot's PTC, checking the cache first.

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.

func (*TieredEngine) HasEpochDuties added in v1.24.0

func (e *TieredEngine) HasEpochDuties(ctx context.Context, firstSlot uint64) (bool, error)

HasEpochDuties checks the cache first, then S3.

func (*TieredEngine) PruneEpochDutiesBefore added in v1.24.0

func (e *TieredEngine) PruneEpochDutiesBefore(ctx context.Context, maxFirstSlot uint64) (int64, error)

PruneEpochDutiesBefore prunes duties from both tiers.

Jump to

Keyboard shortcuts

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