Documentation ¶
Index ¶
- type SyncProgressTracker
- func (t *SyncProgressTracker) ClearMeta()
- func (t *SyncProgressTracker) HeadChanged(newID *big.Int) bool
- func (t *SyncProgressTracker) LastSyncedVerifiedBlockHash() common.Hash
- func (t *SyncProgressTracker) LastSyncedVerifiedBlockHeight() *big.Int
- func (t *SyncProgressTracker) LastSyncedVerifiedBlockID() *big.Int
- func (t *SyncProgressTracker) OutOfSync() bool
- func (t *SyncProgressTracker) Track(ctx context.Context)
- func (t *SyncProgressTracker) Triggered() bool
- func (t *SyncProgressTracker) UpdateMeta(id, height *big.Int, blockHash common.Hash)
- type Syncer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SyncProgressTracker ¶
type SyncProgressTracker struct {
// contains filtered or unexported fields
}
SyncProgressTracker is responsible for tracking the L2 execution engine's sync progress, after a beacon sync is triggered in it, and check whether the L2 execution is not able to sync through P2P (due to no connected peer or some other reasons).
func NewSyncProgressTracker ¶
func NewSyncProgressTracker(c *ethclient.Client, timeout time.Duration) *SyncProgressTracker
NewSyncProgressTracker creates a new SyncProgressTracker instance.
func (*SyncProgressTracker) ClearMeta ¶
func (t *SyncProgressTracker) ClearMeta()
ClearMeta cleans the inner beacon sync meta data.
func (*SyncProgressTracker) HeadChanged ¶
func (t *SyncProgressTracker) HeadChanged(newID *big.Int) bool
HeadChanged checks if a new beacon sync request will be needed.
func (*SyncProgressTracker) LastSyncedVerifiedBlockHash ¶
func (t *SyncProgressTracker) LastSyncedVerifiedBlockHash() common.Hash
LastSyncedVerifiedBlockHash returns tracker.lastSyncedVerifiedBlockHash.
func (*SyncProgressTracker) LastSyncedVerifiedBlockHeight ¶
func (t *SyncProgressTracker) LastSyncedVerifiedBlockHeight() *big.Int
LastSyncedVerifiedBlockHeight returns tracker.lastSyncedVerifiedBlockHeight.
func (*SyncProgressTracker) LastSyncedVerifiedBlockID ¶
func (t *SyncProgressTracker) LastSyncedVerifiedBlockID() *big.Int
LastSyncedVerifiedBlockID returns tracker.lastSyncedVerifiedBlockID.
func (*SyncProgressTracker) OutOfSync ¶
func (t *SyncProgressTracker) OutOfSync() bool
OutOfSync tells whether the L2 execution engine is marked as out of sync.
func (*SyncProgressTracker) Track ¶
func (t *SyncProgressTracker) Track(ctx context.Context)
Track starts the inner event loop, to monitor the sync progress.
func (*SyncProgressTracker) Triggered ¶
func (t *SyncProgressTracker) Triggered() bool
Triggered returns tracker.triggered.
func (*SyncProgressTracker) UpdateMeta ¶
func (t *SyncProgressTracker) UpdateMeta(id, height *big.Int, blockHash common.Hash)
UpdateMeta updates the inner beacon sync meta data.
type Syncer ¶
type Syncer struct {
// contains filtered or unexported fields
}
Syncer responsible for letting the L2 execution engine catching up with protocol's latest verified block through P2P beacon sync.
func NewSyncer ¶
func NewSyncer( ctx context.Context, rpc *rpc.Client, state *state.State, progressTracker *SyncProgressTracker, ) *Syncer
NewSyncer creates a new syncer instance.
func (*Syncer) TriggerBeaconSync ¶
TriggerBeaconSync triggers the L2 execution engine to start performing a beacon sync.