From b5d4cbc68ed15678473c09b0a3cdfbcb99d5b14d Mon Sep 17 00:00:00 2001 From: Enrico Del Fante Date: Wed, 6 Nov 2024 19:04:31 +0100 Subject: [PATCH] Improve error on local EL blobs lookup (#8826) --- .../util/BlockBlobSidecarsTrackersPoolImpl.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 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 5be4941c9ec..55a39d8a34c 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 @@ -14,6 +14,7 @@ package tech.pegasys.teku.statetransition.util; import static com.google.common.base.Preconditions.checkArgument; +import static tech.pegasys.teku.infrastructure.exceptions.ExceptionUtil.getRootCauseMessage; import static tech.pegasys.teku.infrastructure.time.TimeUtilities.secondsToMillis; import static tech.pegasys.teku.statetransition.blobs.BlobSidecarManager.RemoteOrigin.LOCAL_EL; import static tech.pegasys.teku.statetransition.blobs.BlobSidecarManager.RemoteOrigin.LOCAL_PROPOSAL; @@ -33,7 +34,6 @@ import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.tuweni.bytes.Bytes32; @@ -508,10 +508,7 @@ private BlockBlobSidecarsTracker internalOnNewBlock( // Let's try now if (!existingTracker.isLocalElFetchTriggered() && !existingTracker.isCompleted()) { fetchMissingContentFromLocalEL(slotAndBlockRoot) - .finish( - error -> - LOG.error( - "An error occurred while attempting to fetch blobs via local EL")); + .finish(this::logLocalElBlobsLookupFailure); } } }); @@ -597,11 +594,7 @@ private void onFirstSeen( .runAfterDelay( () -> this.fetchMissingContentFromLocalEL(slotAndBlockRoot) - .handleException( - error -> - LOG.warn( - "Local EL blobs lookup failed: {}", - ExceptionUtils.getRootCauseMessage(error))) + .handleException(this::logLocalElBlobsLookupFailure) .thenRun(() -> this.fetchMissingContentFromRemotePeers(slotAndBlockRoot)), fetchDelay) .finish( @@ -609,6 +602,10 @@ private void onFirstSeen( LOG.error("An error occurred while attempting to fetch missing blobs.", error)); } + private void logLocalElBlobsLookupFailure(final Throwable error) { + LOG.warn("Local EL blobs lookup failed: {}", getRootCauseMessage(error)); + } + @VisibleForTesting Duration calculateFetchDelay(final SlotAndBlockRoot slotAndBlockRoot) { final UInt64 slot = slotAndBlockRoot.getSlot();