Skip to content

Commit

Permalink
update extra gas to actual value, even if provider set it themselves (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Termina1 authored Oct 21, 2024
1 parent 2800556 commit 184939a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 184939a

Please sign in to comment.