Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Nethermind.Core;
using Nethermind.Core.Caching;
using Nethermind.Core.Crypto;
using Nethermind.Core.Extensions;
using Nethermind.Core.Threading;
using Nethermind.Crypto;
using Nethermind.Int256;
Expand Down Expand Up @@ -49,7 +50,7 @@ public sealed class NewPayloadHandler : IAsyncHandler<ExecutionPayload, PayloadS
private readonly IInvalidChainTracker _invalidChainTracker;
private readonly IStateReader _stateReader;
private readonly ILogger _logger;
private readonly LruCache<ValueHash256, (bool valid, string? message)>? _latestBlocks;
private readonly LruCache<Hash256AsKey, (bool valid, string? message)>? _latestBlocks;
private readonly ProcessingOptions _defaultProcessingOptions;
private readonly TimeSpan _timeout;

Expand Down Expand Up @@ -386,6 +387,11 @@ ValidationResult TryCacheResult(ValidationResult result, string? errorMessage)
await _processingQueue.Enqueue(block, processingOptions);
(result, validationMessage) = await blockProcessed.Task.TimeoutOn(timeoutTask, cts);
}
else
{
// Already known block with known processing result, cancel the timeout task
cts.Cancel();
}
}
catch (TimeoutException)
{
Expand Down