diff --git a/CHANGELOG.md b/CHANGELOG.md index ac3198102cc..8c0d682f333 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,4 +20,5 @@ - Updated LUKSO configuration with Deneb fork scheduled for epoch 123075 (November 20, 2024, 16:20:00 UTC) ### Bug Fixes - - removed a warning from logs about non blinded blocks being requested (#8562) + - Removed a warning from logs about non blinded blocks being requested (#8562) + - Fixed `blockImportCompleted` log message timing [#8653](https://github.com/Consensys/teku/pull/8653) diff --git a/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/publisher/AbstractBlockPublisher.java b/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/publisher/AbstractBlockPublisher.java index ee70f300bb4..e22fef42ac0 100644 --- a/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/publisher/AbstractBlockPublisher.java +++ b/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/publisher/AbstractBlockPublisher.java @@ -70,7 +70,7 @@ public SafeFuture sendSignedBlock( return gossipAndImportUnblindedSignedBlockAndBlobSidecars( signedBlock, blobSidecars, broadcastValidationLevel, blockPublishingPerformance); }) - .thenCompose(result -> calculateResult(blockContainer, result)); + .thenCompose(result -> calculateResult(blockContainer, result, blockPublishingPerformance)); } private SafeFuture @@ -133,7 +133,8 @@ abstract void publishBlockAndBlobSidecars( private SafeFuture calculateResult( final SignedBlockContainer maybeBlindedBlockContainer, - final BlockImportAndBroadcastValidationResults blockImportAndBroadcastValidationResults) { + final BlockImportAndBroadcastValidationResults blockImportAndBroadcastValidationResults, + final BlockPublishingPerformance blockPublishingPerformance) { // broadcast validation can fail earlier than block import. // The assumption is that in that block import will fail but not as fast @@ -155,6 +156,7 @@ private SafeFuture calculateResult( .blockImportResult() .thenApply( importResult -> { + blockPublishingPerformance.blockImportCompleted(); if (importResult.isSuccessful()) { LOG.trace( "Successfully imported proposed block: {}", diff --git a/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/publisher/BlockPublisherDeneb.java b/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/publisher/BlockPublisherDeneb.java index 9fe3baf6c4d..d27ea756e37 100644 --- a/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/publisher/BlockPublisherDeneb.java +++ b/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/publisher/BlockPublisherDeneb.java @@ -56,9 +56,7 @@ SafeFuture importBlockAndBlobSidecars( final BlockPublishingPerformance blockPublishingPerformance) { // provide blobs for the block before importing it blockBlobSidecarsTrackersPool.onCompletedBlockAndBlobSidecars(block, blobSidecars); - return blockImportChannel - .importBlock(block, broadcastValidationLevel) - .thenPeek(__ -> blockPublishingPerformance.blockImportCompleted()); + return blockImportChannel.importBlock(block, broadcastValidationLevel); } @Override diff --git a/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/publisher/BlockPublisherPhase0.java b/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/publisher/BlockPublisherPhase0.java index 21ca2b370b1..e2b1ed61954 100644 --- a/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/publisher/BlockPublisherPhase0.java +++ b/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/publisher/BlockPublisherPhase0.java @@ -45,9 +45,7 @@ SafeFuture importBlockAndBlobSidecars( final List blobSidecars, final BroadcastValidationLevel broadcastValidationLevel, final BlockPublishingPerformance blockPublishingPerformance) { - return blockImportChannel - .importBlock(block, broadcastValidationLevel) - .thenPeek(__ -> blockPublishingPerformance.blockImportCompleted()); + return blockImportChannel.importBlock(block, broadcastValidationLevel); } @Override