synchronizer

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: AGPL-3.0, AGPL-3.0-or-later Imports: 22 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientSynchronizer

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

ClientSynchronizer connects L1 and L2

func (*ClientSynchronizer) Stop

func (s *ClientSynchronizer) Stop()

Stop function stops the synchronizer

func (*ClientSynchronizer) Sync

func (s *ClientSynchronizer) Sync() error

Sync function will read the last state synced and will continue from that point. Sync() will read blockchain events to detect rollup updates

type Config

type Config struct {
	// SyncInterval is the delay interval between reading new rollup information
	SyncInterval types.Duration `mapstructure:"SyncInterval"`
	// SyncChunkSize is the number of blocks to sync on each chunk
	SyncChunkSize uint64 `mapstructure:"SyncChunkSize"`
	// TrustedSequencerURL is the rpc url to connect and sync the trusted state
	TrustedSequencerURL string `mapstructure:"TrustedSequencerURL"`
}

Config represents the configuration of the synchronizer

type Synchronizer

type Synchronizer interface {
	Sync() error
	Stop()
}

Synchronizer connects L1 and L2

func NewSynchronizer

func NewSynchronizer(
	isTrustedSequencer bool,
	ethMan ethermanInterface,
	st stateInterface,
	pool poolInterface,
	ethTxManager ethTxManager,
	zkEVMClient zkEVMClientInterface,
	eventLog *event.EventLog,
	genesis state.Genesis,
	cfg Config) (Synchronizer, error)

NewSynchronizer creates and initializes an instance of Synchronizer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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