Documentation
¶
Index ¶
- Variables
- type Config
- type EVMMultidownloader
- func (dh *EVMMultidownloader) BlockHeader(ctx context.Context, finality aggkittypes.BlockNumberFinality) (*aggkittypes.BlockHeader, error)
- func (dh *EVMMultidownloader) BlockNumber(ctx context.Context, finality aggkittypes.BlockNumberFinality) (uint64, error)
- func (dh *EVMMultidownloader) ChainID(ctx context.Context) (uint64, error)
- func (dh *EVMMultidownloader) CheckDatabase(ctx context.Context) error
- func (dh *EVMMultidownloader) EthClient() aggkittypes.BaseEthereumClienter
- func (dh *EVMMultidownloader) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)
- func (dh *EVMMultidownloader) GetRPCServices() []jRPC.Service
- func (dh *EVMMultidownloader) HeaderByNumber(ctx context.Context, number *big.Int) (*aggkittypes.BlockHeader, error)
- func (dh *EVMMultidownloader) Initialize(ctx context.Context) error
- func (dh *EVMMultidownloader) IsAvailable(query mdrtypes.LogQuery) bool
- func (dh *EVMMultidownloader) RegisterSyncer(data aggkittypes.SyncerConfig) error
- func (dh *EVMMultidownloader) ShowStatistics(iteration int)
- func (dh *EVMMultidownloader) Start(ctx context.Context) error
- func (dh *EVMMultidownloader) StepSafe(ctx context.Context) (bool, error)
- type EVMMultidownloaderRPC
- type Statistics
- func (s *Statistics) ETA(pendingBlocks uint64) time.Duration
- func (s *Statistics) ElapsedSyncing() time.Duration
- func (s *Statistics) FinishDBOperation()
- func (s *Statistics) FinishEthCall(err error, numLogs uint64, numBlocks uint64)
- func (s *Statistics) FinishSyncing()
- func (s *Statistics) LaunchedEthCall()
- func (s *Statistics) Show(logFunc func(format string, args ...interface{}), iteration int)
- func (s *Statistics) StartDBOperation()
- func (s *Statistics) StartSyncing()
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidBlockChunkSize is returned when the block chunk size is invalid ErrInvalidBlockChunkSize = errors.New("MultidownloaderConfig.BlockChunkSize: block chunk size must be greater than 0") // ErrInvalidMaxParallelBlockHeaderRetrieval is returned when the max parallel block header retrieval is invalid ErrInvalidMaxParallelBlockHeaderRetrieval = errors.New("MultidownloaderConfig.MaxParallelBlockHeaderRetrieval:" + " max parallel block header retrieval must be greater than 0") // ErrInvalidWaitPeriodToCheckCatchUp is returned when the wait period to check catch up is invalid ErrInvalidWaitPeriodToCheckCatchUp = errors.New("MultidownloaderConfig.WaitPeriodToCheckCatchUp: " + "wait period to check catch up must be greater than 0") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Enabled indicates if the multidownloader is enabled
Enabled bool
// StoragePath is the path to the storage
StoragePath string
// BlockChunkSize is the number of blocks to query in each FilterLogs call
BlockChunkSize uint32
// MaxParallelBlockHeaderRetrieval is the maximum number of parallel RPC calls to retrieve block headers
MaxParallelBlockHeaderRetrieval int
// BlockFinality is which block to consider final (typically finalizedBlock)
BlockFinality aggkittypes.BlockNumberFinality
// WaitPeriodToCheckCatchUp is the duration to wait before checking again if logs are not yet available
WaitPeriodToCheckCatchUp types.Duration
}
func NewConfigDefault ¶
type EVMMultidownloader ¶
type EVMMultidownloader struct {
// contains filtered or unexported fields
}
func NewEVMMultidownloader ¶
func NewEVMMultidownloader(log aggkitcommon.Logger, cfg Config, name string, ethClient aggkittypes.BaseEthereumClienter, rpcClient aggkittypes.RPCClienter, storageDB mdrtypes.Storager, blockNotifierManager ethermantypes.BlockNotifierManager, ) (*EVMMultidownloader, error)
NewEVMMultidownloader creates a new EVM multidownloader instance with proper validation
func (*EVMMultidownloader) BlockHeader ¶
func (dh *EVMMultidownloader) BlockHeader(ctx context.Context, finality aggkittypes.BlockNumberFinality) (*aggkittypes.BlockHeader, error)
BlockHeader gets the block header for the given finality type
func (*EVMMultidownloader) BlockNumber ¶
func (dh *EVMMultidownloader) BlockNumber(ctx context.Context, finality aggkittypes.BlockNumberFinality) (uint64, error)
BlockNumber gets the block number for the given finality type
func (*EVMMultidownloader) ChainID ¶
func (dh *EVMMultidownloader) ChainID(ctx context.Context) (uint64, error)
ChainID gets the chain ID directly from ethClient
func (*EVMMultidownloader) CheckDatabase ¶
func (dh *EVMMultidownloader) CheckDatabase(ctx context.Context) error
func (*EVMMultidownloader) EthClient ¶
func (dh *EVMMultidownloader) EthClient() aggkittypes.BaseEthereumClienter
EthClient returns the underlying eth client
func (*EVMMultidownloader) FilterLogs ¶
func (dh *EVMMultidownloader) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)
FilterLogs filters the logs. It gets them from storage or waits until they are available
func (*EVMMultidownloader) GetRPCServices ¶
func (dh *EVMMultidownloader) GetRPCServices() []jRPC.Service
func (*EVMMultidownloader) HeaderByNumber ¶
func (dh *EVMMultidownloader) HeaderByNumber(ctx context.Context, number *big.Int) (*aggkittypes.BlockHeader, error)
HeaderByNumber gets the block header for the given block number from storage or ethClient
func (*EVMMultidownloader) Initialize ¶
func (dh *EVMMultidownloader) Initialize(ctx context.Context) error
Initialize initializes the multidownloader. At this point all syncers must be registered and it will prepare the pendingSync segments
func (*EVMMultidownloader) IsAvailable ¶
func (dh *EVMMultidownloader) IsAvailable(query mdrtypes.LogQuery) bool
func (*EVMMultidownloader) RegisterSyncer ¶
func (dh *EVMMultidownloader) RegisterSyncer(data aggkittypes.SyncerConfig) error
func (*EVMMultidownloader) ShowStatistics ¶
func (dh *EVMMultidownloader) ShowStatistics(iteration int)
type EVMMultidownloaderRPC ¶
type EVMMultidownloaderRPC struct {
// contains filtered or unexported fields
}
func NewEVMMultidownloaderRPC ¶
func NewEVMMultidownloaderRPC( logger aggkitcommon.Logger, downloader *EVMMultidownloader, ) *EVMMultidownloaderRPC
func (*EVMMultidownloaderRPC) Status ¶
func (b *EVMMultidownloaderRPC) Status() (interface{}, rpc.Error)
Status returns the status of the L1InfoTreeSync component curl -X POST http://localhost:5576/ "Content-Type: application/json" \ -d '{"method":"l1infotreesync_status", "params":[], "id":1}'
type Statistics ¶
type Statistics struct {
// contains filtered or unexported fields
}
func NewStatistics ¶
func NewStatistics() *Statistics
func (*Statistics) ElapsedSyncing ¶
func (s *Statistics) ElapsedSyncing() time.Duration
func (*Statistics) FinishDBOperation ¶
func (s *Statistics) FinishDBOperation()
func (*Statistics) FinishEthCall ¶
func (s *Statistics) FinishEthCall(err error, numLogs uint64, numBlocks uint64)
func (*Statistics) FinishSyncing ¶
func (s *Statistics) FinishSyncing()
func (*Statistics) LaunchedEthCall ¶
func (s *Statistics) LaunchedEthCall()
func (*Statistics) Show ¶
func (s *Statistics) Show(logFunc func(format string, args ...interface{}), iteration int)
func (*Statistics) StartDBOperation ¶
func (s *Statistics) StartDBOperation()
func (*Statistics) StartSyncing ¶
func (s *Statistics) StartSyncing()