1
1
package io .iohk .ethereum .blockchain .sync .regular
2
2
3
3
import akka .actor .Status .Failure
4
- import akka .actor .{Actor , ActorLogging , ActorRef , Props }
4
+ import akka .actor .{Actor , ActorRef , Props }
5
5
import akka .pattern .{ask , pipe }
6
6
import akka .util .{ByteString , Timeout }
7
7
import cats .data .NonEmptyList
8
8
import cats .instances .option ._
9
9
import cats .syntax .either ._
10
- import io .iohk .ethereum .consensus .validators .BlockValidator
11
10
import io .iohk .ethereum .blockchain .sync .PeersClient ._
12
- import io .iohk .ethereum .blockchain .sync .regular .BlockFetcherState .{
13
- AwaitingBodiesToBeIgnored ,
14
- AwaitingHeadersToBeIgnored
15
- }
11
+ import io .iohk .ethereum .blockchain .sync .regular .BlockFetcherState .{AwaitingBodiesToBeIgnored , AwaitingHeadersToBeIgnored }
16
12
import io .iohk .ethereum .blockchain .sync .regular .BlockImporter .{ImportNewBlock , NewCheckpointBlock , NotOnTop , OnTop }
17
13
import io .iohk .ethereum .blockchain .sync .regular .RegularSync .ProgressProtocol
14
+ import io .iohk .ethereum .consensus .validators .BlockValidator
18
15
import io .iohk .ethereum .crypto .kec256
19
16
import io .iohk .ethereum .domain ._
20
17
import io .iohk .ethereum .network .PeerEventBusActor .PeerEvent .MessageFromPeer
21
18
import io .iohk .ethereum .network .PeerEventBusActor .SubscriptionClassifier .MessageClassifier
22
19
import io .iohk .ethereum .network .PeerEventBusActor .{PeerSelector , Subscribe , Unsubscribe }
23
20
import io .iohk .ethereum .network .PeerId
24
- import io .iohk .ethereum .network .p2p .messages .{Codes , CommonMessages , PV64 }
25
21
import io .iohk .ethereum .network .p2p .messages .PV62 ._
26
22
import io .iohk .ethereum .network .p2p .messages .PV63 .{GetNodeData , NodeData }
27
- import io .iohk .ethereum .utils . ByteStringUtils
23
+ import io .iohk .ethereum .network . p2p . messages .{ Codes , CommonMessages , PV64 }
28
24
import io .iohk .ethereum .utils .Config .SyncConfig
29
25
import io .iohk .ethereum .utils .FunctorOps ._
26
+ import io .iohk .ethereum .utils .{ByteStringUtils , Logger }
30
27
import monix .eval .Task
31
28
import monix .execution .{Scheduler => MonixScheduler }
32
29
import mouse .all ._
@@ -40,7 +37,7 @@ class BlockFetcher(
40
37
val syncConfig : SyncConfig ,
41
38
val blockValidator : BlockValidator
42
39
) extends Actor
43
- with ActorLogging {
40
+ with Logger {
44
41
45
42
import BlockFetcher ._
46
43
@@ -365,7 +362,7 @@ class BlockFetcher(
365
362
.tap(blacklistPeerOnFailedRequest)
366
363
.flatMap(handleRequestResult(responseFallback))
367
364
.onErrorHandle { error =>
368
- log.error(error, " Unexpected error while doing a request" )
365
+ log.error(" Unexpected error while doing a request" , error )
369
366
responseFallback
370
367
}
371
368
@@ -381,7 +378,7 @@ class BlockFetcher(
381
378
case NoSuitablePeer =>
382
379
Task .now(fallback).delayExecution(syncConfig.syncRetryInterval)
383
380
case Failure (cause) =>
384
- log.error(cause, " Unexpected error on the request result" )
381
+ log.error(" Unexpected error on the request result" , cause )
385
382
Task .now(fallback)
386
383
case m =>
387
384
Task .now(m)
0 commit comments