From 7c13902b03728bac38798df84e0c7e858fc563da Mon Sep 17 00:00:00 2001 From: Termina1 Date: Thu, 8 Dec 2022 15:33:00 +0200 Subject: [PATCH] adjusted quorums for default EVM methods --- .../dshackle/upstream/calls/DefaultEthereumMethods.kt | 11 +++++------ .../upstream/calls/DefaultEthereumMethodsSpec.groovy | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt index 20bea42f..78821e61 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt @@ -114,7 +114,8 @@ class DefaultEthereumMethods( override fun createQuorumFor(method: String): CallQuorum { return when { - filterMethods.contains(method) -> NotLaggingQuorum(1) + newFilterMethods.contains(method) -> NotLaggingQuorum(4) + withFilterIdMethods.contains(method) -> AlwaysQuorum() hardcodedMethods.contains(method) -> AlwaysQuorum() firstValueMethods.contains(method) -> AlwaysQuorum() anyResponseMethods.contains(method) -> NotLaggingQuorum(4) @@ -131,12 +132,11 @@ class DefaultEthereumMethods( getChainSpecificMethods(chain).contains(method) -> { when (method) { - "eth_getBlockRange" -> NotLaggingQuorum(1) - "bor_getAuthor" -> NotLaggingQuorum(0) + "bor_getAuthor" -> NotLaggingQuorum(4) "bor_getCurrentValidators" -> NotLaggingQuorum(0) "bor_getCurrentProposer" -> NotLaggingQuorum(0) - "bor_getRootHash" -> NotLaggingQuorum(1) - "eth_getRootHash" -> NotLaggingQuorum(1) + "bor_getRootHash" -> NotLaggingQuorum(4) + "eth_getRootHash" -> NotLaggingQuorum(4) else -> AlwaysQuorum() } } @@ -147,7 +147,6 @@ class DefaultEthereumMethods( private fun getChainSpecificMethods(chain: Chain): List { return when (chain) { Chain.OPTIMISM -> listOf( - "eth_getBlockRange", "rollup_gasPrices" ) Chain.POLYGON -> listOf( diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethodsSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethodsSpec.groovy index b3c46e2b..65044f61 100644 --- a/src/test/groovy/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethodsSpec.groovy +++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethodsSpec.groovy @@ -67,6 +67,6 @@ class DefaultEthereumMethodsSpec extends Specification { "bor_getRootHash", "bor_getSignersAtHash", "eth_getRootHash"] - Chain.OPTIMISM | ["eth_getBlockRange", "rollup_gasPrices"] + Chain.OPTIMISM | ["rollup_gasPrices"] } }