-
Notifications
You must be signed in to change notification settings - Fork 109
Conversation
|
If you want to test this PR with me, do something like: First, for avoidance of confusion with running code, make a copy of your whole joinmarket directory somewhere else (or do a new In the new directory, copy your "live" Although it isn't strictly necessary, shut down any running yield-generator while running the test. Then pull the PR: git fetch origin refs/pull/612/head:pull_612 where origin should be replaced with whatever your name is for this repo (origin is the default). A branch is automatically created with name Then do:
Let me know what you find. In my experience, if index_cache is there, and you haven't changed your Core instance, then --fast works, gives the right output and happened in a few seconds I guess. I don't know if it'll always be that fast, hence reports most welcome. |
|
Please test if you get a chance. I've done all kinds of tests myself but can't find a problem, whereas the only other tester so far reports an incorrect balance. |
|
Havent had a chance to test yet but thinking it might be more appropriate to put the option in joinmarket.cfg instead of in the command line of each script. |
|
@chris-belcher i see where you're coming from, the problem is users really should explicitly choose it and then not use it when it isn't appropriate or doesn't work. I thought about it for a while and decided, annoying as it is to put it all over the place, it really must be an explicit choice, otherwise they will get wrong balance reports and will not know why. |
|
@mustyoshi reported problems but it seems it was because the index_cache in his copied directory was not in sync (because yg was still running). When brought into sync this method worked. |
|
tACK |
6210225 add fast sync option for Core wallets (Adam Gibson)
|
@CohibAA thanks, I've merged it now after 3 people reported it working, plus the fact it doesn't alter anything if not used. But, can you let us know if it gave you much speedup? So far I've had one person saying it reduced it down to a minute or two, and another saying it was reduced only from 27 to 16(!) minutes; this actually might not be that strange if the time is dominated by address generation, but I'm sure we can do better than that, even for > 10k addresses as this person had. |
|
@AdamISZ I have approximately 3500 addresses in the wallet I tested, and this gave about 30% improvement on time. I don't have any wallets with higher address count to test/compare though. Standard = 1 minute, 50 seconds Fast mode = 1 minute, 15 seconds |
|
Hi, Run time, was 07:19:24 to 07:22:23 A vast improvement on the couple of hours it otherwise takes. I was a bit puzzled by the 9463 figure given these figures: |
|
@HamishMacEwan the 9463 is how many addresses have actually been used in transactions; the index_cache is the actual indices, so you can see there are vast gaps of unused addresses that were requested to initialize transactions, but never used ("gaps"), caused by the spy bot. @CohibAA yeah for small-ish wallets there generally isn't much difference, I was originally a bit disappointed that some people didn't report big (enough) speed ups but it seems to depend on various factors, because part of the time is taken by simply address generation, and another part is taken by a large number of rpc requests (in the non-fast version). |
Current wallet sync is not smart enough about the situation where a wallet was previously in sync and is now restarting, with index_cache and wallet imports intact.
In practice this was not too important until recently, when spying activity vastly increased the size of used address lists, but it is now a major practical problem.
This adds a
--fastoption to all the scripts that sync the wallet before beginning. Under the hood it uses rpclistaddressgroupingsto get all of the relevant address data in one call.Since it is slightly tricky for the code to automatically recognize whether this faster sync can happen successfully, it was decided to leave it as an option which is turned off by default.
Also important is that an attempt to use
--fastwhich is unsuccessful will simply return an incomplete wallet (not showing all coins), but should not create any safety issue, i.e. you should be able to re-run without--fastand get the correct result.Experiments on regtest and mainnet show it working well, although I only currently have wallets with of the order of a few thousand addresses; I'd like to see the effect for those with 10k+ addresses.
Next comment will explain how easily and safely to test this.