add disable-bound-validation option (#675)
* add disable-bound-validation option * fix test
This commit is contained in:
@@ -17,6 +17,7 @@ class ChainOptions {
|
||||
val validateChain: Boolean,
|
||||
val callLimitSize: Int,
|
||||
val disableLivenessSubscriptionValidation: Boolean,
|
||||
val disableBoundValidation: Boolean = false,
|
||||
)
|
||||
|
||||
data class DefaultOptions(
|
||||
@@ -38,6 +39,7 @@ class ChainOptions {
|
||||
var validateChain: Boolean? = null,
|
||||
var callLimitSize: Int? = null,
|
||||
var disableLivenessSubscriptionValidation: Boolean? = null,
|
||||
var disableBoundValidation: Boolean? = null,
|
||||
) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
@@ -67,6 +69,7 @@ class ChainOptions {
|
||||
overwrites.disableUpstreamValidation ?: this.disableUpstreamValidation
|
||||
copy.callLimitSize = overwrites.callLimitSize ?: this.callLimitSize
|
||||
copy.disableLivenessSubscriptionValidation = overwrites.disableLivenessSubscriptionValidation ?: this.disableLivenessSubscriptionValidation
|
||||
copy.disableBoundValidation = overwrites.disableBoundValidation ?: this.disableBoundValidation
|
||||
return copy
|
||||
}
|
||||
|
||||
@@ -85,6 +88,7 @@ class ChainOptions {
|
||||
this.validateChain ?: true,
|
||||
this.callLimitSize ?: 1_000_000,
|
||||
this.disableLivenessSubscriptionValidation ?: false,
|
||||
this.disableBoundValidation ?: false,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,9 @@ class ChainOptionsReader : YamlConfigReader<ChainOptions.PartialOptions>() {
|
||||
getValueAsBool(values, "disable-liveness-subscription-validation")?.let {
|
||||
options.disableLivenessSubscriptionValidation = it
|
||||
}
|
||||
getValueAsBool(values, "disable-bound-validation")?.let {
|
||||
options.disableBoundValidation = it
|
||||
}
|
||||
return options
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +343,9 @@ open class GenericUpstream(
|
||||
}
|
||||
detectSettings()
|
||||
|
||||
detectLowerBlock()
|
||||
if (!getOptions().disableBoundValidation) {
|
||||
detectLowerBlock()
|
||||
}
|
||||
|
||||
detectFinalization()
|
||||
}
|
||||
|
||||
@@ -636,7 +636,7 @@ class UpstreamsConfigReaderSpec extends Specification {
|
||||
def options = partialOptions.buildOptions()
|
||||
then:
|
||||
options == new ChainOptions.Options(
|
||||
false, false, 30, Duration.ofSeconds(60), null, true, 1, true, true, true, true, 1_000_000, false
|
||||
false, false, 30, Duration.ofSeconds(60), null, true, 1, true, true, true, true, 1_000_000, false, false
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user