diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/UpstreamRpcMethodsDetector.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/UpstreamRpcMethodsDetector.kt index 215f3faf..62e67e7d 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/UpstreamRpcMethodsDetector.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/UpstreamRpcMethodsDetector.kt @@ -20,6 +20,8 @@ abstract class UpstreamRpcMethodsDetector( "([A-Za-z0-9_]+) found but the containing module is disabled", "[Mm]ethod not found", "The method ([A-Za-z0-9_]+) is not available", + "The method '([A-Za-z0-9_]+)' is not supported.", + "No response for method ([A-Za-z0-9_]+)", ).map { s -> s.toRegex() } private val availableRegexps = diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/BasicEthUpstreamRpcMethodsDetector.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/BasicEthUpstreamRpcMethodsDetector.kt index cb6f1ceb..5e9c0113 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/BasicEthUpstreamRpcMethodsDetector.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/BasicEthUpstreamRpcMethodsDetector.kt @@ -35,6 +35,9 @@ class BasicEthUpstreamRpcMethodsDetector( "eth_getBlockReceipts" to ListParams("latest"), "trace_callMany" to ListParams(listOf(listOf())), "eth_simulateV1" to ListParams(listOf()), + "debug_storageRangeAt" to ListParams(listOf()), + "eth_getTdByNumber" to ListParams(listOf()), + "eth_callBundle" to ListParams(listOf()), ) private fun parseRpcModules(data: ByteArray): Map { diff --git a/src/test/kotlin/io/emeraldpay/dshackle/upstream/ethereum/BasicEthUpstreamRpcMethodsDetectorTest.kt b/src/test/kotlin/io/emeraldpay/dshackle/upstream/ethereum/BasicEthUpstreamRpcMethodsDetectorTest.kt index ed2ca409..182ca8b8 100644 --- a/src/test/kotlin/io/emeraldpay/dshackle/upstream/ethereum/BasicEthUpstreamRpcMethodsDetectorTest.kt +++ b/src/test/kotlin/io/emeraldpay/dshackle/upstream/ethereum/BasicEthUpstreamRpcMethodsDetectorTest.kt @@ -57,6 +57,33 @@ class BasicEthUpstreamRpcMethodsDetectorTest { null, ), ) + on { + read(ChainRequest("debug_storageRangeAt", ListParams(listOf()))) + } doReturn + Mono.just( + ChainResponse( + null, + ChainCallError(32602, "missing value for required argument 0"), + ), + ) + on { + read(ChainRequest("eth_getTdByNumber", ListParams(listOf()))) + } doReturn + Mono.just( + ChainResponse( + null, + ChainCallError(32602, "missing value for required argument 0"), + ), + ) + on { + read(ChainRequest("eth_callBundle", ListParams(listOf()))) + } doReturn + Mono.just( + ChainResponse( + null, + ChainCallError(32602, "missing value for required argument 0"), + ), + ) } val upstream = @@ -115,6 +142,33 @@ class BasicEthUpstreamRpcMethodsDetectorTest { null, ), ) + on { + read(ChainRequest("debug_storageRangeAt", ListParams(listOf()))) + } doReturn + Mono.just( + ChainResponse( + null, + ChainCallError(32602, "missing value for required argument 0"), + ), + ) + on { + read(ChainRequest("eth_getTdByNumber", ListParams(listOf()))) + } doReturn + Mono.just( + ChainResponse( + null, + ChainCallError(32602, "missing value for required argument 0"), + ), + ) + on { + read(ChainRequest("eth_callBundle", ListParams(listOf()))) + } doReturn + Mono.just( + ChainResponse( + null, + ChainCallError(32602, "missing value for required argument 0"), + ), + ) } val upstream = @@ -126,9 +180,13 @@ class BasicEthUpstreamRpcMethodsDetectorTest { val detector = BasicEthUpstreamRpcMethodsDetector(upstream, config) Assertions.assertThat(detector.detectRpcMethods().block()).apply { isNotNull() - hasSize(3) + hasSize(6) containsEntry("eth_getBlockReceipts", true) containsEntry("trace_callMany", true) + containsEntry("eth_simulateV1", true) + containsEntry("debug_storageRangeAt", true) + containsEntry("eth_getTdByNumber", true) + containsEntry("eth_callBundle", true) } } @@ -174,6 +232,33 @@ class BasicEthUpstreamRpcMethodsDetectorTest { ChainCallError(32602, "missing value for required argument 0"), ), ) + on { + read(ChainRequest("debug_storageRangeAt", ListParams(listOf()))) + } doReturn + Mono.just( + ChainResponse( + null, + ChainCallError(32602, "missing value for required argument 0"), + ), + ) + on { + read(ChainRequest("eth_getTdByNumber", ListParams(listOf()))) + } doReturn + Mono.just( + ChainResponse( + null, + ChainCallError(32602, "missing value for required argument 0"), + ), + ) + on { + read(ChainRequest("eth_callBundle", ListParams(listOf()))) + } doReturn + Mono.just( + ChainResponse( + null, + ChainCallError(32602, "missing value for required argument 0"), + ), + ) } val upstream = @@ -196,6 +281,9 @@ class BasicEthUpstreamRpcMethodsDetectorTest { containsEntry("eth_getBlockReceipts", true) containsEntry("debug_traceBlock", true) containsEntry("eth_simulateV1", true) + containsEntry("debug_storageRangeAt", true) + containsEntry("eth_getTdByNumber", true) + containsEntry("eth_callBundle", true) } } }