From bf18171c74f743227df3eadbaaa8b40043359cd4 Mon Sep 17 00:00:00 2001 From: Enrico Del Fante Date: Fri, 27 Sep 2024 16:15:12 +0200 Subject: [PATCH 1/2] fix blockImportCompleted --- .../coordinator/publisher/AbstractBlockPublisher.java | 6 ++++-- .../coordinator/publisher/BlockPublisherDeneb.java | 4 +--- .../coordinator/publisher/BlockPublisherPhase0.java | 4 +--- 3 files changed, 6 insertions(+), 8 deletions(-) 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 From 8645ee3c4480d4f422bc1472a7909050cc72d863 Mon Sep 17 00:00:00 2001 From: Lucas Saldanha Date: Mon, 30 Sep 2024 10:35:28 +1300 Subject: [PATCH 2/2] Changelog update --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)