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

Fix blockImportCompleted #8653

Merged
merged 3 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
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
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