From 9d1d5d9b6ecc1a740d8a122d5b0430dad001e18f Mon Sep 17 00:00:00 2001 From: Stefan Bratanov Date: Thu, 19 Dec 2024 09:40:26 +0000 Subject: [PATCH] improvement --- .../util/BlockBlobSidecarsTrackersPoolImpl.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/util/BlockBlobSidecarsTrackersPoolImpl.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/util/BlockBlobSidecarsTrackersPoolImpl.java index 1e6048eb610..b9ac1b32ca4 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/util/BlockBlobSidecarsTrackersPoolImpl.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/util/BlockBlobSidecarsTrackersPoolImpl.java @@ -505,15 +505,20 @@ private BlockBlobSidecarsTracker internalOnNewBlock( countBlock(remoteOrigin); - if (existingTracker.isRpcBlockFetchTriggered() && !existingTracker.isComplete()) { - // if we attempted to fetch this block via RPC, we missed the opportunity to - // complete the blob sidecars via local EL and RPC (since the block is required to - // be known) Let's try now + if (!existingTracker.isComplete()) { + // we missed the opportunity to complete the blob sidecars via local EL and RPC + // (since the block is required to be known) Let's try now asyncRunner.runAsync( () -> fetchMissingBlobsFromLocalEL(slotAndBlockRoot) .handleException(this::logLocalElBlobsLookupFailure) - .thenRun(() -> fetchMissingBlockOrBlobsFromRPC(slotAndBlockRoot)) + .thenRun( + () -> { + // respect the RPC fetch delay + if (existingTracker.isRpcBlockFetchTriggered()) { + fetchMissingBlockOrBlobsFromRPC(slotAndBlockRoot); + } + }) .finish(this::logBlockOrBlobsRPCFailure)); } });