17
17
syncProgressCheckInterval = 12 * time .Second
18
18
)
19
19
20
- // SyncProgressTracker is responsible for tracking the L2 execution engine's sync progress, after
21
- // a beacon sync is triggered in it, and check whether the L2 execution is not able to sync through P2P (due to no
20
+ // SyncProgressTracker is responsible for tracking the L2Client execution engine's sync progress, after
21
+ // a beacon sync is triggered in it, and check whether the L2Client execution is not able to sync through P2P (due to no
22
22
// connected peer or some other reasons).
23
23
type SyncProgressTracker struct {
24
24
// RPC client
@@ -58,7 +58,7 @@ func (t *SyncProgressTracker) Track(ctx context.Context) {
58
58
}
59
59
60
60
// track is the internal implementation of MonitorSyncProgress, tries to
61
- // track the L2 execution engine's beacon sync progress.
61
+ // track the L2Client execution engine's beacon sync progress.
62
62
func (t * SyncProgressTracker ) track (ctx context.Context ) {
63
63
t .mutex .Lock ()
64
64
defer t .mutex .Unlock ()
@@ -74,13 +74,13 @@ func (t *SyncProgressTracker) track(ctx context.Context) {
74
74
75
75
progress , err := t .client .SyncProgress (ctx )
76
76
if err != nil {
77
- log .Error ("Get L2 execution engine sync progress error" , "error" , err )
77
+ log .Error ("Get L2Client execution engine sync progress error" , "error" , err )
78
78
return
79
79
}
80
80
81
81
if progress != nil {
82
82
log .Info (
83
- "L2 execution engine sync progress" ,
83
+ "L2Client execution engine sync progress" ,
84
84
"progress" , progress ,
85
85
"lastProgressedTime" , t .lastProgressedTime ,
86
86
"timeout" , t .timeout ,
@@ -90,13 +90,13 @@ func (t *SyncProgressTracker) track(ctx context.Context) {
90
90
if progress == nil {
91
91
headHeight , err := t .client .BlockNumber (ctx )
92
92
if err != nil {
93
- log .Error ("Get L2 execution engine head height error" , "error" , err )
93
+ log .Error ("Get L2Client execution engine head height error" , "error" , err )
94
94
return
95
95
}
96
96
97
97
if new (big.Int ).SetUint64 (headHeight ).Cmp (t .lastSyncedVerifiedBlockID ) >= 0 {
98
98
t .lastProgressedTime = time .Now ()
99
- log .Info ("L2 execution engine has finished the P2P sync work, all verified blocks synced, " +
99
+ log .Info ("L2Client execution engine has finished the P2P sync work, all verified blocks synced, " +
100
100
"will switch to insert pending blocks one by one" ,
101
101
"lastSyncedVerifiedBlockID" , t .lastSyncedVerifiedBlockID ,
102
102
"lastSyncedVerifiedBlockHash" , t .lastSyncedVerifiedBlockHash ,
@@ -105,14 +105,14 @@ func (t *SyncProgressTracker) track(ctx context.Context) {
105
105
}
106
106
107
107
log .Debug (
108
- "L2 execution engine has not started P2P syncing yet" ,
108
+ "L2Client execution engine has not started P2P syncing yet" ,
109
109
"timeout" , t .timeout ,
110
110
)
111
111
}
112
112
113
113
defer func () { t .lastSyncProgress = progress }()
114
114
115
- // Check whether the L2 execution engine has synced any new block through P2P since last event loop.
115
+ // Check whether the L2Client execution engine has synced any new block through P2P since last event loop.
116
116
if syncProgressed (t .lastSyncProgress , progress ) {
117
117
t .outOfSync = false
118
118
t .lastProgressedTime = time .Now ()
@@ -121,11 +121,11 @@ func (t *SyncProgressTracker) track(ctx context.Context) {
121
121
122
122
// Has not synced any new block since last loop, check whether reaching the timeout.
123
123
if time .Since (t .lastProgressedTime ) > t .timeout {
124
- // Mark the L2 execution engine out of sync.
124
+ // Mark the L2Client execution engine out of sync.
125
125
t .outOfSync = true
126
126
127
127
log .Warn (
128
- "L2 execution engine is not able to sync through P2P" ,
128
+ "L2Client execution engine is not able to sync through P2P" ,
129
129
"lastProgressedTime" , t .lastProgressedTime ,
130
130
"timeout" , t .timeout ,
131
131
)
@@ -173,7 +173,7 @@ func (t *SyncProgressTracker) HeadChanged(newID *big.Int) bool {
173
173
return t .lastSyncedVerifiedBlockID != nil && t .lastSyncedVerifiedBlockID != newID
174
174
}
175
175
176
- // OutOfSync tells whether the L2 execution engine is marked as out of sync.
176
+ // OutOfSync tells whether the L2Client execution engine is marked as out of sync.
177
177
func (t * SyncProgressTracker ) OutOfSync () bool {
178
178
t .mutex .RLock ()
179
179
defer t .mutex .RUnlock ()
0 commit comments