From e248a49d00c80a7ca75ea3b2720900784ab16e41 Mon Sep 17 00:00:00 2001 From: Termina1 Date: Wed, 20 Aug 2025 17:41:04 +0300 Subject: [PATCH] fix ronin liveness --- .../dshackle/upstream/ethereum/HeadLivenessValidatorImpl.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/HeadLivenessValidatorImpl.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/HeadLivenessValidatorImpl.kt index d31bb182..e98138ae 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/HeadLivenessValidatorImpl.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/HeadLivenessValidatorImpl.kt @@ -27,7 +27,8 @@ class HeadLivenessValidatorImpl( val headLiveness = head.headLiveness() // first we have moving window of 2 blocks and check that they are consecutive ones val headFlux = head.getFlux().map { it.height }.buffer(2, 1).map { - it.last() - it.first() == 1L + // sometimes we can get there the same block, in this case it will be reorg + it.last() - it.first() <= 1L }.scan(Pair(0, true)) { acc, value -> // then we accumulate consecutive true events, false resets counter if (value) {