Rewrite extra gas label (#617)

This commit is contained in:
KirillPamPam
2025-01-08 14:36:29 +04:00
committed by GitHub
parent c6955afce4
commit 15ffdc2d2e
2 changed files with 8 additions and 4 deletions

View File

@@ -81,9 +81,13 @@ class EthereumUpstreamSettingsDetector(
it.requireResult()
}.flatMapMany {
val gaslimit = String(it).drop(3).dropLast(1).toBigInteger(16) + (21182).toBigInteger()
val labels = mutableListOf(Pair("gas-limit", gaslimit.toString(10)))
val nodeGasLimit = gaslimit.toString(10)
val labels = mutableListOf(Pair("gas-limit", nodeGasLimit))
if (gaslimit.toLong() > 590_000_000L) {
labels.add(Pair("extra_gas_limit", 600_000_000.toString()))
} else {
// disable extra gas
labels.add(Pair("extra_gas_limit", nodeGasLimit))
}
Flux.fromIterable(labels)
}.onErrorResume {