From 2e4c99b20200e271ac9edfab619fa7d8e2b7ebd4 Mon Sep 17 00:00:00 2001 From: Artem Rootman <4586640+artemrootman@users.noreply.github.com> Date: Mon, 26 Jan 2026 10:41:56 +0200 Subject: [PATCH] Fix Hyperliquid native tx detection on testnet (#780) --- .../ethereum/EthereumUpstreamSettingsDetector.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstreamSettingsDetector.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstreamSettingsDetector.kt index 022191e9..beca4ca9 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstreamSettingsDetector.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstreamSettingsDetector.kt @@ -14,6 +14,8 @@ import reactor.core.publisher.Mono import java.util.concurrent.atomic.AtomicInteger const val ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" +const val HL_NATIVE_TX_FROM_MAINNET = "0x2222222222222222222222222222222222222222" +const val HL_NATIVE_TX_FROM_TESTNET = "0x6ed35e7d6de4b45f4efb8a91eff31afa49362569" class EthereumUpstreamSettingsDetector( private val _upstream: Upstream, @@ -181,6 +183,11 @@ class EthereumUpstreamSettingsDetector( if (chain != Chain.HYPERLIQUID__MAINNET && chain != Chain.HYPERLIQUID__TESTNET) { return Flux.empty() } + val hlNativeTxFrom = when (chain) { + Chain.HYPERLIQUID__MAINNET -> HL_NATIVE_TX_FROM_MAINNET + Chain.HYPERLIQUID__TESTNET -> HL_NATIVE_TX_FROM_TESTNET + else -> return Flux.empty() + } if (detectCounter.get() % 5 != 1) { return Flux.empty() // reduce frequency of detection } @@ -211,7 +218,7 @@ class EthereumUpstreamSettingsDetector( if (receiptsJson.isArray) { receiptsJson.forEach { receipt -> val from = receipt.get("from")?.asText() - if (from == "0x2222222222222222222222222222222222222222") { // system topup transaction + if (from == hlNativeTxFrom) { // system topup transaction foundHlNativeTx = true } }