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
26 changes: 0 additions & 26 deletions src/Nethermind/Nethermind.Blockchain/BlockTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -628,32 +628,6 @@ as it does not require the step of resolving number -> hash */
return result;
}

public BlockHeader? FindLowestCommonAncestor(BlockHeader firstDescendant, BlockHeader secondDescendant,
long maxSearchDepth)
{
if (firstDescendant.Number > secondDescendant.Number)
{
firstDescendant = GetAncestorAtNumber(firstDescendant, secondDescendant.Number);
}
else if (secondDescendant.Number > firstDescendant.Number)
{
secondDescendant = GetAncestorAtNumber(secondDescendant, firstDescendant.Number);
}

long currentSearchDepth = 0;
while (
firstDescendant is not null
&& secondDescendant is not null
&& firstDescendant.Hash != secondDescendant.Hash)
{
if (currentSearchDepth++ >= maxSearchDepth) return null;
firstDescendant = this.FindParentHeader(firstDescendant, BlockTreeLookupOptions.TotalDifficultyNotNeeded);
secondDescendant = this.FindParentHeader(secondDescendant, BlockTreeLookupOptions.TotalDifficultyNotNeeded);
}

return firstDescendant;
}

private BlockHeader? GetAncestorAtNumber(BlockHeader header, long number)
{
BlockHeader? result = header;
Expand Down
2 changes: 0 additions & 2 deletions src/Nethermind/Nethermind.Blockchain/IBlockTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ AddBlockResult Insert(Block block, BlockTreeInsertBlockOptions insertBlockOption

IOwnedReadOnlyList<BlockHeader> FindHeaders(Hash256 hash, int numberOfBlocks, int skip, bool reverse);

BlockHeader FindLowestCommonAncestor(BlockHeader firstDescendant, BlockHeader secondDescendant, long maxSearchDepth);

void DeleteInvalidBlock(Block invalidBlock);

void ForkChoiceUpdated(Hash256? finalizedBlockHash, Hash256? safeBlockBlockHash);
Expand Down
2 changes: 0 additions & 2 deletions src/Nethermind/Nethermind.Blockchain/ReadOnlyBlockTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ public void UpdateHeadBlock(Hash256 blockHash)

public IOwnedReadOnlyList<BlockHeader> FindHeaders(Hash256 hash, int numberOfBlocks, int skip, bool reverse) => _wrapped.FindHeaders(hash, numberOfBlocks, skip, reverse);

public BlockHeader FindLowestCommonAncestor(BlockHeader firstDescendant, BlockHeader secondDescendant, long maxSearchDepth) => _wrapped.FindLowestCommonAncestor(firstDescendant, secondDescendant, maxSearchDepth);

public Block FindBlock(long blockNumber, BlockTreeLookupOptions options) => _wrapped.FindBlock(blockNumber, options);

public void DeleteInvalidBlock(Block invalidBlock) => throw new InvalidOperationException($"{nameof(ReadOnlyBlockTree)} does not expect {nameof(DeleteInvalidBlock)} calls");
Expand Down
13 changes: 0 additions & 13 deletions src/Nethermind/Nethermind.Db.Rocks/Config/DbConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,6 @@ public class DbConfig : IDbConfig
public long? BloomDbMaxBytesPerSec { get; set; }
public IDictionary<string, string>? BloomDbAdditionalRocksDbOptions { get; set; }

// TODO - profile and customize
public ulong CanonicalHashTrieDbWriteBufferSize { get; set; } = (ulong)2.MB();
public uint CanonicalHashTrieDbWriteBufferNumber { get; set; } = 4;
public ulong CanonicalHashTrieDbBlockCacheSize { get; set; } = 0;
public bool CanonicalHashTrieDbCacheIndexAndFilterBlocks { get; set; } = false;
public int? CanonicalHashTrieDbMaxOpenFiles { get; set; }
public long? CanonicalHashTrieDbMaxBytesPerSec { get; set; }
public int? CanonicalHashTrieDbBlockSize { get; set; }
public bool? CanonicalHashTrieUseDirectReads { get; set; }
public bool? CanonicalHashTrieUseDirectIoForFlushAndCompactions { get; set; }
public ulong? CanonicalHashTrieCompactionReadAhead { get; set; }
public IDictionary<string, string>? CanonicalHashTrieDbAdditionalRocksDbOptions { get; set; }

public ulong MetadataDbWriteBufferSize { get; set; } = (ulong)1.KiB();
public uint MetadataDbWriteBufferNumber { get; set; } = 4;
public ulong MetadataDbBlockCacheSize { get; set; } = 0;
Expand Down
12 changes: 0 additions & 12 deletions src/Nethermind/Nethermind.Db.Rocks/Config/IDbConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,6 @@ public interface IDbConfig : IConfig
long? BloomDbMaxBytesPerSec { get; set; }
IDictionary<string, string>? BloomDbAdditionalRocksDbOptions { get; set; }

ulong CanonicalHashTrieDbWriteBufferSize { get; set; }
uint CanonicalHashTrieDbWriteBufferNumber { get; set; }
ulong CanonicalHashTrieDbBlockCacheSize { get; set; }
bool CanonicalHashTrieDbCacheIndexAndFilterBlocks { get; set; }
int? CanonicalHashTrieDbMaxOpenFiles { get; set; }
long? CanonicalHashTrieDbMaxBytesPerSec { get; set; }
int? CanonicalHashTrieDbBlockSize { get; set; }
bool? CanonicalHashTrieUseDirectReads { get; set; }
bool? CanonicalHashTrieUseDirectIoForFlushAndCompactions { get; set; }
ulong? CanonicalHashTrieCompactionReadAhead { get; set; }
IDictionary<string, string>? CanonicalHashTrieDbAdditionalRocksDbOptions { get; set; }

ulong MetadataDbWriteBufferSize { get; set; }
uint MetadataDbWriteBufferNumber { get; set; }
ulong MetadataDbBlockCacheSize { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public class PerTableDbConfigTests
public void CanReadAllConfigForAllTable()
{
DbConfig dbConfig = new DbConfig();
string[] tables = new[]
{
string[] tables =
[
DbNames.Storage,
DbNames.State,
DbNames.Code,
Expand All @@ -23,9 +23,8 @@ public void CanReadAllConfigForAllTable()
DbNames.Receipts,
DbNames.BlockInfos,
DbNames.Bloom,
DbNames.CHT,
DbNames.Metadata,
};
DbNames.Metadata
];

foreach (string table in tables)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ private void AssertStandardDbs(IDbProvider dbProvider, Type dbType, Type receipt
dbProvider.BlockInfosDb.Should().BeOfType(dbType);
dbProvider.BlocksDb.Should().BeOfType(dbType);
dbProvider.BloomDb.Should().BeOfType(dbType);
dbProvider.ChtDb.Should().BeOfType(dbType);
dbProvider.HeadersDb.Should().BeOfType(dbType);
dbProvider.ReceiptsDb.Should().BeOfType(receiptsDb);
dbProvider.CodeDb.Should().BeOfType(dbType);
Expand Down
1 change: 0 additions & 1 deletion src/Nethermind/Nethermind.Db/DbNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public static class DbNames
public const string BlockInfos = "blockInfos";
public const string BadBlocks = "badBlocks";
public const string Bloom = "bloom";
public const string CHT = "canonicalHashTrie";
public const string Metadata = "metadata";
public const string BlobTransactions = "blobTransactions";
}
Expand Down
3 changes: 0 additions & 3 deletions src/Nethermind/Nethermind.Db/IDbProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ public interface IDbProvider : IDisposable
// BloomDB progress / config (does not contain blooms - they are kept in bloom storage)
public IDb BloomDb => GetDb<IDb>(DbNames.Bloom);

// LES (ignore)
public IDb ChtDb => GetDb<IDb>(DbNames.CHT);

public IDb MetadataDb => GetDb<IDb>(DbNames.Metadata);

public IColumnsDb<BlobTxsColumns> BlobTransactionsDb => GetColumnDb<BlobTxsColumns>(DbNames.BlobTransactions);
Expand Down
1 change: 0 additions & 1 deletion src/Nethermind/Nethermind.Db/StandardDbInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ DbFactory is not MemDbFactory

RegisterDb(BuildDbSettings(DbNames.Code));
RegisterDb(BuildDbSettings(DbNames.Bloom));
RegisterDb(BuildDbSettings(DbNames.CHT));
if (useReceiptsDb)
{
RegisterColumnsDb<ReceiptsColumns>(BuildDbSettings(DbNames.Receipts));
Expand Down
8 changes: 1 addition & 7 deletions src/Nethermind/Nethermind.Init/Steps/InitializeNetwork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@
using Nethermind.Stats.Model;
using Nethermind.Synchronization;
using Nethermind.Synchronization.Blocks;
using Nethermind.Synchronization.LesSync;
using Nethermind.Synchronization.ParallelSync;
using Nethermind.Synchronization.Peers;
using Nethermind.Synchronization.Reporting;
using Nethermind.Synchronization.SnapSync;
using Nethermind.Synchronization.Trie;
using Nethermind.TxPool;
Expand Down Expand Up @@ -102,8 +100,6 @@ private async Task Initialize(CancellationToken cancellationToken)
NetworkDiagTracer.Start(_api.LogManager);
}

CanonicalHashTrie cht = new CanonicalHashTrie(_api.DbProvider!.ChtDb);

_api.BetterPeerStrategy = new TotalDifficultyBetterPeerStrategy(_api.LogManager);

int maxPeersCount = _networkConfig.ActivePeersMaxCount;
Expand Down Expand Up @@ -181,10 +177,8 @@ private async Task Initialize(CancellationToken cancellationToken)
_api.Config<ISyncConfig>(),
_api.GossipPolicy,
_api.SpecProvider!,
_api.LogManager,
cht);
_api.LogManager);

_ = syncServer.BuildCHT();
_api.DisposeStack.Push(syncServer);

InitDiscovery();
Expand Down
4 changes: 0 additions & 4 deletions src/Nethermind/Nethermind.Network.Contract/P2P/Protocol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ public static class Protocol
/// </summary>
public const string Bzz = "bzz";
/// <summary>
/// Lightweight Clients
/// </summary>
public const string Les = "les";
/// <summary>
/// Parity Warp Sync
/// </summary>
public const string Par = "par";
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading