syncing

package
v1.0.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DARetriever

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

DARetriever handles DA retrieval operations for syncing

func NewDARetriever

func NewDARetriever(
	da coreda.DA,
	cache cache.Manager,
	config config.Config,
	genesis genesis.Genesis,
	options common.BlockOptions,
	logger zerolog.Logger,
) *DARetriever

NewDARetriever creates a new DA retriever

func (*DARetriever) RetrieveFromDA

func (r *DARetriever) RetrieveFromDA(ctx context.Context, daHeight uint64) ([]common.DAHeightEvent, error)

RetrieveFromDA retrieves blocks from the specified DA height and returns height events

type P2PHandler

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

P2PHandler handles all P2P operations for the syncer

func NewP2PHandler

func NewP2PHandler(
	headerStore goheader.Store[*types.SignedHeader],
	dataStore goheader.Store[*types.Data],
	genesis genesis.Genesis,
	options common.BlockOptions,
	logger zerolog.Logger,
) *P2PHandler

NewP2PHandler creates a new P2P handler

func (*P2PHandler) ProcessDataRange

func (h *P2PHandler) ProcessDataRange(ctx context.Context, startHeight, endHeight uint64) []common.DAHeightEvent

ProcessDataRange processes data from the data store within the given range

func (*P2PHandler) ProcessHeaderRange

func (h *P2PHandler) ProcessHeaderRange(ctx context.Context, startHeight, endHeight uint64) []common.DAHeightEvent

ProcessHeaderRange processes headers from the header store within the given range

type Syncer

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

Syncer handles block synchronization from DA and P2P sources.

func NewSyncer

func NewSyncer(
	store store.Store,
	exec coreexecutor.Executor,
	da coreda.DA,
	cache cache.Manager,
	metrics *common.Metrics,
	config config.Config,
	genesis genesis.Genesis,
	headerStore goheader.Store[*types.SignedHeader],
	dataStore goheader.Store[*types.Data],
	logger zerolog.Logger,
	options common.BlockOptions,
	errorCh chan<- error,
) *Syncer

NewSyncer creates a new block syncer

func (*Syncer) GetDAHeight

func (s *Syncer) GetDAHeight() uint64

GetDAHeight returns the current DA height

func (*Syncer) GetLastState

func (s *Syncer) GetLastState() types.State

GetLastState returns the current state

func (*Syncer) SetDAHeight

func (s *Syncer) SetDAHeight(height uint64)

SetDAHeight updates the DA height

func (*Syncer) SetLastState

func (s *Syncer) SetLastState(state types.State)

SetLastState updates the current state

func (*Syncer) Start

func (s *Syncer) Start(ctx context.Context) error

Start begins the syncing component

func (*Syncer) Stop

func (s *Syncer) Stop() error

Stop shuts down the syncing component

Jump to

Keyboard shortcuts

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