SynchMempoolTask: Add parallel UTXO precacher for perf. benefit of up to ~30% + BugFix #207
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We add a parallel UTXO precache mechanism to the
SynchMempoolTask
. This mechanism looks UTXOs up in the utxodb as we are busy downloading mempool txns from bitcoind. The benefit is not large for small mempools but on e.g. BTC with ~140k txns in the mempool, the performance benefit is up to ~33% over existing code. This is because we utilize the disk and CPU concurrently with the network while downloading large mempools.Also in this PR:
SynchMempoolTask
into its own compilation unit and header.SynchMempoolTask
would attempt to add the child txns to the mempool but the parent would be missing, thus inputs would be missing, and this would lead to an exception being thrown and the mempool being left in a state where not all its data structures for the new txns would be filled-in, leading to observed behavior of scripthash notifications for the txns in question not being sent to clients.