@@ -164,7 +164,7 @@ func (w *Watcher) Start(ctx context.Context) {
164
164
return w .getStartEndBlockNum (ctx )
165
165
})
166
166
if err != nil {
167
- srvlog .Error ("Could not get start and end block num" , err )
167
+ srvlog .Error ("Could not get start and end block num" , log. Ctx { " err" : err } )
168
168
return
169
169
}
170
170
fromBlock := scanRange .startBlockNum
@@ -175,14 +175,14 @@ func (w *Watcher) Start(ctx context.Context) {
175
175
return w .chain .SpecChallengeManager (ctx )
176
176
})
177
177
if err != nil {
178
- srvlog .Error ("Could not get spec challenge manager" , err )
178
+ srvlog .Error ("Could not get spec challenge manager" , log. Ctx { " err" : err } )
179
179
return
180
180
}
181
181
filterer , err := retry .UntilSucceeds (ctx , func () (* challengeV2gen.EdgeChallengeManagerFilterer , error ) {
182
182
return challengeV2gen .NewEdgeChallengeManagerFilterer (challengeManager .Address (), w .backend )
183
183
})
184
184
if err != nil {
185
- srvlog .Error ("Could not initialize edge challenge manager filterer" , err )
185
+ srvlog .Error ("Could not initialize edge challenge manager filterer" , log. Ctx { " err" : err } )
186
186
return
187
187
}
188
188
filterOpts := & bind.FilterOpts {
@@ -196,35 +196,35 @@ func (w *Watcher) Start(ctx context.Context) {
196
196
return true , w .checkForEdgeAdded (ctx , filterer , filterOpts )
197
197
})
198
198
if err != nil {
199
- srvlog .Error ("Could not check for edge added" , err )
199
+ srvlog .Error ("Could not check for edge added" , log. Ctx { " err" : err } )
200
200
return
201
201
}
202
202
_ , err = retry .UntilSucceeds (ctx , func () (bool , error ) {
203
203
return true , w .checkForEdgeConfirmedByOneStepProof (ctx , filterer , filterOpts )
204
204
})
205
205
if err != nil {
206
- srvlog .Error ("Could not check for edge confirmed by osp" , err )
206
+ srvlog .Error ("Could not check for edge confirmed by osp" , log. Ctx { " err" : err } )
207
207
return
208
208
}
209
209
_ , err = retry .UntilSucceeds (ctx , func () (bool , error ) {
210
210
return true , w .checkForEdgeConfirmedByChildren (ctx , filterer , filterOpts )
211
211
})
212
212
if err != nil {
213
- srvlog .Error ("Could not check for edge confirmed by children" , err )
213
+ srvlog .Error ("Could not check for edge confirmed by children" , log. Ctx { " err" : err } )
214
214
return
215
215
}
216
216
_ , err = retry .UntilSucceeds (ctx , func () (bool , error ) {
217
217
return true , w .checkForEdgeConfirmedByClaim (ctx , filterer , filterOpts )
218
218
})
219
219
if err != nil {
220
- srvlog .Error ("Could not check for edge confirmed by claim" , err )
220
+ srvlog .Error ("Could not check for edge confirmed by claim" , log. Ctx { " err" : err } )
221
221
return
222
222
}
223
223
_ , err = retry .UntilSucceeds (ctx , func () (bool , error ) {
224
224
return true , w .checkForEdgeConfirmedByTime (ctx , filterer , filterOpts )
225
225
})
226
226
if err != nil {
227
- srvlog .Error ("Could not check for edge confirmed by time" , err )
227
+ srvlog .Error ("Could not check for edge confirmed by time" , log. Ctx { " err" : err } )
228
228
return
229
229
}
230
230
@@ -238,7 +238,7 @@ func (w *Watcher) Start(ctx context.Context) {
238
238
case <- ticker .C :
239
239
latestBlock , err := w .backend .HeaderByNumber (ctx , nil )
240
240
if err != nil {
241
- srvlog .Error ("Could not get latest header" , err )
241
+ srvlog .Error ("Could not get latest header" , log. Ctx { " err" : err } )
242
242
continue
243
243
}
244
244
if ! latestBlock .Number .IsUint64 () {
@@ -254,14 +254,14 @@ func (w *Watcher) Start(ctx context.Context) {
254
254
return w .chain .SpecChallengeManager (ctx )
255
255
})
256
256
if err != nil {
257
- srvlog .Error ("Could not get spec challenge manager" , err )
257
+ srvlog .Error ("Could not get spec challenge manager" , log. Ctx { " err" : err } )
258
258
return
259
259
}
260
260
filterer , err = retry .UntilSucceeds (ctx , func () (* challengeV2gen.EdgeChallengeManagerFilterer , error ) {
261
261
return challengeV2gen .NewEdgeChallengeManagerFilterer (challengeManager .Address (), w .backend )
262
262
})
263
263
if err != nil {
264
- srvlog .Error ("Could not get challenge manager filterer" , err )
264
+ srvlog .Error ("Could not get challenge manager filterer" , log. Ctx { " err" : err } )
265
265
return
266
266
}
267
267
filterOpts := & bind.FilterOpts {
@@ -270,23 +270,23 @@ func (w *Watcher) Start(ctx context.Context) {
270
270
Context : ctx ,
271
271
}
272
272
if err = w .checkForEdgeAdded (ctx , filterer , filterOpts ); err != nil {
273
- srvlog .Error ("Could not check for edge added" , err )
273
+ srvlog .Error ("Could not check for edge added" , log. Ctx { " err" : err } )
274
274
continue
275
275
}
276
276
if err = w .checkForEdgeConfirmedByOneStepProof (ctx , filterer , filterOpts ); err != nil {
277
- srvlog .Error ("Could not check for edge confirmed by osp" , err )
277
+ srvlog .Error ("Could not check for edge confirmed by osp" , log. Ctx { " err" : err } )
278
278
continue
279
279
}
280
280
if err = w .checkForEdgeConfirmedByChildren (ctx , filterer , filterOpts ); err != nil {
281
- srvlog .Error ("Could not check for edge confirmed by children" , err )
281
+ srvlog .Error ("Could not check for edge confirmed by children" , log. Ctx { " err" : err } )
282
282
continue
283
283
}
284
284
if err = w .checkForEdgeConfirmedByTime (ctx , filterer , filterOpts ); err != nil {
285
- srvlog .Error ("Could not check for edge confirmed by time" , err )
285
+ srvlog .Error ("Could not check for edge confirmed by time" , log. Ctx { " err" : err } )
286
286
continue
287
287
}
288
288
if err = w .checkForEdgeConfirmedByClaim (ctx , filterer , filterOpts ); err != nil {
289
- srvlog .Error ("Could not check for edge confirmed by claim" , err )
289
+ srvlog .Error ("Could not check for edge confirmed by claim" , log. Ctx { " err" : err } )
290
290
continue
291
291
}
292
292
fromBlock = toBlock
@@ -355,7 +355,7 @@ func (w *Watcher) checkForEdgeAdded(
355
355
}
356
356
defer func () {
357
357
if err = it .Close (); err != nil {
358
- srvlog .Error ("Could not close filter iterator" , err )
358
+ srvlog .Error ("Could not close filter iterator" , log. Ctx { " err" : err } )
359
359
}
360
360
}()
361
361
for it .Next () {
@@ -439,7 +439,7 @@ func (w *Watcher) checkForEdgeConfirmedByOneStepProof(
439
439
}
440
440
defer func () {
441
441
if err = it .Close (); err != nil {
442
- srvlog .Error ("Could not close filter iterator" , err )
442
+ srvlog .Error ("Could not close filter iterator" , log. Ctx { " err" : err } )
443
443
}
444
444
}()
445
445
for it .Next () {
@@ -477,7 +477,7 @@ func (w *Watcher) checkForEdgeConfirmedByTime(
477
477
}
478
478
defer func () {
479
479
if err = it .Close (); err != nil {
480
- srvlog .Error ("Could not close filter iterator" , err )
480
+ srvlog .Error ("Could not close filter iterator" , log. Ctx { " err" : err } )
481
481
}
482
482
}()
483
483
for it .Next () {
@@ -515,7 +515,7 @@ func (w *Watcher) checkForEdgeConfirmedByChildren(
515
515
}
516
516
defer func () {
517
517
if err = it .Close (); err != nil {
518
- srvlog .Error ("Could not close filter iterator" , err )
518
+ srvlog .Error ("Could not close filter iterator" , log. Ctx { " err" : err } )
519
519
}
520
520
}()
521
521
for it .Next () {
@@ -553,7 +553,7 @@ func (w *Watcher) checkForEdgeConfirmedByClaim(
553
553
}
554
554
defer func () {
555
555
if err = it .Close (); err != nil {
556
- srvlog .Error ("Could not close filter iterator" , err )
556
+ srvlog .Error ("Could not close filter iterator" , log. Ctx { " err" : err } )
557
557
}
558
558
}()
559
559
for it .Next () {
0 commit comments