TransactionHistoryBuilder
: Do not update "FirstSeen" and "Labels"
#11605
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.
This is another part of #114581.
The PR itself is trivial but arguing that it's correct is not trivial. So my argument is:
TransactionProcessor
is the main source of truth forSmartTransaction
s (references!)2 as it keepsCoinsRegistry
in an up-to-date state.TransactionProcessor
updatesSmartTransaction
s by the code that was removed fromTransactionHistoryBuilder
(this PR):https://github.com/zkSNACKs/WalletWasabi/blob/e7a5e3c4fd8beb19d172d9d0cba3ab11f9c79f3d/WalletWasabi/Blockchain/TransactionProcessing/TransactionProcessor.cs#L106-L120
TransactionProcessor
is the only class that callsCoinsRegistry.TryAdd(SmartCoin coin)
.TransactionHistoryBuilder
callswallet.GetAllCoins()
which operates only on coins fromCoinsRegistry
.This should deliver some memory savings for big wallets.
Testing
One way to make sure that references are correct is to do:
Maybe it would be useful to add this piece of code to uncover potential bugs.
Measurements
I simply add the following code:
It's not correct way but it gives some estimates at leasts.
master
PR
Footnotes
In that PR,
TransactionWithAmount
was introduced but with this PR,TransactionSummary
has basically becomeTransactionWithAmount
. ↩Because we read all transactions when WW starts and we pass them to
TransactionProcessor
. Similarly for mempool transactions that we receive, etc. ↩