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

Flatdb/storage #43

Open
wants to merge 127 commits into
base: feature/state_db_layout_by_path
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
5b324ae
use path marker instead
tanishqjasoria Apr 9, 2023
e4f7c64
add storage prefix
tanishqjasoria Apr 6, 2023
92efa05
fix get patricia tree
tanishqjasoria Apr 9, 2023
624e272
update storage by path
tanishqjasoria Apr 10, 2023
a0a9778
enable more tests
tanishqjasoria Apr 10, 2023
60e411e
clean logs
tanishqjasoria Apr 10, 2023
6fcc8e5
update sync tests
tanishqjasoria Apr 10, 2023
5d82e80
remove logs
tanishqjasoria Apr 11, 2023
7d69089
add option to track absolute path while using TrieVisitor
tanishqjasoria Apr 12, 2023
cbbfcf3
remove unnecessary function
tanishqjasoria Apr 12, 2023
f3c94e5
refac
tanishqjasoria Apr 12, 2023
302ab3b
Add stogare prefix to search from node from cache
tanishqjasoria Apr 12, 2023
c217a71
Add another byte from differentiating between storage root and accoun…
tanishqjasoria Apr 12, 2023
d407521
update tests
tanishqjasoria Apr 12, 2023
2e566f1
update storage tree
tanishqjasoria Apr 12, 2023
d0d761f
fix storage by path
tanishqjasoria Apr 12, 2023
6f029d8
fix storage
tanishqjasoria Apr 12, 2023
f78a677
fix synchronization
tanishqjasoria Apr 12, 2023
e30c177
update is fully synced
tanishqjasoria Apr 12, 2023
ad04221
add other things to string
tanishqjasoria Apr 13, 2023
493ca9f
add log
tanishqjasoria Apr 13, 2023
e1472c1
update sync tests
tanishqjasoria Apr 13, 2023
bd9b009
clone context for storage trees
tanishqjasoria Apr 13, 2023
09d3fc9
fix tree sync
tanishqjasoria Apr 13, 2023
c5bc9ad
fix snap
tanishqjasoria Apr 14, 2023
25f70cd
remove logs
tanishqjasoria Apr 14, 2023
cff5ffb
update tests
tanishqjasoria Apr 14, 2023
df4cdba
add temp change for testing
tanishqjasoria Apr 14, 2023
30d27c2
fix
tanishqjasoria Apr 14, 2023
b8645f7
update
tanishqjasoria Apr 14, 2023
0abdb93
use snap healing
tanishqjasoria Apr 15, 2023
5139947
add var
tanishqjasoria Apr 16, 2023
ddd498f
update
tanishqjasoria Apr 16, 2023
27579c8
udpate
tanishqjasoria Apr 16, 2023
e73e689
update
tanishqjasoria Apr 16, 2023
6bc65d8
fix
tanishqjasoria Apr 17, 2023
03c874e
Add both resolver tests
tanishqjasoria Apr 17, 2023
531a64b
all sync tests running fine
tanishqjasoria Apr 17, 2023
520dbb6
add blocking trie verification
tanishqjasoria Apr 17, 2023
c1fb926
update tests
tanishqjasoria Apr 17, 2023
089a4cc
update tests
tanishqjasoria Apr 17, 2023
daf3495
update init blockchain
tanishqjasoria Apr 17, 2023
1e28971
remove pruning
tanishqjasoria Apr 17, 2023
e8d55b5
fix storage root resolve
tanishqjasoria Apr 17, 2023
dac0cce
update
tanishqjasoria Apr 17, 2023
5fcdc13
try somthing
tanishqjasoria Apr 17, 2023
d4b35b9
update
tanishqjasoria Apr 17, 2023
2337196
get log for testing
tanishqjasoria Apr 18, 2023
ec05628
update
tanishqjasoria Apr 18, 2023
faadf82
update to test
tanishqjasoria Apr 18, 2023
929d764
update
tanishqjasoria Apr 18, 2023
3ddcf12
update
tanishqjasoria Apr 18, 2023
40dc20b
update
tanishqjasoria Apr 18, 2023
00cbd4f
update
tanishqjasoria Apr 18, 2023
f6851c6
fix
tanishqjasoria Apr 18, 2023
9d011e7
update
tanishqjasoria Apr 18, 2023
ffc3e06
update state reader tests
tanishqjasoria Apr 18, 2023
107af61
fix state reader
tanishqjasoria Apr 19, 2023
b0b92c8
Remove logs
tanishqjasoria Apr 19, 2023
52c560b
update state tests
tanishqjasoria Apr 19, 2023
c176249
fix the trie
tanishqjasoria Apr 19, 2023
9745720
fix errors
tanishqjasoria Apr 19, 2023
36445dd
update trie
tanishqjasoria Apr 20, 2023
008c27c
update using interlock
tanishqjasoria Apr 20, 2023
55811fd
return null if trie node is null
tanishqjasoria Apr 20, 2023
d49bd3f
test
tanishqjasoria Apr 21, 2023
4726328
get interesting logs
tanishqjasoria Apr 21, 2023
dbd7f58
more test logs
tanishqjasoria Apr 21, 2023
383cf51
update
tanishqjasoria Apr 21, 2023
7e85945
remove logs
tanishqjasoria Apr 21, 2023
684ec19
make them resolve the key
tanishqjasoria Apr 21, 2023
65b39b1
fix logs
tanishqjasoria Apr 21, 2023
23000e7
update
tanishqjasoria Apr 21, 2023
f345b24
quick fixes
tanishqjasoria Apr 23, 2023
31977d9
resolve
tanishqjasoria Apr 23, 2023
71a4e9c
fix trie by path
tanishqjasoria Apr 23, 2023
7a8bc3f
remove logs fro testing
tanishqjasoria Apr 23, 2023
6d0960f
update tetst
tanishqjasoria Apr 23, 2023
53875b0
update
tanishqjasoria Apr 23, 2023
4dd11cb
update sync tests
tanishqjasoria Apr 23, 2023
630c75a
update tests temp
tanishqjasoria Apr 23, 2023
9279b3c
fix
tanishqjasoria Apr 23, 2023
866dee3
try a fix
tanishqjasoria Apr 25, 2023
a3c32e1
remove changes
tanishqjasoria Apr 25, 2023
326ba49
persist untill block log
tanishqjasoria Apr 25, 2023
3e3880a
update to fix snap
tanishqjasoria Apr 25, 2023
ed8fb0c
update in root too
tanishqjasoria Apr 25, 2023
c03aaf7
update get child
tanishqjasoria Apr 25, 2023
0bd547a
update clean trie stats
tanishqjasoria Apr 25, 2023
4916afd
clean up
tanishqjasoria Apr 25, 2023
53b59cd
check
tanishqjasoria Apr 25, 2023
5df3451
update ranges tetst
tanishqjasoria Apr 26, 2023
c3a1916
update
tanishqjasoria Apr 26, 2023
434fe13
more info on block processing
tanishqjasoria Apr 26, 2023
3be3662
starting block
tanishqjasoria Apr 26, 2023
13d38d0
Add more logs
tanishqjasoria Apr 26, 2023
7b15135
add sepolia config
tanishqjasoria Apr 26, 2023
af395f1
another fix
tanishqjasoria Apr 26, 2023
319fa34
Add more logs
tanishqjasoria Apr 26, 2023
30185ae
log nodes properly
tanishqjasoria Apr 26, 2023
97d9a11
add more things
tanishqjasoria Apr 26, 2023
7f2bffe
update
tanishqjasoria Apr 26, 2023
6177e33
update
tanishqjasoria Apr 26, 2023
f798050
check and verify nodes
tanishqjasoria Apr 26, 2023
ab025b0
ensure coherence
tanishqjasoria Apr 26, 2023
a75ffba
update
tanishqjasoria Apr 26, 2023
3d819e3
update
tanishqjasoria Apr 26, 2023
ee8e5e5
add new storage encoding scheme
tanishqjasoria Apr 26, 2023
83f5759
update test
tanishqjasoria Apr 26, 2023
a5c16bf
minor refac
tanishqjasoria Apr 26, 2023
959388f
add new encoding scheme and does resolve nodes everywhere
tanishqjasoria Apr 26, 2023
bad69cd
fix calc
tanishqjasoria Apr 26, 2023
b1a9f4d
fix encoding
tanishqjasoria Apr 27, 2023
ad96c00
add more tests?
tanishqjasoria Apr 27, 2023
e549004
update deletion
tanishqjasoria Apr 28, 2023
e2c7bdc
fix storage root resolution
tanishqjasoria May 1, 2023
c0b0387
fix proof boundry node
tanishqjasoria May 1, 2023
e453a31
Revert back to recursion to fetch value
tanishqjasoria May 1, 2023
e21d0c6
remove pruning
tanishqjasoria May 1, 2023
2a024c8
check for boundry node
tanishqjasoria May 1, 2023
7eeb9e6
cleanup
tanishqjasoria May 2, 2023
d46bfab
cleanup tree and trie node
tanishqjasoria May 2, 2023
a962454
cleanup triestore by path
tanishqjasoria May 2, 2023
1b4faf2
patricia cleanup
tanishqjasoria May 2, 2023
b43bab7
more
tanishqjasoria May 2, 2023
210f532
Fix for CloneWithChangedKeyAndValue
damian-orzechowski May 2, 2023
3fae309
Saving leaf node pointer fix.
damian-orzechowski May 3, 2023
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
7 changes: 6 additions & 1 deletion src/Nethermind/Chains/sepolia.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@
"enode://7c9740e4d64674801fe62b76798d46778a038c49caebb15843d8c0f2b2f80d7ceba2585b4be366e6161988f81ddcfcd6fca98b5da52ae9a6f22c1b2a84b24a04@18.130.169.73:30303",
"enode://0d5f5a5119236fa5f9e1c138e9658775e791cf3a30c461e0316d01dc910405cc375e0a6d18042b34d3c409238ecffb7fdcfa1513b0921b89b702f474a1d7425c@34.135.219.85:30303",
"enode://9246d00bc8fd1742e5ad2428b80fc4dc45d786283e05ef6edbd9002cbc335d40998444732fbe921cb88e1d2c73d1b1de53bae6a2237996e9bfe14f871baf7066@18.168.182.86:30303",
"enode://ec66ddcf1a974950bd4c782789a7e04f8aa7110a72569b6e65fcd51e937e74eed303b1ea734e4d19cfaec9fbff9b6ee65bf31dcb50ba79acce9dd63a6aca61c7@52.14.151.177:30303"
"enode://ec66ddcf1a974950bd4c782789a7e04f8aa7110a72569b6e65fcd51e937e74eed303b1ea734e4d19cfaec9fbff9b6ee65bf31dcb50ba79acce9dd63a6aca61c7@52.14.151.177:30303",
"enode://4e5e92199ee224a01932a377160aa432f31d0b351f84ab413a8e0a42f4f36476f8fb1cbe914af0d9aef0d51665c214cf653c651c4bbd9d5550a934f241f1682b@138.197.51.181:30303",
"enode://143e11fb766781d22d92a2e33f8f104cddae4411a122295ed1fdb6638de96a6ce65f5b7c964ba3763bba27961738fef7d3ecc739268f3e5e771fb4c87b6234ba@146.190.1.103:30303",
"enode://8b61dc2d06c3f96fddcbebb0efb29d60d3598650275dc469c22229d3e5620369b0d3dedafd929835fe7f489618f19f456fe7c0df572bf2d914a9f4e006f783a9@170.64.250.88:30303",
"enode://10d62eff032205fcef19497f35ca8477bea0eadfff6d769a147e895d8b2b8f8ae6341630c645c30f5df6e67547c03494ced3d9c5764e8622a26587b083b028e8@139.59.49.206:30303",
"enode://9e9492e2e8836114cc75f5b929784f4f46c324ad01daf87d956f98b3b6c5fcba95524d6e5cf9861dc96a2c8a171ea7105bb554a197455058de185fa870970c7c@138.68.123.152:30303"
],
"accounts": {
"0xa2A6d93439144FFE4D27c9E088dCD8b783946263": {"balance": "0xD3C21BCECCEDA1000000"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ protected override IBlockProducer CreateTestBlockProducer(TxPoolTxSource txPoolT
DbProvider,
BlockTree,
ReadOnlyTrieStore,
ReadOnlyStorageTrieStore,
SpecProvider,
BlockValidator,
NoBlockRewards.Instance,
Expand Down Expand Up @@ -215,7 +214,7 @@ protected override BlockProcessor CreateBlockProcessor()
UserOperationSimulator[entryPoint] = new(
UserOperationTxBuilder[entryPoint],
ReadOnlyState,
new ReadOnlyTxProcessingEnvFactory(DbProvider, ReadOnlyTrieStore, ReadOnlyStorageTrieStore, BlockTree, SpecProvider, LogManager),
new ReadOnlyTxProcessingEnvFactory(DbProvider, ReadOnlyTrieStore, BlockTree, SpecProvider, LogManager),
EntryPointContractAbi,
entryPoint!,
WhitelistedPayamsters,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ private UserOperationSimulator UserOperationSimulator(Address entryPoint)
ReadOnlyTxProcessingEnvFactory readOnlyTxProcessingEnvFactory = new(
getFromApi.DbProvider,
getFromApi.ReadOnlyTrieStore,
getFromApi.ReadOnlyStorageTrieStore,
getFromApi.BlockTree,
getFromApi.SpecProvider,
getFromApi.LogManager);
Expand Down
1 change: 0 additions & 1 deletion src/Nethermind/Nethermind.Api/IApiWithBlockchain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public interface IApiWithBlockchain : IApiWithStores, IBlockchainBridgeFactory
IHeaderValidator? HeaderValidator { get; set; }
IManualBlockProductionTrigger ManualBlockProductionTrigger { get; }
IReadOnlyTrieStore? ReadOnlyTrieStore { get; set; }
IReadOnlyTrieStore? ReadOnlyStorageTrieStore { get; set; }
IRewardCalculatorSource? RewardCalculatorSource { get; set; }
/// <summary>
/// PoS switcher for The Merge
Expand Down
4 changes: 3 additions & 1 deletion src/Nethermind/Nethermind.Api/IInitConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ public enum DiagnosticMode
[ConfigItem(Description = "Just scan and sum supply on all accounts")]
VerifySupply,
[ConfigItem(Description = "Verifies if full state is stored")]
VerifyTrie
VerifyTrie,
[ConfigItem(Description = "Verifies if full state is stored and stop processing")]
VerifyTrieBlocking
}
}
2 changes: 0 additions & 2 deletions src/Nethermind/Nethermind.Api/NethermindApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public IBlockchainBridge CreateBlockchainBridge()
ReadOnlyTxProcessingEnv readOnlyTxProcessingEnv = new(
_readOnlyDbProvider,
ReadOnlyTrieStore,
ReadOnlyStorageTrieStore,
readOnlyTree,
SpecProvider,
LogManager);
Expand Down Expand Up @@ -197,7 +196,6 @@ public ISealEngine SealEngine
public ITransactionProcessor? TransactionProcessor { get; set; }
public ITrieStore? TrieStore { get; set; }
public IReadOnlyTrieStore? ReadOnlyTrieStore { get; set; }
public IReadOnlyTrieStore? ReadOnlyStorageTrieStore { get; set; }
public ITxSender? TxSender { get; set; }
public INonceManager? NonceManager { get; set; }
public ITxPool? TxPool { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ protected override BlockProcessor CreateBlockProcessor()
new ReadOnlyTxProcessingEnv(
DbProvider,
new TrieStoreByPath(DbProvider.StateDb, LimboLogs.Instance).AsReadOnly(),
new TrieStore(DbProvider.StateDb, LimboLogs.Instance).AsReadOnly(),
BlockTree, SpecProvider, LimboLogs.Instance));

GasLimitOverrideCache = new AuRaContractGasLimitOverride.Cache();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ protected override TxPoolTxSource CreateTxPoolTxSource()
TxPoolTxSource txPoolTxSource = base.CreateTxPoolTxSource();

TxPriorityContract = new TxPriorityContract(AbiEncoder.Instance, TestItem.AddressA,
new ReadOnlyTxProcessingEnv(DbProvider, TrieStore.AsReadOnly(), ReadOnlyStorageTrieStore, BlockTree, SpecProvider, LimboLogs.Instance));
new ReadOnlyTxProcessingEnv(DbProvider, TrieStore.AsReadOnly(), BlockTree, SpecProvider, LimboLogs.Instance));

Priorities = new DictionaryContractDataStore<TxPriorityContract.Destination>(
new TxPriorityContract.DestinationSortedListContractDataStoreCollection(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ protected override BlockProcessor CreateBlockProcessor()
ReadOnlyTransactionProcessorSource = new ReadOnlyTxProcessingEnv(
DbProvider,
new TrieStoreByPath(DbProvider.StateDb, LimboLogs.Instance).AsReadOnly(),
new TrieStore(DbProvider.StateDb, LimboLogs.Instance).AsReadOnly(),
BlockTree, SpecProvider,
LimboLogs.Instance);
RegisterContract = new RegisterContract(abiEncoder, ChainSpec.Parameters.Registrar, ReadOnlyTransactionProcessorSource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,12 @@ protected override BlockProcessor CreateBlockProcessor()
IReadOnlyTxProcessorSource txProcessorSource = new ReadOnlyTxProcessingEnv(
DbProvider,
trieStore,
storageTrieStore,
BlockTree,
SpecProvider,
LimboLogs.Instance);

VersionedTransactionPermissionContract transactionPermissionContract = new(AbiEncoder.Instance, _contractAddress, 1,
new ReadOnlyTxProcessingEnv(DbProvider, trieStore, storageTrieStore, BlockTree, SpecProvider, LimboLogs.Instance), TransactionPermissionContractVersions, LimboLogs.Instance, SpecProvider);
new ReadOnlyTxProcessingEnv(DbProvider, trieStore, BlockTree, SpecProvider, LimboLogs.Instance), TransactionPermissionContractVersions, LimboLogs.Instance, SpecProvider);

TxPermissionFilterCache = new PermissionBasedTxFilter.Cache();
PermissionBasedTxFilter = new PermissionBasedTxFilter(transactionPermissionContract, TxPermissionFilterCache, LimboLogs.Instance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void Prepared_block_contains_author_field()
{
IDb stateDb = new MemDb();
IDb codeDb = new MemDb();
TrieStore trieStore = new(stateDb, LimboLogs.Instance);
TrieStoreByPath trieStore = new(stateDb, LimboLogs.Instance);
IStateProvider stateProvider = new StateProvider(trieStore, codeDb, LimboLogs.Instance);
ITransactionProcessor transactionProcessor = Substitute.For<ITransactionProcessor>();
BlockProcessor processor = new(
Expand Down Expand Up @@ -70,7 +70,7 @@ public void Can_store_a_witness()
{
IDb stateDb = new MemDb();
IDb codeDb = new MemDb();
var trieStore = new TrieStore(stateDb, LimboLogs.Instance);
TrieStoreByPath trieStore = new TrieStoreByPath(stateDb, LimboLogs.Instance);

IStateProvider stateProvider = new StateProvider(trieStore, codeDb, LimboLogs.Instance);
ITransactionProcessor transactionProcessor = Substitute.For<ITransactionProcessor>();
Expand Down Expand Up @@ -102,7 +102,7 @@ public void Recovers_state_on_cancel()
{
IDb stateDb = new MemDb();
IDb codeDb = new MemDb();
TrieStore trieStore = new(stateDb, LimboLogs.Instance);
TrieStoreByPath trieStore = new(stateDb, LimboLogs.Instance);
IStateProvider stateProvider = new StateProvider(trieStore, codeDb, LimboLogs.Instance);
ITransactionProcessor transactionProcessor = Substitute.For<ITransactionProcessor>();
BlockProcessor processor = new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Nethermind.Core;
using Nethermind.Core.Attributes;
using Nethermind.Core.Crypto;
using Nethermind.Core.Test;
using Nethermind.Core.Test.Blockchain;
using Nethermind.Specs;
using Nethermind.Core.Test.Builders;
Expand All @@ -32,9 +33,10 @@ namespace Nethermind.Blockchain.Test
[Parallelizable(ParallelScope.Self)]
public class BlockchainProcessorTests
{
private static readonly ILogManager _logManager = new NUnitLogManager(LogLevel.Trace);
private class ProcessingTestContext
{
private ILogManager _logManager = LimboLogs.Instance;
private ILogManager _logManager = BlockchainProcessorTests._logManager;

private class BlockProcessorMock : IBlockProcessor
{
Expand Down Expand Up @@ -191,7 +193,7 @@ public void RecoverData(Block block)
private ILogger _logger;
private Keccak _headBefore;
private int _processingQueueEmptyFired;
public const int ProcessingWait = 2000;
public const int ProcessingWait = 3000;

public ProcessingTestContext(bool startProcessor)
{
Expand All @@ -202,10 +204,10 @@ public ProcessingTestContext(bool startProcessor)
MemDb stateDb = new();
IStateReader stateReader = Substitute.For<IStateReader>();

_blockTree = new BlockTree(blockDb, headersDb, blockInfoDb, new ChainLevelInfoRepository(blockInfoDb), MainnetSpecProvider.Instance, NullBloomStorage.Instance, LimboLogs.Instance);
_blockTree = new BlockTree(blockDb, headersDb, blockInfoDb, new ChainLevelInfoRepository(blockInfoDb), MainnetSpecProvider.Instance, NullBloomStorage.Instance, _logManager);
_blockProcessor = new BlockProcessorMock(_logManager, stateReader);
_recoveryStep = new RecoveryStepMock(_logManager);
_processor = new BlockchainProcessor(_blockTree, _blockProcessor, _recoveryStep, new StateReader(new TrieStore(stateDb, LimboLogs.Instance), new TrieStore(stateDb, LimboLogs.Instance), new MemDb(), LimboLogs.Instance), LimboLogs.Instance, BlockchainProcessor.Options.Default);
_processor = new BlockchainProcessor(_blockTree, _blockProcessor, _recoveryStep, stateReader, LimboLogs.Instance, BlockchainProcessor.Options.Default);
_resetEvent = new AutoResetEvent(false);
_queueEmptyResetEvent = new AutoResetEvent(false);

Expand Down Expand Up @@ -517,19 +519,29 @@ public void Can_process_fast_sync_transition()
.FullyProcessed(_block4D8).BecomesNewHead();
}

[Test, Timeout(Timeout.MaxTestTime)]
[Test]
public async Task Can_process_fast_sync()
{
var logger = _logManager.GetClassLogger();
BasicTestBlockchain testBlockchain = await BasicTestBlockchain.Create();
await testBlockchain.BuildSomeBlocks(5);

When.ProcessingBlocks
.FullyProcessed(testBlockchain.BlockTree.FindBlock(0)).BecomesGenesis()
.SuggestedWithoutProcessingAndMoveToMain(testBlockchain.BlockTree.FindBlock(1))
.SuggestedWithoutProcessingAndMoveToMain(testBlockchain.BlockTree.FindBlock(2))
.SuggestedWithoutProcessingAndMoveToMain(testBlockchain.BlockTree.FindBlock(3))
.SuggestedWithoutProcessingAndMoveToMain(testBlockchain.BlockTree.FindBlock(4))
.FullyProcessed(testBlockchain.BlockTree.FindBlock(5)).BecomesNewHead();
logger.Info("start test a");
ProcessingTestContext a = When.ProcessingBlocks;
logger.Info("start test b");
ProcessingTestContext b = a.FullyProcessed(testBlockchain.BlockTree.FindBlock(0)).BecomesGenesis();
logger.Info("start test b");
ProcessingTestContext c = b.SuggestedWithoutProcessingAndMoveToMain(testBlockchain.BlockTree.FindBlock(1));
logger.Info("start test c");
ProcessingTestContext d = c.SuggestedWithoutProcessingAndMoveToMain(testBlockchain.BlockTree.FindBlock(2));
logger.Info("start test d");
ProcessingTestContext e = d.SuggestedWithoutProcessingAndMoveToMain(testBlockchain.BlockTree.FindBlock(3));
logger.Info("start test e");
ProcessingTestContext f = e.SuggestedWithoutProcessingAndMoveToMain(testBlockchain.BlockTree.FindBlock(4));
logger.Info("start test f");
ProcessingTestContext.AfterBlock g = f.FullyProcessed(testBlockchain.BlockTree.FindBlock(5));
logger.Info("start test g");
g.BecomesNewHead();
}

[Test, Timeout(Timeout.MaxTestTime)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private static IPruningContext CopyDb(IPruningContext pruningContext, MemDb trie
{
LimboLogs logManager = LimboLogs.Instance;
PatriciaTree trie = Build.A.Trie(trieDb).WithAccountsByIndex(0, 100).TestObject;
IStateReader stateReader = new StateReader(new TrieStore(trieDb, logManager), new TrieStore(trieDb, logManager), new MemDb(), logManager);
IStateReader stateReader = new StateReader(new TrieStoreByPath(trieDb, logManager), new MemDb(), logManager);

using CopyTreeVisitor copyTreeVisitor = new(pruningContext, logManager);
stateReader.RunTreeVisitor(copyTreeVisitor, trie.RootHash);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public TestContext(bool successfulPruning, bool clearPrunedDb = false)

PatriciaTree trie = Build.A.Trie(TrieDb).WithAccountsByIndex(0, 100).TestObject;
_stateRoot = trie.RootHash;
StateReader = new StateReader(new TrieStore(TrieDb, LimboLogs.Instance), new TrieStore(TrieDb, LimboLogs.Instance), new MemDb(), LimboLogs.Instance);
StateReader = new StateReader(new TrieStoreByPath(TrieDb, LimboLogs.Instance), new MemDb(), LimboLogs.Instance);
FullPruningDb = new TestFullPruningDb(new RocksDbSettings("test", "test"), rocksDbFactory, successfulPruning, clearPrunedDb);

Pruner = new(FullPruningDb, PruningTrigger, new PruningConfig(), BlockTree, StateReader, LimboLogs.Instance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private Block GetGenesisBlock(string chainspecPath)
ChainSpec chainSpec = LoadChainSpec(path);
IDb stateDb = new MemDb();
IDb codeDb = new MemDb();
TrieStore trieStore = new(stateDb, LimboLogs.Instance);
TrieStoreByPath trieStore = new(stateDb, LimboLogs.Instance);
IStateProvider stateProvider = new StateProvider(trieStore, codeDb, LimboLogs.Instance);
ISpecProvider specProvider = Substitute.For<ISpecProvider>();
specProvider.GetSpec(Arg.Any<BlockHeader>()).Returns(Berlin.Instance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void Test()
specProvider,
NullBloomStorage.Instance,
LimboLogs.Instance);
TrieStore trieStore = new(
TrieStoreByPath trieStore = new(
dbProvider.RegisteredDbs[DbNames.State],
NoPruning.Instance,
Archive.Instance,
Expand All @@ -57,7 +57,7 @@ public void Test()
trieStore,
dbProvider.RegisteredDbs[DbNames.Code],
LimboLogs.Instance);
StateReader stateReader = new(trieStore, trieStore, dbProvider.GetDb<IDb>(DbNames.State), LimboLogs.Instance);
StateReader stateReader = new(trieStore, dbProvider.GetDb<IDb>(DbNames.State), LimboLogs.Instance);
StorageProvider storageProvider = new(trieStore, stateProvider, LimboLogs.Instance);
BlockhashProvider blockhashProvider = new(blockTree, LimboLogs.Instance);
VirtualMachine virtualMachine = new(
Expand Down
4 changes: 2 additions & 2 deletions src/Nethermind/Nethermind.Blockchain.Test/ReorgTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public class ReorgTests
public void Setup()
{
IDbProvider memDbProvider = TestMemDbProvider.Init();
TrieStore trieStore = new(new MemDb(), LimboLogs.Instance);
TrieStoreByPath trieStore = new(new MemDb(), LimboLogs.Instance);
StateProvider stateProvider = new(trieStore, memDbProvider.CodeDb, LimboLogs.Instance);
StateReader stateReader = new(trieStore, trieStore, memDbProvider.CodeDb, LimboLogs.Instance);
StateReader stateReader = new(trieStore, memDbProvider.CodeDb, LimboLogs.Instance);
StorageProvider storageProvider = new(trieStore, stateProvider, LimboLogs.Instance);
ChainLevelInfoRepository chainLevelInfoRepository = new(memDbProvider);
ISpecProvider specProvider = MainnetSpecProvider.Instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,8 @@ public void Proper_transactions_selected(ProperTransactionsSelectedTestCase test
{
MemDb stateDb = new();
MemDb codeDb = new();
TrieStore trieStore = new(stateDb, LimboLogs.Instance);
TrieStoreByPath trieStore = new(stateDb, LimboLogs.Instance);
StateProvider stateProvider = new(trieStore, codeDb, LimboLogs.Instance);
StateReader stateReader =
new(new TrieStore(stateDb, LimboLogs.Instance), new TrieStore(stateDb, LimboLogs.Instance), codeDb, LimboLogs.Instance);
ISpecProvider specProvider = Substitute.For<ISpecProvider>();

void SetAccountStates(IEnumerable<Address> missingAddresses)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public void Proper_transactions_selected(TransactionSelectorTests.ProperTransact
{
MemDb stateDb = new();
MemDb codeDb = new();
TrieStore trieStore = new(stateDb, LimboLogs.Instance);
TrieStoreByPath trieStore = new(stateDb, LimboLogs.Instance);
StateProvider stateProvider = new(trieStore, codeDb, LimboLogs.Instance);
IStorageProvider storageProvider = Substitute.For<IStorageProvider>();
ISpecProvider specProvider = Substitute.For<ISpecProvider>();
Expand Down
Loading