Skip to content

Commit

Permalink
Fix blockImportCompleted (#8653)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbenr authored Sep 29, 2024
1 parent 214a9a5 commit ac6ee63
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public SafeFuture<SendSignedBlockResult> sendSignedBlock(
return gossipAndImportUnblindedSignedBlockAndBlobSidecars(
signedBlock, blobSidecars, broadcastValidationLevel, blockPublishingPerformance);
})
.thenCompose(result -> calculateResult(blockContainer, result));
.thenCompose(result -> calculateResult(blockContainer, result, blockPublishingPerformance));
}

private SafeFuture<BlockImportAndBroadcastValidationResults>
Expand Down Expand Up @@ -133,7 +133,8 @@ abstract void publishBlockAndBlobSidecars(

private SafeFuture<SendSignedBlockResult> 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
Expand All @@ -155,6 +156,7 @@ private SafeFuture<SendSignedBlockResult> calculateResult(
.blockImportResult()
.thenApply(
importResult -> {
blockPublishingPerformance.blockImportCompleted();
if (importResult.isSuccessful()) {
LOG.trace(
"Successfully imported proposed block: {}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ SafeFuture<BlockImportAndBroadcastValidationResults> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ SafeFuture<BlockImportAndBroadcastValidationResults> importBlockAndBlobSidecars(
final List<BlobSidecar> blobSidecars,
final BroadcastValidationLevel broadcastValidationLevel,
final BlockPublishingPerformance blockPublishingPerformance) {
return blockImportChannel
.importBlock(block, broadcastValidationLevel)
.thenPeek(__ -> blockPublishingPerformance.blockImportCompleted());
return blockImportChannel.importBlock(block, broadcastValidationLevel);
}

@Override
Expand Down

0 comments on commit ac6ee63

Please sign in to comment.