Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
@@ -1,8 +1,6 @@
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using System;
using Nethermind.Blockchain;
using Nethermind.Core;

namespace Nethermind.Consensus.Clique
Expand All @@ -13,23 +11,6 @@ public static bool IsInTurn(this BlockHeader header)
{
return header.Difficulty == Clique.DifficultyInTurn;
}

internal static Address[] ExtractSigners(BlockHeader blockHeader)
{
if (blockHeader.ExtraData is null)
{
throw new BlockchainException("Block header ExtraData cannot be null when extracting signers");
}

Span<byte> signersData = blockHeader.ExtraData.AsSpan(Clique.ExtraVanityLength, (blockHeader.ExtraData.Length - Clique.ExtraSealLength));
Address[] signers = new Address[signersData.Length / Address.Size];
for (int i = 0; i < signers.Length; i++)
{
signers[i] = new Address(signersData.Slice(i * 20, 20).ToArray());
}

return signers;
}
}

internal static class BlockExtensions
Expand Down
132 changes: 0 additions & 132 deletions src/Nethermind/Nethermind.Core/Collections/HashHelpers.cs

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ namespace Nethermind.Init.Steps
public class InitializeBlockchain(INethermindApi api, IChainHeadInfoProvider chainHeadInfoProvider) : IStep
{
private readonly INethermindApi _api = api;
private ILogManager _logManager = api.LogManager;

public async Task Execute(CancellationToken _)
{
Expand Down
22 changes: 0 additions & 22 deletions src/Nethermind/Nethermind.Network/PeerEqualityComparer.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,6 @@ private DaDataSource ProcessCalldataBatcherTransaction(L1Transaction transaction
return _unfinalizedL1BlocksQueue.Count == 0 ? null : _unfinalizedL1BlocksQueue.Dequeue();
}

private void LogReorg()
{
if (_logger.IsInfo) _logger.Info("L1 reorg detected. Resetting pipeline");
}

public async Task<L1Block> GetBlock(ulong blockNumber, CancellationToken token) =>
await RetryGetBlock(async () => await _ethL1Api.GetBlockByNumber(blockNumber, true), token);

Expand Down
15 changes: 0 additions & 15 deletions src/Nethermind/Nethermind.Runner/Ethereum/EthereumRunner.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only

using System;
using System.Threading;
using System.Threading.Tasks;
using Autofac;
Expand Down Expand Up @@ -41,18 +40,4 @@ public async Task StopAsync()
_logger.Info("Ethereum runner stopped");
}
}

private Task Stop(Func<Task?> stopAction, string description)
{
try
{
if (_logger.IsInfo) _logger.Info(description);
return stopAction() ?? Task.CompletedTask;
}
catch (Exception e)
{
if (_logger.IsError) _logger.Error($"{description} shutdown error.", e);
return Task.CompletedTask;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ namespace Nethermind.Serialization.Ssz;
/// </summary>
public static partial class Ssz
{
private const int VarOffsetSize = sizeof(uint);

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void Encode(Span<byte> span, byte[] value, ref int offset)
{
Expand Down
18 changes: 0 additions & 18 deletions src/Nethermind/Nethermind.Serialization.Ssz/Ssz.Containers.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,6 @@ public void UnmarkClear()

private sealed class PerContractState : IReturnable
{
private static readonly Func<StorageCell, PerContractState, byte[]> _loadFromTreeStorageFunc = LoadFromTreeStorage;
private IWorldStateScopeProvider.IStorageTree? _backend;

private readonly DefaultableDictionary BlockChange = new();
Expand Down
22 changes: 0 additions & 22 deletions src/Nethermind/Nethermind.Trie/PatriciaTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -25,7 +24,6 @@ namespace Nethermind.Trie
public partial class PatriciaTree
{
private const int MaxKeyStackAlloc = 64;
private readonly static byte[][] _singleByteKeys = [[0], [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], [15]];

private readonly ILogger _logger;

Expand Down Expand Up @@ -1003,25 +1001,5 @@ bool TryGetRootRef(out TrieNode? rootRef)

[DoesNotReturn, StackTraceHidden]
static void ThrowReadOnlyTrieException() => throw new TrieException("Commits are not allowed on this trie.");

[DoesNotReturn, StackTraceHidden]
private static void ThrowInvalidDataException(TrieNode originalNode)
{
throw new InvalidDataException(
$"Extension {originalNode.Keccak} has no child.");
}

[DoesNotReturn, StackTraceHidden]
private static void ThrowMissingChildException(TrieNode node)
{
throw new TrieException(
$"Found an {nameof(NodeType.Extension)} {node.Keccak} that is missing a child.");
}

[DoesNotReturn, StackTraceHidden]
private static void ThrowMissingPrefixException()
{
throw new InvalidDataException("An attempt to visit a node without a prefix path.");
}
}
}
5 changes: 0 additions & 5 deletions src/Nethermind/Nethermind.Trie/Pruning/TrieStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1228,11 +1228,6 @@ public bool IsNoLongerNeeded(long lastCommit)
&& lastCommit < LatestCommittedBlockNumber - _maxDepth;
}

private bool IsStillNeeded(long lastCommit)
{
return !IsNoLongerNeeded(lastCommit);
}

private void AnnounceReorgBoundaries()
{
if (LatestCommittedBlockNumber < 1)
Expand Down
1 change: 0 additions & 1 deletion src/Nethermind/Nethermind.Trie/TrieNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public sealed partial class TrieNode
#endif

private static readonly object _nullNode = new();
private static readonly TrieNodeDecoder _nodeDecoder = new();
private static readonly AccountDecoder _accountDecoder = new();

private const byte _dirtyMask = 0b001;
Expand Down

This file was deleted.

11 changes: 0 additions & 11 deletions src/Nethermind/Nethermind.Xdc/IXdcSealer.cs

This file was deleted.

12 changes: 0 additions & 12 deletions src/Nethermind/Nethermind.Xdc/XdcDbNames.cs

This file was deleted.