From a26f1958e9d90a6cefeafd0bd329a728878ceebb Mon Sep 17 00:00:00 2001 From: KirillPamPam Date: Tue, 21 Mar 2023 18:38:46 +0400 Subject: [PATCH] Make loggers not abstract (#181) * Make loggers not abstract --- .../kotlin/io/emeraldpay/dshackle/upstream/AbstractHead.kt | 2 +- .../io/emeraldpay/dshackle/upstream/DefaultUpstream.kt | 4 +--- .../io/emeraldpay/dshackle/upstream/DynamicMergedHead.kt | 5 ----- .../kotlin/io/emeraldpay/dshackle/upstream/MergedHead.kt | 5 ----- .../kotlin/io/emeraldpay/dshackle/upstream/Multistream.kt | 3 ++- .../emeraldpay/dshackle/upstream/bitcoin/BitcoinRpcHead.kt | 2 -- .../dshackle/upstream/bitcoin/BitcoinRpcUpstream.kt | 5 ----- .../emeraldpay/dshackle/upstream/bitcoin/BitcoinUpstream.kt | 5 ----- .../emeraldpay/dshackle/upstream/bitcoin/BitcoinZMQHead.kt | 6 ------ .../dshackle/upstream/ethereum/DefaultEthereumHead.kt | 5 ----- .../dshackle/upstream/ethereum/EthereumMultistream.kt | 5 ----- .../dshackle/upstream/ethereum/EthereumRpcHead.kt | 3 --- .../dshackle/upstream/ethereum/EthereumRpcUpstream.kt | 2 -- .../emeraldpay/dshackle/upstream/ethereum/EthereumWsHead.kt | 5 ----- .../upstream/ethereum_pos/EthereumPosMultiStream.kt | 5 ----- .../upstream/ethereum_pos/EthereumPosRpcUpstream.kt | 2 -- .../dshackle/upstream/grpc/BitcoinGrpcUpstream.kt | 5 ----- .../dshackle/upstream/grpc/EthereumGrpcUpstream.kt | 2 -- .../kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt | 5 ----- 19 files changed, 4 insertions(+), 72 deletions(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/AbstractHead.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/AbstractHead.kt index 59c2b28b..4beeb55c 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/AbstractHead.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/AbstractHead.kt @@ -41,9 +41,9 @@ abstract class AbstractHead @JvmOverloads constructor( private val awaitHeadTimeoutMs: Long = 60_000, private val upstreamId: String = "" ) : Head { + protected val log = LoggerFactory.getLogger(this::class.java) companion object { - private val log = LoggerFactory.getLogger(AbstractHead::class.java) private val executor = Executors.newSingleThreadScheduledExecutor() } diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/DefaultUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/DefaultUpstream.kt index 6f98065a..0e3877e7 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/DefaultUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/DefaultUpstream.kt @@ -49,9 +49,7 @@ abstract class DefaultUpstream( ) : this(id, hash, Long.MAX_VALUE, UpstreamAvailability.UNAVAILABLE, options, role, targets, node, chainConfig) - companion object { - private val log = LoggerFactory.getLogger(DefaultUpstream::class.java) - } + protected val log = LoggerFactory.getLogger(this::class.java) private val status = AtomicReference(Status(defaultLag, defaultAvail, statusByLag(defaultLag, defaultAvail))) private val statusStream = Sinks.many() diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/DynamicMergedHead.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/DynamicMergedHead.kt index 967bd39b..e5f957ec 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/DynamicMergedHead.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/DynamicMergedHead.kt @@ -3,7 +3,6 @@ package io.emeraldpay.dshackle.upstream import io.emeraldpay.dshackle.commons.DynamicMergeFlux import io.emeraldpay.dshackle.data.BlockContainer import io.emeraldpay.dshackle.upstream.forkchoice.ForkChoice -import org.slf4j.LoggerFactory import reactor.core.Disposable import reactor.core.scheduler.Scheduler @@ -13,10 +12,6 @@ open class DynamicMergedHead( scheduler: Scheduler ) : AbstractHead(forkChoice, upstreamId = label), Lifecycle { - companion object { - private val log = LoggerFactory.getLogger(DynamicMergedHead::class.java) - } - private var subscription: Disposable? = null private val dynamicFlux: DynamicMergeFlux = DynamicMergeFlux(scheduler) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/MergedHead.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/MergedHead.kt index 18e62a55..6c4ab0ac 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/MergedHead.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/MergedHead.kt @@ -20,7 +20,6 @@ import com.google.common.annotations.VisibleForTesting import io.emeraldpay.dshackle.cache.Caches import io.emeraldpay.dshackle.cache.CachesEnabled import io.emeraldpay.dshackle.upstream.forkchoice.ForkChoice -import org.slf4j.LoggerFactory import reactor.core.Disposable import reactor.core.publisher.Flux @@ -30,10 +29,6 @@ class MergedHead @JvmOverloads constructor( private val label: String = "" ) : AbstractHead(forkChoice, upstreamId = label), Lifecycle, CachesEnabled { - companion object { - private val log = LoggerFactory.getLogger(MergedHead::class.java) - } - private var subscription: Disposable? = null override fun isRunning(): Boolean { diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/Multistream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/Multistream.kt index d258d427..93855101 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/Multistream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/Multistream.kt @@ -55,10 +55,11 @@ abstract class Multistream( ) : Upstream, Lifecycle, HasEgressSubscription { companion object { - private val log = LoggerFactory.getLogger(Multistream::class.java) private const val metrics = "upstreams" } + protected val log = LoggerFactory.getLogger(this::class.java) + private var started = false private var cacheSubscription: Disposable? = null diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinRpcHead.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinRpcHead.kt index ecd994af..68067898 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinRpcHead.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinRpcHead.kt @@ -23,7 +23,6 @@ import io.emeraldpay.dshackle.upstream.Lifecycle import io.emeraldpay.dshackle.upstream.forkchoice.MostWorkForkChoice import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse -import org.slf4j.LoggerFactory import org.springframework.scheduling.concurrent.CustomizableThreadFactory import reactor.core.Disposable import reactor.core.publisher.Flux @@ -39,7 +38,6 @@ class BitcoinRpcHead( ) : Head, AbstractHead(MostWorkForkChoice(), awaitHeadTimeoutMs = 1200_000), Lifecycle { companion object { - private val log = LoggerFactory.getLogger(BitcoinRpcHead::class.java) val scheduler = Schedulers.fromExecutor(Executors.newCachedThreadPool(CustomizableThreadFactory("bitcoin-rpc-head"))) } diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinRpcUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinRpcUpstream.kt index 749ead9c..82dab6ff 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinRpcUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinRpcUpstream.kt @@ -26,7 +26,6 @@ import io.emeraldpay.dshackle.upstream.Lifecycle import io.emeraldpay.dshackle.upstream.Upstream import io.emeraldpay.dshackle.upstream.UpstreamAvailability import io.emeraldpay.dshackle.upstream.calls.CallMethods -import org.slf4j.LoggerFactory import reactor.core.Disposable open class BitcoinRpcUpstream( @@ -42,10 +41,6 @@ open class BitcoinRpcUpstream( chainConfig: ChainsConfig.ChainConfig ) : BitcoinUpstream(id, chain, options, role, callMethods, node, esploraClient, chainConfig), Lifecycle { - companion object { - private val log = LoggerFactory.getLogger(BitcoinRpcUpstream::class.java) - } - private var validatorSubscription: Disposable? = null private val capabilities = if (options.providesBalance == true) { diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinUpstream.kt index 46778e58..9996be32 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinUpstream.kt @@ -22,7 +22,6 @@ import io.emeraldpay.dshackle.startup.QuorumForLabels import io.emeraldpay.dshackle.upstream.DefaultUpstream import io.emeraldpay.dshackle.upstream.calls.CallMethods import io.emeraldpay.dshackle.upstream.calls.DefaultBitcoinMethods -import org.slf4j.LoggerFactory abstract class BitcoinUpstream( id: String, @@ -42,8 +41,4 @@ abstract class BitcoinUpstream( role: UpstreamsConfig.UpstreamRole, chainConfig: ChainsConfig.ChainConfig ) : this(id, chain, options, role, DefaultBitcoinMethods(), QuorumForLabels.QuorumItem.empty(), null, chainConfig) - - companion object { - private val log = LoggerFactory.getLogger(BitcoinUpstream::class.java) - } } diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinZMQHead.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinZMQHead.kt index c8b22608..7a13dff2 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinZMQHead.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinZMQHead.kt @@ -10,7 +10,6 @@ import io.emeraldpay.dshackle.upstream.forkchoice.MostWorkForkChoice import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse import org.apache.commons.codec.binary.Hex -import org.slf4j.LoggerFactory import reactor.core.Disposable import reactor.core.publisher.Flux import reactor.core.publisher.Mono @@ -22,11 +21,6 @@ class BitcoinZMQHead( private val api: JsonRpcReader, private val extractBlock: ExtractBlock, ) : Head, AbstractHead(MostWorkForkChoice(), awaitHeadTimeoutMs = 1200_000), Lifecycle { - - companion object { - private val log = LoggerFactory.getLogger(BitcoinZMQHead::class.java) - } - private var refreshSubscription: Disposable? = null fun connect(): Flux { diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/DefaultEthereumHead.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/DefaultEthereumHead.kt index 0afda6be..5725ea06 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/DefaultEthereumHead.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/DefaultEthereumHead.kt @@ -24,7 +24,6 @@ import io.emeraldpay.dshackle.upstream.Head import io.emeraldpay.dshackle.upstream.forkchoice.ForkChoice import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.etherjar.hex.HexQuantity -import org.slf4j.LoggerFactory import reactor.core.publisher.Mono open class DefaultEthereumHead( @@ -33,10 +32,6 @@ open class DefaultEthereumHead( blockValidator: BlockValidator ) : Head, AbstractHead(forkChoice, blockValidator, 60_000, upstreamId) { - companion object { - private val log = LoggerFactory.getLogger(DefaultEthereumHead::class.java) - } - fun getLatestBlock(api: JsonRpcReader): Mono { return api.read(JsonRpcRequest("eth_blockNumber", emptyList())) .subscribeOn(EthereumRpcHead.scheduler) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumMultistream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumMultistream.kt index 89ee1663..d082100a 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumMultistream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumMultistream.kt @@ -38,7 +38,6 @@ import io.emeraldpay.dshackle.upstream.ethereum.subscribe.PendingTxesSource import io.emeraldpay.dshackle.upstream.forkchoice.MostWorkForkChoice import io.emeraldpay.dshackle.upstream.forkchoice.PriorityForkChoice import io.emeraldpay.dshackle.upstream.grpc.GrpcUpstream -import org.slf4j.LoggerFactory import org.springframework.cloud.sleuth.Tracer import org.springframework.util.ConcurrentReferenceHashMap import reactor.core.publisher.Flux @@ -54,10 +53,6 @@ open class EthereumMultistream( tracer: Tracer ) : Multistream(chain, upstreams as MutableList, caches), EthereumLikeMultistream { - companion object { - private val log = LoggerFactory.getLogger(EthereumMultistream::class.java) - } - private var head: DynamicMergedHead = DynamicMergedHead( PriorityForkChoice(), "ETH Multistream of ${chain.chainCode}", diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumRpcHead.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumRpcHead.kt index 464179c8..2c4cc9ca 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumRpcHead.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumRpcHead.kt @@ -20,7 +20,6 @@ import io.emeraldpay.dshackle.reader.JsonRpcReader import io.emeraldpay.dshackle.upstream.BlockValidator import io.emeraldpay.dshackle.upstream.Lifecycle import io.emeraldpay.dshackle.upstream.forkchoice.ForkChoice -import org.slf4j.LoggerFactory import org.springframework.scheduling.concurrent.CustomizableThreadFactory import reactor.core.Disposable import reactor.core.publisher.Flux @@ -41,8 +40,6 @@ class EthereumRpcHead( Schedulers.fromExecutor(Executors.newCachedThreadPool(CustomizableThreadFactory("ethereum-rpc-head"))) } - private val log = LoggerFactory.getLogger(EthereumRpcHead::class.java) - private var refreshSubscription: Disposable? = null override fun start() { diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumRpcUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumRpcUpstream.kt index ea191a3c..e83992e6 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumRpcUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumRpcUpstream.kt @@ -29,7 +29,6 @@ import io.emeraldpay.dshackle.upstream.UpstreamAvailability import io.emeraldpay.dshackle.upstream.calls.CallMethods import io.emeraldpay.dshackle.upstream.ethereum.connectors.ConnectorFactory import io.emeraldpay.dshackle.upstream.ethereum.connectors.EthereumConnector -import org.slf4j.LoggerFactory import org.springframework.context.Lifecycle import reactor.core.Disposable @@ -44,7 +43,6 @@ open class EthereumRpcUpstream( connectorFactory: ConnectorFactory, chainConfig: ChainsConfig.ChainConfig ) : EthereumUpstream(id, hash, options, role, targets, node, chainConfig), Lifecycle, Upstream, CachesEnabled { - private val log = LoggerFactory.getLogger(EthereumRpcUpstream::class.java) private val validator: EthereumUpstreamValidator = EthereumUpstreamValidator(this, getOptions()) private val connector: EthereumConnector = connectorFactory.create(this, validator, chain, false) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumWsHead.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumWsHead.kt index 877636d3..cc4cf937 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumWsHead.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumWsHead.kt @@ -28,7 +28,6 @@ import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse import io.emeraldpay.etherjar.rpc.json.BlockJson import io.emeraldpay.etherjar.rpc.json.TransactionRefJson -import org.slf4j.LoggerFactory import reactor.core.Disposable import reactor.core.publisher.Flux import reactor.core.publisher.Mono @@ -45,10 +44,6 @@ class EthereumWsHead( private val skipEnhance: Boolean ) : DefaultEthereumHead(upstreamId, forkChoice, blockValidator), Lifecycle { - companion object { - private val log = LoggerFactory.getLogger(EthereumWsHead::class.java) - } - private var subscription: Disposable? = null override fun isRunning(): Boolean { diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosMultiStream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosMultiStream.kt index 9ca23f1b..67b31d89 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosMultiStream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosMultiStream.kt @@ -36,7 +36,6 @@ import io.emeraldpay.dshackle.upstream.ethereum.subscribe.NoPendingTxes import io.emeraldpay.dshackle.upstream.ethereum.subscribe.PendingTxesSource import io.emeraldpay.dshackle.upstream.forkchoice.PriorityForkChoice import io.emeraldpay.dshackle.upstream.grpc.GrpcUpstream -import org.slf4j.LoggerFactory import org.springframework.cloud.sleuth.Tracer import org.springframework.util.ConcurrentReferenceHashMap import reactor.core.publisher.Flux @@ -52,10 +51,6 @@ open class EthereumPosMultiStream( tracer: Tracer ) : Multistream(chain, upstreams as MutableList, caches), EthereumLikeMultistream { - companion object { - private val log = LoggerFactory.getLogger(EthereumPosMultiStream::class.java) - } - private var head: DynamicMergedHead = DynamicMergedHead( PriorityForkChoice(), "ETH Pos Multistream of ${chain.chainCode}", diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosRpcUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosRpcUpstream.kt index 17e8c5bb..1337d4cc 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosRpcUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum_pos/EthereumPosRpcUpstream.kt @@ -30,7 +30,6 @@ import io.emeraldpay.dshackle.upstream.UpstreamAvailability import io.emeraldpay.dshackle.upstream.calls.CallMethods import io.emeraldpay.dshackle.upstream.ethereum.connectors.ConnectorFactory import io.emeraldpay.dshackle.upstream.ethereum.connectors.EthereumConnector -import org.slf4j.LoggerFactory import reactor.core.Disposable open class EthereumPosRpcUpstream( @@ -44,7 +43,6 @@ open class EthereumPosRpcUpstream( connectorFactory: ConnectorFactory, chainConfig: ChainsConfig.ChainConfig ) : EthereumPosUpstream(id, hash, options, role, targets, node, chainConfig), Lifecycle, Upstream, CachesEnabled { - private val log = LoggerFactory.getLogger(EthereumPosRpcUpstream::class.java) private val validator: EthereumUpstreamValidator = EthereumUpstreamValidator(this, getOptions()) private val connector: EthereumConnector = connectorFactory.create(this, validator, chain, true) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/BitcoinGrpcUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/BitcoinGrpcUpstream.kt index fbafa702..285e0b6a 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/BitcoinGrpcUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/BitcoinGrpcUpstream.kt @@ -38,7 +38,6 @@ import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse import io.emeraldpay.etherjar.rpc.RpcException import org.reactivestreams.Publisher -import org.slf4j.LoggerFactory import reactor.core.publisher.Flux import reactor.core.publisher.Mono import java.math.BigInteger @@ -65,10 +64,6 @@ class BitcoinGrpcUpstream( GrpcUpstream, Lifecycle { - companion object { - private val log = LoggerFactory.getLogger(BitcoinGrpcUpstream::class.java) - } - private val extractBlock = ExtractBlock() private val defaultReader: JsonRpcReader = client.getReader() private val blockConverter: Function = Function { value -> diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstream.kt index 1ea00a97..77ea1d39 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstream.kt @@ -43,7 +43,6 @@ import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse import io.emeraldpay.etherjar.domain.BlockHash import io.emeraldpay.etherjar.rpc.RpcException import org.reactivestreams.Publisher -import org.slf4j.LoggerFactory import reactor.core.publisher.Flux import reactor.core.publisher.Mono import java.math.BigInteger @@ -106,7 +105,6 @@ open class EthereumGrpcUpstream( } } - private val log = LoggerFactory.getLogger(EthereumGrpcUpstream::class.java) private val upstreamStatus = GrpcUpstreamStatus(overrideLabels) private val grpcHead = GrpcHead(getId(), chain, this, remote, blockConverter, reloadBlock, MostWorkForkChoice()) private var capabilities: Set = emptySet() diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt index 9aa27722..6a16a7d6 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt @@ -26,7 +26,6 @@ import io.emeraldpay.dshackle.upstream.Lifecycle import io.emeraldpay.dshackle.upstream.UpstreamAvailability import io.emeraldpay.dshackle.upstream.forkchoice.ForkChoice import org.reactivestreams.Publisher -import org.slf4j.LoggerFactory import reactor.core.Disposable import reactor.core.publisher.Flux import reactor.core.publisher.Mono @@ -50,10 +49,6 @@ class GrpcHead( private val forkChoice: ForkChoice ) : AbstractHead(forkChoice, upstreamId = id), Lifecycle { - companion object { - private val log = LoggerFactory.getLogger(GrpcHead::class.java) - } - private var headSubscription: Disposable? = null /**