Merge pull request #70 from p2p-org/fix-filter-quorum

Rethink default method quorums a bit
This commit is contained in:
Vyacheslav Shebanov
2022-12-08 16:49:04 +02:00
committed by GitHub
2 changed files with 6 additions and 7 deletions

View File

@@ -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<String> {
return when (chain) {
Chain.OPTIMISM -> listOf(
"eth_getBlockRange",
"rollup_gasPrices"
)
Chain.POLYGON -> listOf(

View File

@@ -67,6 +67,6 @@ class DefaultEthereumMethodsSpec extends Specification {
"bor_getRootHash",
"bor_getSignersAtHash",
"eth_getRootHash"]
Chain.OPTIMISM | ["eth_getBlockRange", "rollup_gasPrices"]
Chain.OPTIMISM | ["rollup_gasPrices"]
}
}