Skip to content
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
5 changes: 2 additions & 3 deletions src/Nethermind/Nethermind.Consensus.Ethash/Ethash.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private bool IsLessOrEqualThanTarget(ReadOnlySpan<byte> result, in UInt256 diffi
IEthashDataSet dataSet = _hintBasedCache.Get(epoch);
if (dataSet is null)
{
if (_logger.IsWarn) _logger.Warn($"Ethash cache miss for block {header.ToString(BlockHeader.Format.Short)}");
if (_logger.IsTrace) _logger.Trace($"Ethash cache miss for block {header.ToString(BlockHeader.Format.Short)}");
dataSet = BuildCache(epoch);
}

Expand All @@ -167,8 +167,7 @@ private bool IsLessOrEqualThanTarget(ReadOnlySpan<byte> result, in UInt256 diffi
byte[] mixHash;
while (true)
{
ValueHash256 result;
(mixHash, result, _) = Hashimoto(fullSize, dataSet, headerHashed, null, nonce);
(mixHash, ValueHash256 result, _) = Hashimoto(fullSize, dataSet, headerHashed, null, nonce);
if (IsLessOrEqualThanTarget(result.Bytes, header.Difficulty))
{
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ private void BlockTreeOnNewHeadBlock(object? sender, BlockEventArgs e)
if (!_blockValidator.ValidateSuggestedBlock(currentBlock, entry.ParentHeader, out string? errorMessage))
{
PeerInfo peer = entry.PeerInfo;
if (_logger.IsWarn) _logger.Warn($"Invalid downloaded block from {peer}, {errorMessage}");
if (_logger.IsDebug) _logger.Debug($"Invalid downloaded block from {peer}, {errorMessage}");

if (peer is not null) _syncPeerPool.ReportBreachOfProtocol(peer, DisconnectReason.ForwardSyncFailed, $"invalid block received: {errorMessage}. Block: {currentBlock.Header.ToString(BlockHeader.Format.Short)}");
entry.RetryBlockRequest();
Expand Down Expand Up @@ -410,7 +410,7 @@ public SyncResponseHandlingResult HandleResponse(BlocksRequest response, PeerInf

if (!_blockValidator.ValidateBodyAgainstHeader(entry.Header, body, out string errorMessage))
{
if (_logger.IsWarn) _logger.Warn($"Invalid downloaded block from {peer}, {errorMessage}");
if (_logger.IsDebug) _logger.Debug($"Invalid downloaded block from {peer}, {errorMessage}");

if (peer is not null) _syncPeerPool.ReportBreachOfProtocol(peer, DisconnectReason.ForwardSyncFailed, $"invalid block received: {errorMessage}. Block: {entry.Header.ToString(BlockHeader.Format.Short)}");
result = SyncResponseHandlingResult.LesserQuality;
Expand Down