Skip to content

Commit

Permalink
add debug level PeersClient, PeerActor
Browse files Browse the repository at this point in the history
  • Loading branch information
bsuieric committed Mar 2, 2021
1 parent 3101e08 commit fa2e0be
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/main/resources/logback.xml
Expand Up @@ -64,7 +64,8 @@
<logger name="io.iohk.ethereum.blockchain.sync.regular.BlockImporter" level="DEBUG" />
<logger name="io.iohk.ethereum.domain.BlockchainImpl" level="DEBUG" />
<logger name="io.iohk.ethereum.ledger.BlockImport" level="DEBUG" />
<logger name="io.iohk.ethereum.network.PeerActor" level="${LOGSLEVEL}" />
<logger name="io.iohk.ethereum.network.PeerActor" level="DEBUG" />
<logger name="io.iohk.ethereum.blockchain.sync.PeersClient" level="DEBUG" />
<logger name="io.iohk.ethereum.network.rlpx.RLPxConnectionHandler" level="${LOGSLEVEL}" />
<logger name="io.iohk.ethereum.vm.VM" level="OFF" />

Expand Down
Expand Up @@ -2,14 +2,15 @@ package io.iohk.ethereum.blockchain.sync

import akka.actor.{Actor, ActorLogging, Cancellable, Scheduler}
import io.iohk.ethereum.blockchain.sync.Blacklist.BlacklistId
import io.iohk.ethereum.utils.Logger

import scala.collection.mutable
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.{Duration, FiniteDuration}

// will be removed once regular sync is switched to new blacklist implementation
trait BlacklistSupport {
selfActor: Actor with ActorLogging =>
selfActor: Actor with Logger =>

import BlacklistSupport._

Expand Down
Expand Up @@ -7,13 +7,14 @@ import io.iohk.ethereum.network.PeerEventBusActor.PeerEvent.PeerDisconnected
import io.iohk.ethereum.network.PeerEventBusActor.SubscriptionClassifier.PeerDisconnectedClassifier
import io.iohk.ethereum.network.PeerEventBusActor.{PeerSelector, Subscribe, Unsubscribe}
import io.iohk.ethereum.utils.Config.SyncConfig
import io.iohk.ethereum.utils.Logger

import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global

// will be removed once regular sync is switched to new blacklist/peerlist implementation
trait PeerListSupport {
self: Actor with ActorLogging with BlacklistSupport =>
self: Actor with Logger with BlacklistSupport =>
import PeerListSupport._

def etcPeerManager: ActorRef
Expand Down
@@ -1,13 +1,16 @@
package io.iohk.ethereum.blockchain.sync

import akka.actor.{Actor, ActorLogging, ActorRef, Cancellable, Props, Scheduler}
import com.typesafe.scalalogging
import io.iohk.ethereum.network.EtcPeerManagerActor.PeerInfo
import io.iohk.ethereum.network.p2p.messages.Codes
import io.iohk.ethereum.network.{Peer, PeerId}
import io.iohk.ethereum.network.p2p.messages.PV62._
import io.iohk.ethereum.network.p2p.messages.PV63.{GetNodeData, NodeData}
import io.iohk.ethereum.network.p2p.{Message, MessageSerializable}
import io.iohk.ethereum.utils.Config.SyncConfig
import io.iohk.ethereum.utils.Logger
import org.slf4j.LoggerFactory

import scala.concurrent.ExecutionContext
import scala.reflect.ClassTag
Expand All @@ -18,7 +21,7 @@ class PeersClient(
val syncConfig: SyncConfig,
implicit val scheduler: Scheduler
) extends Actor
with ActorLogging
with Logger
with PeerListSupport
with BlacklistSupport {
import PeersClient._
Expand Down Expand Up @@ -55,7 +58,7 @@ class PeersClient(
case PeerRequestHandler.ResponseReceived(peer, message, _) =>
handleResponse(requesters, Response(peer, message.asInstanceOf[Message]))
case PeerRequestHandler.RequestFailed(peer, reason) =>
log.warning(s"Request to peer ${peer.remoteAddress} failed - reason: $reason")
log.debug(s"Request to peer ${peer.remoteAddress} failed - reason: $reason")
handleResponse(requesters, RequestFailed(peer, reason))
}

Expand Down
Expand Up @@ -12,6 +12,7 @@ import io.iohk.ethereum.network.p2p.messages.Codes
import io.iohk.ethereum.network.p2p.messages.PV62.{BlockHeaders, GetBlockHeaders}
import io.iohk.ethereum.network.{EtcPeerManagerActor, Peer, PeerId}
import io.iohk.ethereum.utils.Config.SyncConfig
import io.iohk.ethereum.utils.Logger

import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.FiniteDuration
Expand All @@ -23,7 +24,7 @@ class PivotBlockSelector(
val scheduler: Scheduler,
fastSync: ActorRef
) extends Actor
with ActorLogging
with Logger
with PeerListSupport
with BlacklistSupport {

Expand Down
Expand Up @@ -17,7 +17,7 @@ import io.iohk.ethereum.blockchain.sync.{BlacklistSupport, PeerListSupport, Peer
import io.iohk.ethereum.network.Peer
import io.iohk.ethereum.network.p2p.messages.Codes
import io.iohk.ethereum.network.p2p.messages.PV63.{GetNodeData, NodeData}
import io.iohk.ethereum.utils.ByteStringUtils
import io.iohk.ethereum.utils.{ByteStringUtils, Logger}
import io.iohk.ethereum.utils.Config.SyncConfig
import monix.eval.Task
import monix.execution.Scheduler
Expand All @@ -33,7 +33,7 @@ class SyncStateSchedulerActor(
) extends Actor
with PeerListSupport
with BlacklistSupport
with ActorLogging
with Logger
with Timers {

implicit val monixScheduler = Scheduler(context.dispatcher)
Expand Down
Expand Up @@ -4,6 +4,7 @@ import akka.actor.{Actor, ActorLogging, ActorRef, Props, Scheduler}
import io.iohk.ethereum.blockchain.sync.regular.BlockBroadcast.BlockToBroadcast
import io.iohk.ethereum.blockchain.sync.{BlacklistSupport, PeerListSupport}
import io.iohk.ethereum.utils.Config.SyncConfig
import io.iohk.ethereum.utils.Logger

class BlockBroadcasterActor(
broadcast: BlockBroadcast,
Expand All @@ -12,7 +13,7 @@ class BlockBroadcasterActor(
val syncConfig: SyncConfig,
val scheduler: Scheduler
) extends Actor
with ActorLogging
with Logger
with PeerListSupport
with BlacklistSupport {
import BlockBroadcasterActor._
Expand Down
Expand Up @@ -18,6 +18,7 @@ import io.iohk.ethereum.network.p2p.messages.WireProtocol.Disconnect
import io.iohk.ethereum.network.p2p.{MessageDecoder, MessageSerializable}
import io.iohk.ethereum.network.rlpx.AuthHandshaker
import io.iohk.ethereum.network.rlpx.RLPxConnectionHandler.RLPxConfiguration
import io.iohk.ethereum.utils.Logger
import monix.eval.Task
import monix.execution.{Scheduler => MonixScheduler}
import org.bouncycastle.util.encoders.Hex
Expand All @@ -38,7 +39,7 @@ class PeerManagerActor(
discoveryConfig: DiscoveryConfig,
externalSchedulerOpt: Option[Scheduler] = None
) extends Actor
with ActorLogging
with Logger
with Stash
with BlacklistSupport {

Expand Down

0 comments on commit fa2e0be

Please sign in to comment.