-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[US$ 1500 bounty] Big TX history causing crash & freezes #6625
Comments
How many addresses and transactions are there in your wallet?
|
Electrum BTC:
Electrum LTC:
The BTC one is a few months old wallet. The issues started after a few days or a week already, so the values would've been much lower back then. |
@kennedyiowa: A few questions:
Is electrum attempting to update an old wallet? What's the output of I haven't been able to synthesise a large enough testnet wallet to reproduce your bug, however, based on a similar experience with an in-house asset editor that made extensive use of json, I am attempting the following (which may be dumb but, without relevant detailed profiling data, it's the only experiment I can think of):
|
Don't try to blindly fix it; it would be a waste of time. You need to be able to reproduce first.
I can confirm this. It's easily reproducible with very large wallets.
Not sure what changed between 3.3.8 and 4.0.x that could cause this. |
Would be great to have a very large public wallet that can be used to test?
Like a leaked xpub.
…On Tue., Nov. 10, 2020, 13:45 ghost43, ***@***.***> wrote:
Don't try to blindly fix it; it would be a waste of time. You need to be
able to reproduce first.
Electrum runs fine for a minute, freezes completely for 10-20 seconds,
then works fine again
I can confirm this. It's easily reproducible with very large wallets.
Starting with Electrum 4 (I tried 4.0.3), Electrum won't even open
anymore, the process is running but nothing happens
Not sure what changed between 3.3.8 and 4.0.x that could cause this.
I can still open my very large wallets fine.
@kennedyiowa <https://github.com/kennedyiowa> how are you running
Electrum? From source or from official binaries? If binaries, which one?
Which OS?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#6625 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC643CKO5R2FYPI6LPEJHLSPGC33ANCNFSM4SAOIOFQ>
.
|
@SomberNight Does the daemon log indicate when the freeze occurs? Is #6697 the fix for that? |
The largest wallet I can publicly share is one I have created, for testnet. Here is the xpub:
Note that multiple things can contribute to freezes at very large wallet size. Many ~trivial operations become resource hogs after a certain threshold. For example, it helps to disable all fiat-related options.
That's certainly somewhat related to large wallets, although it has nothing to do with freezes. The freezes are mainly to do with GUI refreshes. |
Apologies for the late reply, I haven't checked this issue daily recently. @SomberNight Windows 10, downloaded from the official website. Using the installer, since I think this one is faster. To my knowledge, portable is affected, too. And yes, definitely, the fiat-related options cause a lot of lag as well. @nochiel Naturally I can only run that command on 3.3.8, the seed version is 18. In any case, I could just recreate the wallet from seed if the conversion is the issue (correct me if I'm mistaken), but that issue is secondary. In any case, the freezes is the most important one :P Also, consider this bounty renewed until end of 2020 for now. Of course, like before, if you think you can tackle this issue and the bounty is expired or need more time, just reply and I can renew it, depending on the situation. |
If you are using the official Windows binaries with such a large wallet, you might be running out of memory. Could you check (using e.g. Task Manager) how much RAM gets allocated by the Electrum process when using 3.3.8? |
3.3.8 is sitting at 1.5gigs, so we are fine there at least. |
if oneserver is set then the user is making a deliberate choice to use a (potentially less performant and/or privately run) server. as we see in issue spesmilo#6625 these are often cases where the user has a large wallet and therefore may need a longer timeout for processing requests. The user should not have to care about whether auto_connect is set in order to get a longer timeout
@kennedyiowa please give my PR above a spin, it may fix at least this issue:
|
Thanks a lot for contributing. Sadly the wallet does not even load on Electrum 4.0 for me and I don't really have the time to backport it to 3 and self compile. For other reasons, including security reasons, I also have to wait until this is merged and released officially. I will certainly honor fixing this side issue to a small degree when I can confirm this was the issue. Alternatively, you could try loading SomberNight's testnet wallet, leave it running for a few days straight (usually took around 1-3 days for me, now with my bigger wallet its within 12 hours), try to get it to crash and then verify your fix is working :) |
On Tue, Nov 17, 2020 at 11:31:19AM -0800, kennedyiowa wrote:
> @kennedyiowa please give my PR above a spin, it may fix at least this issue:
I will certainly honor fixing this side issue to a small degree when I
can confirm this was the issue. Alternatively, you could try loading
SomberNight's testnet wallet, leave it running for a few days straight,
try to get it to crash and then verify your fix is working :)
SomberNight's testnet wallet loads and syncs up just fine for me using
the above PR (electrum 4.0.4) in a Linux VM using public servers. I have
4GB RAM allocated to the VM but it is only using about 1.3 GB.
I don't have a private testnet server available for testing other
scenarios.
It does continually have to re-connect and re-sync, but (thanks to the
randomization logic added in the PR?) all the transactions in the wallet
load fairly early on and it should be quite usable.
I will leave it running for a while and see if it crashes.
|
Would it make sense to have a parameter ex. 'monitorlast 10000' that only
check last 10000 used addresses and the gap limit.
…On Thu., Nov. 19, 2020, 08:15 ln2max, ***@***.***> wrote:
On Tue, Nov 17, 2020 at 11:31:19AM -0800, kennedyiowa wrote:
>> @kennedyiowa please give my PR above a spin, it may fix at least this
issue:
>I will certainly honor fixing this side issue to a small degree when I
>can confirm this was the issue. Alternatively, you could try loading
>SomberNight's testnet wallet, leave it running for a few days straight,
>try to get it to crash and then verify your fix is working :)
SomberNight's testnet wallet loads and syncs up just fine for me using
the above PR (electrum 4.0.4) in a Linux VM using public servers. I have
4GB RAM allocated to the VM but it is only using about 1.3 GB.
I don't have a private testnet server available for testing other
scenarios.
It does continually have to re-connect and re-sync, but (thanks to the
randomization logic added in the PR?) all the transactions in the wallet
load fairly early on and it should be quite usable.
I will leave it running for a while and see if it crashes.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#6625 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC643EZTDRI5YY7MISJ7FTSQUK6DANCNFSM4SAOIOFQ>
.
|
On Thu, Nov 19, 2020 at 05:28:30AM -0800, Transisto wrote:
Would it make sense to have a parameter ex. 'monitorlast 10000' that only check last 10000 used addresses and the gap limit.
That has been proposed elsewhere in other issues (see the discussions referenced in my PR).
|
On Tue, Nov 17, 2020 at 11:31:19AM -0800, kennedyiowa wrote:
I will certainly honor fixing this side issue to a small degree when I can confirm this was the issue. Alternatively, you could try loading SomberNight's testnet wallet, leave it running for a few days straight, try to get it to crash and then verify your fix is working :)
So far the wallet has not crashed. A bit before 21:14 UTC (running since
my last post) the sync stopped at 56/10536 addresses. The UI was still
responsive, however. I'm re-running the test with electrum in verbose
mode to see what the actual issue is.
|
Ok, it looks like after many many hours of running, electrum stops refreshing balances at between 50 and 80 addresses into the 10000 or so of the full @SomberNight wallet. I've got the full verbose console output logged to the attached verbose.log file, the last sync attempt ends at about line 24884 in the file. I don't see anything in the log which would indicate what the problem is. Overall the user experience is quite alright, even after the sync stops, Electrum is still responsive and restarting it fixes the issue. @kennedyiowa since the UX with SomberNight's testnet wallet is fine, it may be worth exporting the xpub (for testing) from your wallet and importing it into Electrum 4 that way -- rather than the wallet itself, Electrum may be choking on importing your wallet. You may find that the only real bug is having to restart the wallet every day, which is an annoyance but not a showstopper. |
Good idea. Just did that on 4.0.5, and apparently the issue wasn't the wallet. 4.x doesn't open at all even in a clean state. Wiped the Electrum appdata folder, started Electrum and it just hangs in the background forever like I mentioned in the original issue. Even reinstalled Windows since I opened this issue. Pretty weird since I don't see any other issues like this on here. Restarting Electrum every day one or two times is only a small annoyance compared to the freezes. I work with the wallet a lot and need to check transactions. Usually within 60 seconds it will become fully unresponsive for about 10-20 seconds. Then works for another 60 seconds until it repeats. This is costing me more brain cells than the bounty is worth. @ln2max This freeze issue is not occuring at all on your system? Are you using Windows? Maybe version 4 did fix the freezes, but I wouldn't assume so, otherwise SomberNight wouldn't have confirmed it. Or your changes fixed it, but I really don't see that this was the cause of the freezes. |
On Sat, Nov 21, 2020 at 08:18:50PM -0800, kennedyiowa wrote:
Good idea. Just did that on 4.0.5, and apparently the issue wasn't the wallet. 4.x doesn't open at all even in a clean state. Wiped the Electrum appdata folder, started Electrum and it just hangs in the background forever like I mentioned in the original issue. Even reinstalled Windows since I opened this issue. Pretty weird since I don't see any other issue like this.
Sounds like you found the problem :)
Restarting Electrum every day one or two times is only a small annoyance compared to the freezes. I work with the wallet a lot and need to check transactions. Usually within 60 seconds it will become fully unresponsive for about 10-20 seconds. Then works for another 60 seconds until it repeats. This is costing me more brain cells than the bounty is worth.
Well, using the SomberNight wallet on Linux I experienced nothing like that "works for 60 seconds, unresponsive for 10-20 seconds" behavior after my fixes. I did notice that behavior in earlier testing, but that could have been on Electrum 3.8 -- I didn't keep notes.
@ln2max This freeze issue is not occuring at all on your system? Are you using Windows? Maybe version 4 did fix the freezes, but I wouldn't assume so, otherwise SomberNight wouldn't have confirmed it. Or your changes fixed it, but I really don't see that this was the cause of the freezes.
I'm using a Linux (Debian 10) virtual machine for my tests, not Windows. I use a virtual machine for security reasons (it provides isolation when testing unreviewed and untrusted code). I don't have a Windows machine to test this with.
You might consider doing the same thing on your end -- installing Linux as a virtual machine (e.g using Virtualbox) and try running Electrum on that.
You can get Virtualbox here:
https://www.virtualbox.org/
There are also pre-packaged ready-to-go Linux images for Virtualbox available... these should not be trusted for serious work, but for testing they should do the job. (I have not tested any of these images, my VMs are built in a different way)
Debian 10 is the flavor of Linux I have been using:
https://www.linuxvmimages.com/images/debian-10/
If you are unfamiliar with Linux then you may find Ubuntu or Linux Mint easier to get started with:
https://www.linuxvmimages.com/images/ubuntu-2004/
https://www.linuxvmimages.com/images/linuxmint-20/
If switching to Linux fixes it, it's probably worth buying a cheap Lenovo Thinkpad off ebay (or, depending on your threat model, finding a new laptop that's known to support Linux well), installing Linux on it, and using that as your "Electrum machine"..
|
Uhmm, that's weird. So you are on Windows... could you please try using the setup/installer exe?
Anything interesting in the logs there? |
This comment has been minimized.
This comment has been minimized.
Late again. Its just stuck here (wiped AppData folder, it recreated it):
|
@kennedyiowa looks like it does not even get to the very early steps of initialising the GUI... Line 569 in 78513af
electrum/electrum/gui/qt/__init__.py Lines 89 to 95 in 78513af
but that's not all... the event loop thread (e.g. network) is not making progress either. |
Could you please try running with
|
It changes to this:
|
Hi all, i'm having this issue on windows 10 with electrum ltc, have had the issue through numerous updates and am currently on 4.0.9.3 and the issue is still present. What an earlier poster said regarding how it freezes for 10-20 seconds then comes back to life is accurate..but eventually it doesnt come back to life at all and i'm forced to restart the software..i have tried using every version (portable, installer, exe, ect) and every single one freezes. My wallet has about 6000 transactions in it. |
@amuna1225 Presumably the reason it does not happen for you with the dash fork is that your wallet there does not have a long history. There are multiple causes of freezes with large wallets but the primary problem is that upon almost every update the whole list is recreated and redrawn. It is not just the History tab, but also the Addresses and Coins tabs. (Although only the currently visible tab is refreshed on updates, the others are only refreshed on demand when switching to them) EDIT: To be clear, a viable workaround is to simply create a new wallet/seed and send all your coins there. |
With big wallets containing a lot of transactions, Electrum will become unbearably slow, lag, freeze and eventually crash. #2540 is possibly related. My wallet size is 50MB by now, but it started way earlier, probably 10MB.
Version 3.3.8 is the last Electrum version where I can still open my wallet. Starting with Electrum 4 (I tried 4.0.3), Electrum won't even open anymore, the process is running but nothing happens. The experience below is from 3.3.8 (but earlier versions were affected, too):
Doing some work with the API, def update_wallet(self): is running very very slow as well.
Electrum runs fine for a minute, freezes completely for 10-20 seconds, then works fine again. After running Electrum for about 1 day in the background, eventually it will synchronize endlessly (it finishes, then starts to synchronize again immediately), resulting in a crash after doing that for a certain amount of time.
If I had to take a guess, the lags and freezes probably result from Electrum loading and showing all transactions at once. It is possible that having these loaded and drawn as needed could fix the issue.
Electrum-LTC has the same issue.
The only active command I have:
wallet.change_gap_limit(1000)
My PC is fast and uses an NVME M.2 SSD.
Since this kind of load would only burden public servers, I'm using my own Electrumx server and node.
While these are bugs and if sufficiently documented, you could probably fix it; the bounty is primarily here because its an edge case and so I don't have to bother with handing you over a wallet that reproduces this. Maybe you can generate a big wallet via Testnet or import a lot of addresses.
The bounty will be valid for 2 months from now. The goal is to fix the freezes and that Electrum 4 cannot even open the wallet. If you think you can tackle this issue and the 2 months are over or need more time, just reply and I can renew it, depending on the situation.
If you are unsure whether this bounty is legitimate or not, just reply below posting status updates to this issue and additionally shortly before its ready to be PR'd. I can make the transaction before your work is delivered. US$ 1500 in XMR or BTC.
The text was updated successfully, but these errors were encountered: