replay

package
v1.16.49 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2025 License: GPL-3.0, BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LegacyBlock

type LegacyBlock struct {
	Header       *LegacyHeader
	Transactions types.Transactions
	Uncles       []*LegacyHeader
}

LegacyBlock represents old format blocks

type LegacyHeader

type LegacyHeader struct {
	ParentHash  common.Hash
	UncleHash   common.Hash
	Coinbase    common.Address
	Root        common.Hash
	TxHash      common.Hash
	ReceiptHash common.Hash
	Bloom       types.Bloom
	Difficulty  *big.Int
	Number      *big.Int
	GasLimit    uint64
	GasUsed     uint64
	Time        uint64
	Extra       []byte
	MixDigest   common.Hash
	Nonce       types.BlockNonce

	// SubnetEVM specific
	BlockGasCost *big.Int `rlp:"optional"`
}

LegacyHeader represents old format header

type ReplayConfig

type ReplayConfig struct {
	// BadgerDB path for migrated blocks
	BadgerDBPath string

	// Target database for replayed blocks
	TargetDB ethdb.Database

	// Chain configuration
	ChainConfig *params.ChainConfig

	// Network parameters
	NetworkID     uint64
	Layer         uint8 // 0=C-Chain, 1=L1, 2=L2, 3=L3
	ConsensusType uint8 // 0=POA, 1=POS, 2=POW

	// Replay parameters
	StartBlock       uint64
	EndBlock         uint64
	BatchSize        int
	UpgradeToQuantum bool

	// Progress callback
	OnProgress func(current, total uint64)
}

ReplayConfig configures the unified replay system

type ReplayResult

type ReplayResult struct {
	TotalBlocks     uint64
	ProcessedBlocks uint64
	FailedBlocks    uint64
	UpgradedBlocks  uint64
	Duration        time.Duration
	Errors          []error
}

ReplayResult contains replay statistics

func FullReplay

func FullReplay(ctx context.Context, config *ReplayConfig) (*ReplayResult, error)

FullReplay performs complete replay with statistics

type UnifiedReplayer

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

UnifiedReplayer handles block replay with format conversion

func NewUnifiedReplayer

func NewUnifiedReplayer(config *ReplayConfig) (*UnifiedReplayer, error)

NewUnifiedReplayer creates a new replay instance

func (*UnifiedReplayer) Close

func (r *UnifiedReplayer) Close() error

Close releases resources

func (*UnifiedReplayer) GetErrors

func (r *UnifiedReplayer) GetErrors() []error

GetErrors returns all recorded errors

func (*UnifiedReplayer) ReplayBlocks

func (r *UnifiedReplayer) ReplayBlocks(ctx context.Context) error

ReplayBlocks replays blocks from BadgerDB to the unified format

Jump to

Keyboard shortcuts

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