-
Notifications
You must be signed in to change notification settings - Fork 725
[Wallet] Call AutocombineDust less often #497
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
Conversation
Fuzzbawls
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we wait for IBD or do we wait for mnsync?
src/main.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on having this based on masternodeSync.IsSynced() or IsInitialBlockDownload(). It is entirely possible to send a transaction before the mnsync is finished, and I agree that limiting this to one or the other is a net benefit...just want to discuss which would make more sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I was going for IBD at first. But I think it's better to wait to be fully synced (and get your last incoming TXs) to fire up more TX. Else you are going to make more TX than necessary, incurring fees and blocks bloating.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first thing that happens within MultiSend() and AutoCombineDust() is checking whether IsInitialBlockDownload() is true, and if so they will return false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@presstab You are right, I should move it there. But I still think masternodeSync.IsSynced() is superior to IsInitialBlockDownload() in this case.
|
@presstab So like you said, AutoCombineDust and MultiSend were testing the state before beginning. But actually they were testing IBD for the first and the tip of the chain time for the second. While AutoZeromint is checking MN sync. Let's have some consistency. |
|
FYI, "AutoZeromint was checking MN sync" was used because AutoZeromint is/was very CPU intensive, the wallet would sometimes need several minutes to start. Waiting for MN sync needs normally a couple of minutes, so that's a good compromise. |
|
I don't see why Autocombine should be any different from Multisend. It's basically the same process, they just block a bit when used for the first time and a lot of TX are eligible. Autocombine should not be blocking more than Multisend once #496 is fixed. |
|
Both AutoCombine and MultiSend do always create the same number of transactions, no matter when they are called (AutoCombine one for each address (which needs combining), MultiSend for each output which is a reward). But anyway, I'm also fine with waiting for MN sync, even when that sometimes needs a long time to finish. If @Fuzzbawls is fine with it I'll test it. |
|
I am not entirely sure about multisend. But autocombine was not always creating the same number of transactions. If you have several TX they are combined. And when an other blocks shows up, they are combined again and so on. So if you are 144 blocks behind, you can have a TX when getting officialy out of IBD and others when really catching up. I grant you the risk is higher on testnet than mainnet. And actually, this PR should solve the problem altogether by not combining below threshold. So maybe what is currently done for multisend is ok. |
ab7d8c8 to
9309698
Compare
|
for the sake of consistency across all post-synced, transaction-creating automation functions; I can agree to using mnsync. |
|
Okay. |
|
@Mrs-X if you are about to merge I am simply going to squash it. |
Autocombine to the threshold and not above Autocombine now start later ->wait for 5mn old block or younger
9309698 to
6e39d70
Compare
|
I didn't yet test the MultiSend part, I'll report back in an hour or so. |
|
Works as expected, therefore ACK from my side, so you can squash it. I'm still not 100% sold on the way Multisend works, though. |
|
I squashed right away. Nonetheless, I agree with you, multisend should scan all rewards. But the way it's currently working, it sends only when called on the exact block where maturity of a reward is attained: |
|
I agree, we merge this one and have a closer look at the general Multisend approach somewhere in the future. |
6e39d70 [Performance] AutocombineDust is called less often (warrows) Tree-SHA512: d336609341222ac1c0ee6b9ab57ede0785ce941450e55408b1813bc44e15a8c6149eff47055516296fc15051ea7abe51375bb4911275e6093cc1cad67ca2c53b
MultiSend and AutocombineDust are called after each new block is found. This is highly inefficient during initial sync. So this PR propose to wait for blockchain and MN sync to call this functions.
It also avoid AutocombineDust trying to iterate on UTXO > to its threshold.
Lastly it does not Autocombine in cases where the threshold is not reached and fees would be incurred.