Fix archive detection (#561)
This commit is contained in:
@@ -25,7 +25,7 @@ class Defaults {
|
||||
const val maxMetadataSize = 16384
|
||||
val timeout: Duration = Duration.ofSeconds(60)
|
||||
val timeoutInternal: Duration = timeout.dividedBy(4)
|
||||
val internalCallsTimeout = Duration.ofSeconds(3)
|
||||
val internalCallsTimeout = Duration.ofSeconds(5)
|
||||
val retryConnection: Duration = Duration.ofSeconds(10)
|
||||
val grpcServerKeepAliveTime: Long = 15 // seconds
|
||||
val grpcServerKeepAliveTimeout: Long = 5
|
||||
|
||||
@@ -19,11 +19,14 @@ class EthereumUpstreamSettingsDetector(
|
||||
private val chain: Chain,
|
||||
) : BasicEthUpstreamSettingsDetector(_upstream) {
|
||||
private val blockNumberReader = EthereumArchiveBlockNumberReader(upstream.getIngressReader())
|
||||
private val notArchived = upstream
|
||||
.getLabels()
|
||||
.find { it.getOrDefault("archive", "") == "false" } != null
|
||||
|
||||
override fun internalDetectLabels(): Flux<Pair<String, String>> {
|
||||
return Flux.merge(
|
||||
detectNodeType(),
|
||||
detectArchiveNode(),
|
||||
detectArchiveNode(notArchived),
|
||||
detectGasLabels(),
|
||||
)
|
||||
}
|
||||
@@ -88,8 +91,8 @@ class EthereumUpstreamSettingsDetector(
|
||||
}
|
||||
}
|
||||
|
||||
private fun detectArchiveNode(): Mono<Pair<String, String>> {
|
||||
if (upstream.getLabels().firstOrNull { it.getOrDefault("archive", "") == "false" } != null) {
|
||||
private fun detectArchiveNode(notArchived: Boolean): Mono<Pair<String, String>> {
|
||||
if (notArchived) {
|
||||
return Mono.empty()
|
||||
}
|
||||
return Mono.zip(
|
||||
|
||||
@@ -38,7 +38,7 @@ class AggregatedUpstreamValidator(
|
||||
.timeout(internalCallsTimeout)
|
||||
.onErrorResume {
|
||||
log.error("Error during upstream validation for {}, reason - {}", upstream.getId(), it.message)
|
||||
Mono.just(ValidateUpstreamSettingsResult.UPSTREAM_FATAL_SETTINGS_ERROR)
|
||||
Mono.just(ValidateUpstreamSettingsResult.UPSTREAM_SETTINGS_ERROR)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user