From a79d64c066c5ec61a803bc571f1a9495411045a8 Mon Sep 17 00:00:00 2001 From: msizov Date: Wed, 2 Apr 2025 15:49:04 +0700 Subject: [PATCH] use lower bounds with offsets for beacon chain (#647) --- .../upstream/beaconchain/BeaconChainLowerBoundBlockDetector.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/beaconchain/BeaconChainLowerBoundBlockDetector.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/beaconchain/BeaconChainLowerBoundBlockDetector.kt index 0892bc71..96d7cdcc 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/beaconchain/BeaconChainLowerBoundBlockDetector.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/beaconchain/BeaconChainLowerBoundBlockDetector.kt @@ -24,6 +24,7 @@ class BeaconChainLowerBoundBlockDetector( private val recursiveLowerBound = RecursiveLowerBound(upstream, LowerBoundType.BLOCK, stateErrors, lowerBounds) companion object { + const val MAX_OFFSET = 30 val notFoundError = "NOT_FOUND:" // e.g. {"message":"NOT_FOUND: beacon block at slot 1086646","code":404} val notFoundError2 = "Could not find requested block" // {"message":"Could not find requested block: signed beacon block can't be nil","code":404} val notFoundError3 = "has not been found" // Block header/data has not been found @@ -35,7 +36,7 @@ class BeaconChainLowerBoundBlockDetector( } override fun internalDetectLowerBound(): Flux { - return recursiveLowerBound.recursiveDetectLowerBound { block -> + return recursiveLowerBound.recursiveDetectLowerBoundWithOffset(MAX_OFFSET) { block -> val restParams = RestParams(emptyList(), emptyList(), listOf(block.toString()), ByteArray(0)) upstream.getIngressReader()