update extra gas to actual value, even if provider set it themselves (#579)
This commit is contained in:
@@ -82,9 +82,7 @@ class EthereumUpstreamSettingsDetector(
|
||||
}.flatMapMany {
|
||||
val gaslimit = String(it).drop(3).dropLast(1).toBigInteger(16) + (21180).toBigInteger()
|
||||
val labels = mutableListOf(Pair("gas-limit", gaslimit.toString(10)))
|
||||
if (gaslimit >= (600_000_000).toBigInteger()) {
|
||||
labels.add(Pair("extra_gas_limit", "600000000"))
|
||||
}
|
||||
labels.add(Pair("extra_gas_limit", gaslimit.toString(10)))
|
||||
Flux.fromIterable(labels)
|
||||
}.onErrorResume {
|
||||
Flux.empty()
|
||||
|
||||
@@ -47,7 +47,8 @@ class EthereumUpstreamSettingsDetectorSpec extends Specification {
|
||||
new Pair<String, String>("client_type", clientType),
|
||||
new Pair<String, String>("client_version", version),
|
||||
new Pair<String, String>("archive", "true"),
|
||||
new Pair<String, String>("gas-limit", "50000000")
|
||||
new Pair<String, String>("gas-limit", "50000000"),
|
||||
new Pair<String, String>("extra_gas_limit", "50000000")
|
||||
)
|
||||
.expectComplete()
|
||||
.verify(Duration.ofSeconds(1))
|
||||
|
||||
Reference in New Issue
Block a user