Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error on local EL blobs lookup #8826

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}
}
});
Expand Down Expand Up @@ -597,18 +594,18 @@ 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(
error ->
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();
Expand Down