Documentation ¶
Index ¶
- type SyncProgressTracker
- func (t *SyncProgressTracker) ClearMeta()
- func (t *SyncProgressTracker) Finished() bool
- func (t *SyncProgressTracker) HeadChanged(newID *big.Int) bool
- func (t *SyncProgressTracker) LastSyncedBlockHash() common.Hash
- func (t *SyncProgressTracker) LastSyncedBlockID() *big.Int
- func (t *SyncProgressTracker) MarkFinished()
- func (t *SyncProgressTracker) OutOfSync() bool
- func (t *SyncProgressTracker) Track(ctx context.Context)
- func (t *SyncProgressTracker) Triggered() bool
- func (t *SyncProgressTracker) UpdateMeta(id *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 ¶ added in v0.4.0
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, and check whether the L2 execution is not able to sync through P2P (due to no connected peer or some other reasons).
func NewSyncProgressTracker ¶ added in v0.4.0
func NewSyncProgressTracker(c *rpc.EthClient, timeout time.Duration) *SyncProgressTracker
NewSyncProgressTracker creates a new SyncProgressTracker instance.
func (*SyncProgressTracker) ClearMeta ¶ added in v0.4.0
func (t *SyncProgressTracker) ClearMeta()
ClearMeta cleans the inner beacon sync metadata.
func (*SyncProgressTracker) Finished ¶ added in v0.22.0
func (t *SyncProgressTracker) Finished() bool
Finished returns whether the current beacon sync has been finished.
func (*SyncProgressTracker) HeadChanged ¶ added in v0.4.0
func (t *SyncProgressTracker) HeadChanged(newID *big.Int) bool
HeadChanged checks if a new beacon sync request will be needed.
func (*SyncProgressTracker) LastSyncedBlockHash ¶ added in v0.21.0
func (t *SyncProgressTracker) LastSyncedBlockHash() common.Hash
LastSyncedBlockHash returns tracker.lastSyncedBlockHash.
func (*SyncProgressTracker) LastSyncedBlockID ¶ added in v0.21.0
func (t *SyncProgressTracker) LastSyncedBlockID() *big.Int
LastSyncedBlockID returns tracker.lastSyncedBlockID.
func (*SyncProgressTracker) MarkFinished ¶ added in v0.22.0
func (t *SyncProgressTracker) MarkFinished()
MarkFinished marks the current beacon sync as finished.
func (*SyncProgressTracker) OutOfSync ¶ added in v0.4.0
func (t *SyncProgressTracker) OutOfSync() bool
OutOfSync tells whether the L2 execution engine is marked as out of sync.
func (*SyncProgressTracker) Track ¶ added in v0.4.0
func (t *SyncProgressTracker) Track(ctx context.Context)
Track starts the inner event loop, to monitor the sync progress.
func (*SyncProgressTracker) Triggered ¶ added in v0.4.0
func (t *SyncProgressTracker) Triggered() bool
Triggered returns tracker.triggered.
func (*SyncProgressTracker) UpdateMeta ¶ added in v0.4.0
func (t *SyncProgressTracker) UpdateMeta(id *big.Int, blockHash common.Hash)
UpdateMeta updates the inner beacon sync metadata.
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, syncMode string, progressTracker *SyncProgressTracker, ) *Syncer
NewSyncer creates a new syncer instance.
func (*Syncer) TriggerBeaconSync ¶
TriggerBeaconSync triggers the L2 execution engine to start performing a beacon sync, if the latest verified block has changed.