update extra gas to actual value, even if provider set it themselves (#579)

This commit is contained in:
Vyacheslav
2024-10-21 15:23:34 +03:00
committed by GitHub
parent 2800556ff1
commit 184939a463
2 changed files with 3 additions and 4 deletions

View File

@@ -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()

View File

@@ -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))