synchronizer

package
v0.0.3-RC36 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: AGPL-3.0, AGPL-3.0-or-later Imports: 18 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"`
	// GenBlockNumber is the block number where the polygonZKEVM smc was deployed
	GenBlockNumber uint64 `mapstructure:"GenBlockNumber"`
	// 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,
	genesis state.Genesis,
	cfg Config) (Synchronizer, error)

NewSynchronizer creates and initializes an instance of Synchronizer

Jump to

Keyboard shortcuts

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