diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/UpstreamValidator.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/UpstreamValidator.kt index 207e324a1..3df71e269 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/UpstreamValidator.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/UpstreamValidator.kt @@ -34,8 +34,8 @@ abstract class UpstreamValidator( abstract fun validateUpstreamSettings(): Mono - fun validateUpstreamSettingsOnStartup(): ValidateUpstreamSettingsResult { - return validateUpstreamSettings().block() ?: ValidateUpstreamSettingsResult.UPSTREAM_FATAL_SETTINGS_ERROR + open fun validateUpstreamSettingsOnStartup(): ValidateUpstreamSettingsResult { + return ValidateUpstreamSettingsResult.UPSTREAM_VALID } companion object { diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstreamValidator.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstreamValidator.kt index 8d37b572a..041714389 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstreamValidator.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstreamValidator.kt @@ -80,11 +80,23 @@ open class EthereumUpstreamValidator @JvmOverloads constructor( } return Mono.zip( validateChain(), - validateCallLimit(), validateOldBlocks(), ).map { - listOf(it.t1, it.t2, it.t3).sorted().last() + listOf(it.t1, it.t2).maxOf { it } + } + } + + override fun validateUpstreamSettingsOnStartup(): ValidateUpstreamSettingsResult { + if (options.disableUpstreamValidation) { + return ValidateUpstreamSettingsResult.UPSTREAM_VALID } + return Mono.zip( + validateChain(), + validateOldBlocks(), + validateCallLimit(), + ).map { + listOf(it.t1, it.t2, it.t3).maxOf { it } + }.block() ?: ValidateUpstreamSettingsResult.UPSTREAM_SETTINGS_ERROR } private fun validateChain(): Mono {