historyprunner

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Migrator

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

func New

func New(retainedBlocks uint64, minAge time.Duration) *Migrator

New constructs a history pruner migrator. retainedBlocks is the number of blocks retained below the L1-confirmed head; the head itself is always retained on top. retainedBlocks == 0 keeps only the L1 head plus the reorg-safe window above it. minAge layers a wallclock floor on top: blocks whose on-chain timestamp is younger than minAge are also retained, mirroring the running pruner's --prune-min-age. Zero disables it.

func (*Migrator) Before

func (m *Migrator) Before(state []byte) error

Before restores stager/restorer progress and the pinned cutoff from persisted intermediate state. A nil/empty state means a fresh run — the cutoff is computed on the first Migrate call. Once pinned, retainedBlocks and minAge config changes between runs are ignored until completion.

func (*Migrator) Migrate

func (m *Migrator) Migrate(
	ctx context.Context,
	database db.KeyValueStore,
	network *networks.Network,
	logger log.StructuredLogger,
) ([]byte, error)

Jump to

Keyboard shortcuts

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