Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // DBPath path of the DB DBPath string `mapstructure:"DBPath"` // BlockFinality indicates the status of the blocks that will be queried in order to sync BlockFinality string `` //nolint:lll /* 134-byte string literal not displayed */ // InitialBlockNum is the first block that will be queried when starting the synchronization from scratch. // It should be a number equal or bellow the creation of the bridge contract InitialBlockNum uint64 `mapstructure:"InitialBlockNum"` // GlobalExitRootL2Addr is the address of the GER smart contract on L2 GlobalExitRootL2Addr common.Address `mapstructure:"GlobalExitRootL2Addr"` // RetryAfterErrorPeriod is the time that will be waited when an unexpected error happens before retry RetryAfterErrorPeriod types.Duration `mapstructure:"RetryAfterErrorPeriod"` // MaxRetryAttemptsAfterError is the maximum number of consecutive attempts that will happen before panicing. // Any number smaller than zero will be considered as unlimited retries MaxRetryAttemptsAfterError int `mapstructure:"MaxRetryAttemptsAfterError"` // WaitForNewBlocksPeriod time that will be waited when the synchronizer has reached the latest block WaitForNewBlocksPeriod types.Duration `mapstructure:"WaitForNewBlocksPeriod"` // DownloadBufferSize buffer of events to be porcessed. When the buffer limit is reached, // downloading will stop until the processing catches up. DownloadBufferSize int `mapstructure:"DownloadBufferSize"` }
type EthClienter ¶
type EthClienter interface { ethereum.LogFilterer ethereum.BlockNumberReader ethereum.ChainReader bind.ContractBackend }
type LastGERSync ¶
type LastGERSync struct {
// contains filtered or unexported fields
}
func New ¶
func New( ctx context.Context, dbPath string, rd sync.ReorgDetector, l2Client EthClienter, globalExitRootL2 common.Address, l1InfoTreesync *l1infotreesync.L1InfoTreeSync, retryAfterErrorPeriod time.Duration, maxRetryAttemptsAfterError int, blockFinality etherman.BlockNumberFinality, waitForNewBlocksPeriod time.Duration, downloadBufferSize int, ) (*LastGERSync, error)
func (*LastGERSync) GetFirstGERAfterL1InfoTreeIndex ¶
func (*LastGERSync) GetLastProcessedBlock ¶
func (s *LastGERSync) GetLastProcessedBlock(ctx context.Context) (uint64, error)
func (*LastGERSync) Start ¶
func (s *LastGERSync) Start(ctx context.Context)
Click to show internal directories.
Click to hide internal directories.