fix linter errors again
This commit is contained in:
@@ -25,7 +25,7 @@ import io.emeraldpay.dshackle.upstream.calls.CallMethods
|
|||||||
import io.emeraldpay.dshackle.upstream.calls.DefaultBitcoinMethods
|
import io.emeraldpay.dshackle.upstream.calls.DefaultBitcoinMethods
|
||||||
import io.emeraldpay.dshackle.upstream.calls.DefaultEthereumMethods
|
import io.emeraldpay.dshackle.upstream.calls.DefaultEthereumMethods
|
||||||
import io.emeraldpay.dshackle.upstream.ethereum.EthereumMultistream
|
import io.emeraldpay.dshackle.upstream.ethereum.EthereumMultistream
|
||||||
import io.emeraldpay.dshackle.upstream.ethereum.EthereumPosMultistream
|
import io.emeraldpay.dshackle.upstream.ethereum.EthereumPosMultiStream
|
||||||
import io.emeraldpay.dshackle.upstream.ethereum.EthereumPosUpstream
|
import io.emeraldpay.dshackle.upstream.ethereum.EthereumPosUpstream
|
||||||
import io.emeraldpay.dshackle.upstream.ethereum.EthereumUpstream
|
import io.emeraldpay.dshackle.upstream.ethereum.EthereumUpstream
|
||||||
import io.emeraldpay.grpc.BlockchainType
|
import io.emeraldpay.grpc.BlockchainType
|
||||||
@@ -74,7 +74,7 @@ open class CurrentMultistreamHolder(
|
|||||||
val up = change.upstream.cast(EthereumPosUpstream::class.java)
|
val up = change.upstream.cast(EthereumPosUpstream::class.java)
|
||||||
val current = chainMapping[chain]
|
val current = chainMapping[chain]
|
||||||
val factory = Callable<Multistream> {
|
val factory = Callable<Multistream> {
|
||||||
EthereumPosMultistream(chain, ArrayList(), cachesFactory.getCaches(chain))
|
EthereumPosMultiStream(chain, ArrayList(), cachesFactory.getCaches(chain))
|
||||||
}
|
}
|
||||||
processUpdate(change, up, current, factory)
|
processUpdate(change, up, current, factory)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,13 +7,13 @@ import io.emeraldpay.dshackle.upstream.HeadLagObserver
|
|||||||
import io.emeraldpay.dshackle.upstream.Upstream
|
import io.emeraldpay.dshackle.upstream.Upstream
|
||||||
import org.slf4j.LoggerFactory
|
import org.slf4j.LoggerFactory
|
||||||
|
|
||||||
class EthereumPostHeadLagObserver(
|
class EthereumPosHeadLagObserver(
|
||||||
master: Head,
|
master: Head,
|
||||||
followers: Collection<Upstream>
|
followers: Collection<Upstream>
|
||||||
) : HeadLagObserver(master, followers, DistanceExtractor::extractPriorityDistance) {
|
) : HeadLagObserver(master, followers, DistanceExtractor::extractPriorityDistance) {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val log = LoggerFactory.getLogger(EthereumPostHeadLagObserver::class.java)
|
private val log = LoggerFactory.getLogger(EthereumPosHeadLagObserver::class.java)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun forkDistance(top: BlockContainer, curr: BlockContainer): Long {
|
override fun forkDistance(top: BlockContainer, curr: BlockContainer): Long {
|
||||||
|
|||||||
@@ -34,14 +34,14 @@ import org.springframework.context.Lifecycle
|
|||||||
import reactor.core.publisher.Mono
|
import reactor.core.publisher.Mono
|
||||||
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
open class EthereumPosMultistream(
|
open class EthereumPosMultiStream(
|
||||||
chain: Chain,
|
chain: Chain,
|
||||||
val upstreams: MutableList<EthereumPosUpstream>,
|
val upstreams: MutableList<EthereumPosUpstream>,
|
||||||
caches: Caches
|
caches: Caches
|
||||||
) : Multistream(chain, upstreams as MutableList<Upstream>, caches, CacheRequested(caches)), EthereumLikeMultistream {
|
) : Multistream(chain, upstreams as MutableList<Upstream>, caches, CacheRequested(caches)), EthereumLikeMultistream {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val log = LoggerFactory.getLogger(EthereumPosMultistream::class.java)
|
private val log = LoggerFactory.getLogger(EthereumPosMultiStream::class.java)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var head: Head? = null
|
private var head: Head? = null
|
||||||
@@ -108,7 +108,7 @@ open class EthereumPosMultistream(
|
|||||||
val newHead = MergedHead(heads, PriorityForkChoice()).apply {
|
val newHead = MergedHead(heads, PriorityForkChoice()).apply {
|
||||||
this.start()
|
this.start()
|
||||||
}
|
}
|
||||||
val lagObserver = EthereumPostHeadLagObserver(newHead, upstreams as Collection<Upstream>)
|
val lagObserver = EthereumPosHeadLagObserver(newHead, upstreams as Collection<Upstream>)
|
||||||
this.lagObserver = lagObserver
|
this.lagObserver = lagObserver
|
||||||
lagObserver.start()
|
lagObserver.start()
|
||||||
newHead
|
newHead
|
||||||
|
|||||||
@@ -24,7 +24,11 @@ import io.emeraldpay.dshackle.data.BlockContainer
|
|||||||
import io.emeraldpay.dshackle.data.BlockId
|
import io.emeraldpay.dshackle.data.BlockId
|
||||||
import io.emeraldpay.dshackle.reader.Reader
|
import io.emeraldpay.dshackle.reader.Reader
|
||||||
import io.emeraldpay.dshackle.startup.QuorumForLabels
|
import io.emeraldpay.dshackle.startup.QuorumForLabels
|
||||||
import io.emeraldpay.dshackle.upstream.*
|
import io.emeraldpay.dshackle.upstream.Capability
|
||||||
|
import io.emeraldpay.dshackle.upstream.Head
|
||||||
|
import io.emeraldpay.dshackle.upstream.Selector
|
||||||
|
import io.emeraldpay.dshackle.upstream.Upstream
|
||||||
|
import io.emeraldpay.dshackle.upstream.UpstreamAvailability
|
||||||
import io.emeraldpay.dshackle.upstream.calls.CallMethods
|
import io.emeraldpay.dshackle.upstream.calls.CallMethods
|
||||||
import io.emeraldpay.dshackle.upstream.ethereum.EthereumUpstream
|
import io.emeraldpay.dshackle.upstream.ethereum.EthereumUpstream
|
||||||
import io.emeraldpay.dshackle.upstream.forkchoice.MostWorkForkChoice
|
import io.emeraldpay.dshackle.upstream.forkchoice.MostWorkForkChoice
|
||||||
@@ -55,7 +59,8 @@ open class EthereumGrpcUpstream(
|
|||||||
"${parentId}_${chain.chainCode.lowercase(Locale.getDefault())}",
|
"${parentId}_${chain.chainCode.lowercase(Locale.getDefault())}",
|
||||||
UpstreamsConfig.Options.getDefaults(),
|
UpstreamsConfig.Options.getDefaults(),
|
||||||
role,
|
role,
|
||||||
null, null
|
null,
|
||||||
|
null
|
||||||
),
|
),
|
||||||
GrpcUpstream,
|
GrpcUpstream,
|
||||||
Lifecycle {
|
Lifecycle {
|
||||||
|
|||||||
Reference in New Issue
Block a user