From 6b249a3e15790c3944daafb9daf17029d6295fc8 Mon Sep 17 00:00:00 2001 From: KirillPamPam Date: Tue, 30 Jul 2024 19:00:15 +0400 Subject: [PATCH] Aleph main (#536) --- emerald-grpc | 2 +- foundation/src/main/resources/public | 2 +- .../upstream/generic/connectors/GenericRpcConnector.kt | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/emerald-grpc b/emerald-grpc index 2bf139e80..fddeafc25 160000 --- a/emerald-grpc +++ b/emerald-grpc @@ -1 +1 @@ -Subproject commit 2bf139e8090743bc2f117045fa6cf064c739941b +Subproject commit fddeafc254fda37102501202feb6bc29401f5ffd diff --git a/foundation/src/main/resources/public b/foundation/src/main/resources/public index 1603cf3af..8cc3c2830 160000 --- a/foundation/src/main/resources/public +++ b/foundation/src/main/resources/public @@ -1 +1 @@ -Subproject commit 1603cf3af757ce792b5aaac41131e7a8fa929a67 +Subproject commit 8cc3c28304289ce7d93175d7d750295bfc65a18b diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/generic/connectors/GenericRpcConnector.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/generic/connectors/GenericRpcConnector.kt index f58d987b8..17d01ff3e 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/generic/connectors/GenericRpcConnector.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/generic/connectors/GenericRpcConnector.kt @@ -129,7 +129,7 @@ class GenericRpcConnector( } } - liveness = if (connectorType != RPC_ONLY && (chain == Chain.OPEN_CAMPUS_CODEX__SEPOLIA || chain == Chain.ALEPHZERO__SEPOLIA || chain == Chain.CONNEXT__SEPOLIA)) { + liveness = if (connectorType != RPC_ONLY && isSpecialChain(chain)) { AlwaysHeadLivenessValidator() } else { when (connectorType) { @@ -139,6 +139,9 @@ class GenericRpcConnector( } } + private fun isSpecialChain(chain: Chain) = + chain == Chain.OPEN_CAMPUS_CODEX__SEPOLIA || chain == Chain.ALEPHZERO__SEPOLIA || chain == Chain.CONNEXT__SEPOLIA || chain == Chain.ALEPHZERO__MAINNET + override fun setCaches(caches: Caches) { if (head is CachesEnabled) { head.setCaches(caches)