Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pruner ¶
Pruner is a component responsible for pruning data from execution data storage. It is configured with the following parameters:
- Height range target: The target number of most recent blocks to store data for. This controls the total amount of data stored on disk.
- Threshold: The number of block heights that we can exceed the height range target by before pruning is triggered. This controls the frequency of pruning.
The Pruner consumes a stream of tracked height notifications, and triggers pruning once the difference between the tracked height and the last pruned height reaches the height range target + threshold. A height is considered fulfilled once it has both been executed, tracked, and sealed.
func NewPruner ¶
func NewPruner(logger zerolog.Logger, metrics module.ExecutionDataPrunerMetrics, storage tracker.Storage, opts ...PrunerOption) (*Pruner, error)
NewPruner creates a new Pruner.
func (*Pruner) NotifyFulfilledHeight ¶
NotifyFulfilledHeight notifies the Pruner of the latest fulfilled height.
func (*Pruner) SetHeightRangeTarget ¶
SetHeightRangeTarget updates the Pruner's height range target. This may block for the duration of a pruning operation.
func (*Pruner) SetThreshold ¶
SetThreshold update's the Pruner's threshold. This may block for the duration of a pruning operation.
type PrunerOption ¶
type PrunerOption func(*Pruner)
func WithHeightRangeTarget ¶
func WithHeightRangeTarget(heightRangeTarget uint64) PrunerOption
WithHeightRangeTarget is used to configure the pruner with a custom height range target.
func WithPruneCallback ¶
func WithPruneCallback(callback func(context.Context) error) PrunerOption
func WithThreshold ¶
func WithThreshold(threshold uint64) PrunerOption
WithThreshold is used to configure the pruner with a custom threshold.