snapshot

package
v2.8.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Overview

Package snapshot provides a BlockHeightContractFilterer backed by a pre-computed postage batch snapshot, used to rebuild the batch store from an embedded snapshot instead of replaying the whole postage contract history.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(
	ctx context.Context,
	logger log.Logger,
	getter SnapshotGetter,
	syncingStopped *syncutil.Signaler,
	contractAddress common.Address,
	contractABI abi.ABI,
	blockTime time.Duration,
	stallingTimeout time.Duration,
	backoffTimeout time.Duration,
	startBlock uint64,
) (*batchservice.Snapshot, error)

New builds the inputs the batch service needs to rebuild the store from the embedded snapshot: a listener that replays the snapshot's logs and the block to start from. The snapshot is parsed eagerly here so a corrupt one fails fast and the caller can fall back to a full chain rebuild.

Types

type SnapshotGetter

type SnapshotGetter interface {
	GetBatchSnapshot() []byte
}

type SnapshotLogFilterer

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

func NewSnapshotLogFilterer

func NewSnapshotLogFilterer(logger log.Logger, getter SnapshotGetter) *SnapshotLogFilterer

func (*SnapshotLogFilterer) BlockNumber

func (f *SnapshotLogFilterer) BlockNumber(_ context.Context) (uint64, error)

func (*SnapshotLogFilterer) FilterLogs

func (f *SnapshotLogFilterer) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)

func (*SnapshotLogFilterer) GetBatchSnapshot

func (f *SnapshotLogFilterer) GetBatchSnapshot() []byte

Directories

Path Synopsis
Package archive provides a snapshot.SnapshotGetter backed by the postage batch snapshot blob embedded in the binary at build time.
Package archive provides a snapshot.SnapshotGetter backed by the postage batch snapshot blob embedded in the binary at build time.

Jump to

Keyboard shortcuts

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