Skip to content

Commit

Permalink
Include information about why publishing the attestation failed in re…
Browse files Browse the repository at this point in the history
…sponse (#6332)
  • Loading branch information
ajsutton authored Oct 21, 2022
1 parent c9bf8e9 commit 02fd0a7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions beacon/validator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dependencies {
implementation project(':data:serializer')
implementation project(':data:provider')
implementation project(':infrastructure:events')
implementation project(':infrastructure:exceptions')
implementation project(':infrastructure:metrics')

implementation 'it.unimi.dsi:fastutil'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toMap;
import static tech.pegasys.teku.infrastructure.exceptions.ExceptionUtil.getMessageOrSimpleName;
import static tech.pegasys.teku.infrastructure.logging.ValidatorLogger.VALIDATOR_LOGGER;
import static tech.pegasys.teku.spec.config.SpecConfig.GENESIS_SLOT;

Expand Down Expand Up @@ -493,10 +494,18 @@ private SafeFuture<InternalValidationResult> processAttestation(final Attestatio
}
})
.exceptionally(
error ->
InternalValidationResult.reject(
"Failed to send signed attestation for slot %s, block %s",
attestation.getData().getSlot(), attestation.getData().getBeaconBlockRoot()));
error -> {
LOG.error(
"Failed to send signed attestation for slot {}, block {}",
attestation.getData().getSlot(),
attestation.getData().getBeaconBlockRoot(),
error);
return InternalValidationResult.reject(
"Failed to send signed attestation for slot %s, block %s: %s",
attestation.getData().getSlot(),
attestation.getData().getBeaconBlockRoot(),
getMessageOrSimpleName(error));
});
}

private List<SubmitDataError> convertAttestationProcessingResultsToErrorList(
Expand Down

0 comments on commit 02fd0a7

Please sign in to comment.