A custom storage engine of Nethermind, benefiting from the alignment of the underlying data structure with the layout of State & Storage trees of Ethereum.
This PR alters how the Merkle prefetcher works. It's different from the previous one in the following way.
Prefetcher is usable as is, requiring no additional work in Nethermind state.
All prefetches are scheduled separately with ThreadPool.QueueUserWorkItem
The scheduling call doesn't do the mapping of Address ->Keccak nor StorageCell->(Keccak, Keccak). It checks whether to run a frefetch using BitFilter with hash of raw inputs and then scheduled the work item
To allow the check whether something was run or not, a IPrefetcherMapping is introduced that allows to pass an arbitrary parameter (Address, StorageCell) and define the mapping that will be run in the thread pool work item.
Benchmarks
Using PrefetcherTests.Spin scenarios. Accounts + storage means that each account has 4 slots occupied, so at least one branch will be there.
This PR alters how the Merkle
prefetcher
works. It's different from the previous one in the following way.ThreadPool.QueueUserWorkItem
Address
->Keccak
norStorageCell
->(Keccak, Keccak)
. It checks whether to run a frefetch using BitFilter with hash of raw inputs and then scheduled the work itemIPrefetcherMapping
is introduced that allows to pass an arbitrary parameter (Address, StorageCell) and define the mapping that will be run in the thread pool work item.Benchmarks
Using
PrefetcherTests.Spin
scenarios. Accounts + storage means that each account has 4 slots occupied, so at least one branch will be there.