-
Notifications
You must be signed in to change notification settings - Fork 101
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
On Tails (2.12), the electrum-ltc GUI reacts VERY slowly after network connection, but NOT IF the file blockchain_headers is removed before launching #48
Comments
This is the reason for the extreme slowness. Block header verification is much slower for Litecoin than it is for Bitcoin because the hashing algorithm is more complex by almost 3 order of magnitudes. Try installing the |
I see, thank you for replying. Apparently, installing pip on Tails might oblige to install Tails on pendrive with Persistence active, which I do for the cold storage part, but I'd like to keep booting the OS supporting the online watching-only part from DVD, and I'd like to be able to just burn a new Tails DVD when new versions are released, and just plug in the pendrive which completely contains the watching-only part of the wallet, as I usually do with Electrum for BTC. Besides, getting some fundamental part of a wallet from a secondary source is kind of... alarming to me (although it would not touch the cold storage part of the wallet). Are there any chances that Electrum-LTC gets to include ltc_scrypt? Besides, let's consider that some persons (personal friends, users who posted Electrum BTC issues) are already protesting or quitting facing the (not so complicated) usage of Electrum... Any further little piece of familiarity with informatics that it requires does not help the wallet and the coin in getting adopted, I'm afraid. (I do realize that using pip on a not-live and not-amnesic Linux installation would be much easier, but being able to run the wallet on Tails has its advantages.) EDIT: Is there any simple "hack" to have ltc_scrypt available for electrum-ltc, like extracting a tgz and in a script which launches electrum-ltc modifying and exporting some environment variables? Not important: I also gave a brutal try to a generic approach not specific to Tails with no success (and it requires to activate the root user which is potentially a security weakness):
|
I should point out that package |
I see. Of course I don't know the details of the Electrum-LTC package, but that EDIT: Anyway, as the "fallback" word says, I guess the fallback for the absent ltc_scrypt complies and the wallet should work and its GUI get back to responsive after waiting for a while for it to sync with servers, is that correct? I'm going to give a try to the watching only part in a not-live Linux Ubuntu 16.04 LTS. After checking that there are no ready made packages for ltc_scrypt or for electrum-ltc (I'd prefer your website as the source anyway), I tried using pip to install ltc_scrypt:
This Ubuntu install is up to date (I ran the software updater minutes before trying this). I also checked that this pip package version is what the synaptic software installer proposes as the up to date package for this Ubuntu desktop distribution.
Duh, should have used the -H flag again...
Well, going to give a try to the watching only part asap (hopefully later today), will report. |
Yes, the slowdown is only due to block header verification during synchronization. The fallback code is pure Python and is therefore about 100 times slower than its C equivalent. |
Thank you. Tried Electrum-LTC 2.8.3.2 BETA in not-live Ubuntu with ltc_scrypt, ok, it was tending to hang but each time for less than one second. And... good news: using now Electrum-LTC 2.8.3.2 BETA in Tails without ltc_scrypt, it was hanging so I killed the process and after removing the file ~/.electrum-ltc/blockchain_headers it started to work perfectly fluid, super responsive, blue circle confirming I'm through Tor (this was OK in Ubuntu too after installing Tor), and I'm now trying a withdrawal from an exchange... WOOOOW the time to write these lines and it's being confirmed already, and the GUI stays perfectly responsive... First and further confirmations coming muuuch faster than with BTC, wow, that's just great, and the exchange is charging a veeery small fee for the withdrawal. Hey the transaction has already been completely confirmed LOL :D before I could finish this post! |
I could come back to my PC now, some hours have passed so I'm adding a new post, not editing the previous one. I confirm the good news: when the GUI is not very responsive it's certainly NOT due to the LTC more intensive hashing algorithm, at least not on my PC, it's like if (just an idea) multiple threads were rushing into opening the blockchain_headers file and process the same data in parallel (or some recursion takes place which should not). I say this because:
BTW: while downloading/processing the blockchain_headers file, I think the GUI should show the "synchronizing" circular arrows and possibly also something else indicating that some sync process is happening... Here, otherwise, I only see the test transaction previously made with a "Not Verified" label and keep wondering. The GUI could display something like "Downloading blockchain_headers..." and later "Processing blockchain_headers...", or "Downloading blockchain headers related to this wallet transactions and confirmations..." , and later "Processing downloaded blockchain headers...". Remarkably, the GUI is perfectly responsive even after the download of the blockchain_headers file finishes, and before the "Not Verified" label disappears and the green check mark appears, delay which lasted maybe 1-2 minutes before, just after making that only one transaction, but now, 1-2 hours later, seems to be lasting several minutes... ... It finished now while I'm writing about it, maybe it took 5-10 minutes, if I had expected such a long delay I would have watched the clock to report more accurately. (The previous size of the blockchain_headers file was 97495120, the current size is 97496400, not a great difference... maybe it had to go through more confirmations online, I have no idea... the transaction details dialogue now says 110 confirmations [already!], by the time I'll finish and post this report they will be much more.) Let me guess, the delay is due to the lack of the hybrid Python + compiled C ltc_scrypt package (but the GUI, I repeat myself, stays fluid and responsive). Including ltc_scrypt in the package would be great, indeed. (As I mentioned, I believe the Blender package is Python+compiled C/C++.) I've sent the amount back to the exchange (to go safer, I renamed the blockchain_headers file before launching, to hide it from the application, so I had the GUI fluid and responsive all the time). In the options, I had activated 'dynamic fees' and 'propose replaceable always'. I pressed the Max amount button, and with the default fees, with the cursor in the middle, I got a warning that higher fees were needed or the network would not propagate the transaction. I guess the warning and/or the dynamic fees algorithms must be revisited, they are evidently not coherent, with dynamic fees active the default fees should not trigger this warning, I suppose. With Electrum BTC we can issue a command in the application GUI console to modify the amount of fees/kB the fees cursor can reach... it's probably the same here, but it was not necessary, at least not this time: I moved the fees cursor one step to the right, "within 2 blocks", and the same warning appeared, so I moved it to the extreme right and that went out ok. The "Replaceable" lable disappeared in one minute and while I'm writing these lines further confirmations are coming in at incredible speed, even higher than with the withdrawal. I was writing something here which I moved elsewhere for clarity and... stopped and wrote HEY ALREADY CONFIRMED with green check on the left, GO LITECOIN GO, MOOOON LOL... WAIT is this due to Segwit or...? LTC blocks / confirmations comes out faster than BTC but not THIS faster!!! The fees to send back to the exchange amounted to 0.00149998 LTC, about 4 cents of USD at the moment I'm writing, very low anyway compared to today's BTC fees. Communication, screen-to-webcam, between the two machines with the cold storage and the watching-only part was straightforward, reading the QR code of the unsigned transaction and, back to the online machine, reading the QR code of the signed transaction was instantaneous. Quitting was instantaneous, too, as I've launched after removing the blockchain_headers file, and control immediately went back to the console. After many minutes on-line, the watching-only part only issued these two lines on the console (we already know the first one, which is also the only one the cold storage part issued):
I've made two (amazingly fast!!!) transactions, so far this LTC wallet seems to work great, I could only spot for now minor things that need being checked out and re-tuned, not flaws in the basics. Huge work certainly behind the scenes, THANK YOU!!! EDIT: I launched the watching-only part on not-live Ubuntu again (where I had installed ltc_scrypt, as previously reported), without removing blockchain_headers file, and the GUI was perfectly responsive. So whatever happens when launching with pre-existent blockchain_headers file on Tails (2.12) is not happening here. Then I removed the blockchain_headers file and launched again. After downloading the file again (current size 97501840, previous size 97501520), 2 min 10 seconds passed before the two transactions went from "Not verified" to showing the green check mark (this is an old Quad 6600 2.4 GHz, 8 GB RAM). Certainly much faster than on Tails without ltc_scrypt. Anyway, this is not an issue anymore here, as apparently in this environment the lag problem is not happening now. The GUI never tends to hang for one second, either (it did with the very first blockchain_headers file present after installation, with no transaction made yet, although ltc_scrypt was installed... or maybe it was only a matter of rebooting after installing it). Using the watching-only part on this not-live Ubuntu is certainly a viable option. However, being able to use Electrum-LTC on Tails booted from DVD, without having to remove the blockchain_headers file, would be the best option to me, safer than an environment I use every day online (especially when it comes to access an exchange). |
EDITING to separate the "segmentation fault when opening the QR code reader" problem into issue #50, closing this issue because there's no such problem on Tails 3.0 despite the lack of ltc_scrypt. I just tested Beta 2.8.3.2 on Tails 3.0, no ltc_scrypt, and it's good news. For the first test, I removed the blockchain_headers file. After downloading it, the wallet was showing the transactions as verified again in less then 10 seconds. Ctrl-q => instantly quit. I could made the second test a couple of hours later: I didn't remove the blockchain_headers file. The wallet couldn't connect, red circle displayed (I had seen the "Tor ready" popup message from Tails). Ctrl-q => no quit, I waited a couple of minutes or less, than killed the process from another terminal window. I deactivated and activated again the Tails networking, waited for "Tor ready" again, checked with a web browser and... ... The third test was good news: there's no need to remove the blockchain_headers file and download it again, the GUI is responsive all the time, while the wallet shows "synchronizing" and the two circular arrows are displayed, and afterwards. The In further tests, minutes later, without removing the blockchain_headers file, the syncing process lasted a fraction of a second, I could see the blue circle and the wallet balance almost immediately. Ctrl-q => instantly quit (except of course when I tried to scan a QR code and got the segmentation fault). New warningsElectrum-LTC is showing some warnings on Tails 3.0 that I wasn't seeing on Tails 2.12 (Electrum BTC too). Here they are (the segmentation fault error did not happen unless I tried to open the QR code scanner):
(Reporting in issue #50 about "Segmentation fault when opening the QR code reader".) |
Hi @JazzTp, I know this is an old post but I wonder if you could maybe shed some light on exactly how you got Electrum LTC running on Tails in the first place? I've opened a new issue here detailing the problems, which essentially come down to the Linux install instructions specified on the Electrum LTC download page not working properly. Here's my issue: #102 If you have any time to post a quick reply, that would be helpful to me and a many others besides. |
Hi,
It is an old post indeed. More recent versions didn't hang that much,
still, in absence of the compiled ltc_scrypt, Electrum-LTC uses the python
fallback, 100 times slower, I think I was told. Which is why I ended up
using the watching only part on Ubuntu instead of Tails, after installing
the compiled ltc_scrypt.
But I understand this is not your request.
How: I DO NOT install Electrum on Tails, I launch Electrum from pendrive
(USB stick) and it runs reading/writing to/from the pendrive, so I can
switch anytime among Tails versions, in case of problems.
A simple bash script I made does the following (this was born for BTC but I
prepared the same for LTC and it works, and I'm ready for when Tails will
also "ship" with Electrum-LTC preinstalled, hopefully with the compiled
ltc_scrypt):
Extracts the Electrum-LTC tree from a password protected compressed file
into the amnesic home dir /home/amnesia
If it exists, eliminates (after issuing a warning and waiting for
confirmation) the .electrum-ltc tree in the amnesic home dir (notice the
dot before electrum-ltc).
Creates a .electrum-ltc symlink to a folder in a pendrive, something like
.../dot/.electrum-ltc-2.9 3.1
Changes dir to the Electrum-LTC tree and launches ./electrum-ltc (important
with BTC to launch from inside the tree otherwise I would be launching the
Electrum version coming preinstalled on Tails, the same might happen for
Electrum-LTC some day soon I think, Electrum-LTC preinstalled on Tails, AND
an Android version).
NOTICE that I maintain the possibility to extract-link-launch different
Electrum-LTC versions, each with its own copy of the
.electrum-LTC-versionInfo folder. I copy wallet files, do not let a new
version convert the only one copy of a wallet file.
How: I simply keep copies of my bash script which names contain the version
info, and inside I replace the version info characters with gedit, the text
editor, with ctrl-h, then I chose which script I launch. The simpler the
better.
A symlink shortens the name for the one I'm adopting as my current default
Electrum version. With some issues, it was super easy to check other
versions and point out which ones presented the issue and which ones didn't
NOTICE that I have separate (encrypted) cold storage / watching only
pendrives and only use the cold storage one on an airgapped machine and
nowhere else (search bad USB exploit, which is the reason why it's
important not to have the cold storage and watching only parts exchange
transactions through pendrive, actually I don't plug anymore in the cold
storage machine ANYTHING which will be plugged elsewhere, I have two
webcams... and in order to upgrade anything on the cold storage, I burn a
CD/DVD).
NOTICE: An issue with the QR scan reader since Tails 3 also appeared with
the Electrum version preinstalled on Tails itself, so apparently it's not
dependent on this way of doing things, oh and it happened on Linux Ubuntu
sometimes too, and to other users with other Linux distributions... I'll
have to report again and ask for more detailed instructions on how to
launch gdb because it gives me a complain, on Ubuntu Linux I mean, on Tails
I don't have it and have no idea how to install, besides I like to use
Tails as it is and boot from DVD to go online).
Cheers
|
Thank you for your detailed reply, sounds like a pretty effective approach. Perhaps a bit too much faffing for my liking to set up, since it would take me a fair while to replicate these steps without a step-by-step guide and even then I suspect I'd run into issues. I hope in future that Tails comes pre-configured with Electrum LTC, but in lieu of that I think I may just cave and buy a hardware wallet instead for the sake of convenience. |
I see. I might share the script once on my PC, but if you are not familiar
with this Linux things you might end up messing up I'm afraid, although
it's nothing fancy.
Others might be interested in hearing about your experience with the
hardware wallet, maybe you might post a few lines on some forum and put
just a link here (here it is for reporting and discussing issues, I'm
afraid they would remind us... well unless you will be having issues with
the hardware wallet, hopefully not).
|
Thanks @JazzTp, I much appreciate the information and your time. I have some Linux experience, mainly on web-servers, but I don't generally use it day-to-day in terms of system maintenance. I might have a poke around your script if you end up posting it. Hardware wallets are pretty mature and user friendly these days, so should be pretty simple compared to this. Thanks again. |
Hi @alxglover, very sorry for the delay! I'm going to put my answer to you into thread #102 from which you referenced this one, so we are not off topic. |
Hi,
I'm trying Electrum-LTC from electrum-ltc.org, on Tails 2.12, where I normally use with no problems the latest version (or one of the latest versions) of Electrum for Bitcoin (I do not use the Electrum version coming with Tails which is usually a previous one).
The .electrum-ltc folder is on a pendrive, I launch my script which puts a symlink to it from the home dir, extracts the Electrum-LTC tgz file in the home dir, cds into the folder and launches it from within, ./electrum-ltc or ./electrum (of course I do NOT merge Electrum LTC and BTC!).
Electrum for BTC works perfectly fine this way.
With Electrum-LTC, I have the following issue, both with beta 2.8.3.2 and 2.6.4.2:
in this situation, the top command shows python2 using 0.3 to 0.7 % CPU
in this situation, the top command shows python2 using 99.9 to 112.2 % CPU, while other programs remain responsive;
ctrl-q closes the GUI (with a delay of several seconds) but the cursor seems not to come back in the terminal window (I waited about 1 min at most, not more) unless I launch from another terminal window a kill -9 <process number> command.
Here's an example of terminal window output with 2.8.3.2; the first line is the only one which appears if I don't do anything but launching it, the rest appeared in this specific session when I opened the Network preferences dialog and simply closed it by confirming the current setup):
`Warning: ltc_scrypt not available, using fallback
Traceback (most recent call last):
File "/home/amnesia/Electrum-LTC-2.8.3.2/gui/qt/main_window.py", line 2726, in run_network_dialog
NetworkDialog(self.wallet.network, self.config, self).do_exec()
File "/home/amnesia/Electrum-LTC-2.8.3.2/gui/qt/network_dialog.py", line 51, in do_exec
self.nlayout.accept()
File "/home/amnesia/Electrum-LTC-2.8.3.2/gui/qt/network_dialog.py", line 330, in accept
self.network.set_parameters(host, port, protocol, proxy, auto_connect)
File "/home/amnesia/Electrum-LTC-2.8.3.2/lib/network.py", line 471, in set_parameters
self.switch_lagging_interface()
File "/home/amnesia/Electrum-LTC-2.8.3.2/lib/network.py", line 488, in switch_lagging_interface
header = self.get_header(self.get_local_height())
File "/home/amnesia/Electrum-LTC-2.8.3.2/lib/network.py", line 885, in get_header
return self.blockchain.read_header(tx_height)
File "/home/amnesia/Electrum-LTC-2.8.3.2/lib/blockchain.py", line 193, in read_header
f.seek(block_height * 80)
IOError: [Errno 22] Invalid argument
Traceback (most recent call last):
File "/home/amnesia/Electrum-LTC-2.8.3.2/gui/qt/main_window.py", line 2726, in run_network_dialog
NetworkDialog(self.wallet.network, self.config, self).do_exec()
File "/home/amnesia/Electrum-LTC-2.8.3.2/gui/qt/network_dialog.py", line 51, in do_exec
self.nlayout.accept()
File "/home/amnesia/Electrum-LTC-2.8.3.2/gui/qt/network_dialog.py", line 330, in accept
self.network.set_parameters(host, port, protocol, proxy, auto_connect)
File "/home/amnesia/Electrum-LTC-2.8.3.2/lib/network.py", line 471, in set_parameters
self.switch_lagging_interface()
File "/home/amnesia/Electrum-LTC-2.8.3.2/lib/network.py", line 488, in switch_lagging_interface
header = self.get_header(self.get_local_height())
File "/home/amnesia/Electrum-LTC-2.8.3.2/lib/network.py", line 885, in get_header
return self.blockchain.read_header(tx_height)
File "/home/amnesia/Electrum-LTC-2.8.3.2/lib/blockchain.py", line 193, in read_header
f.seek(block_height * 80)
IOError: [Errno 22] Invalid argument
`
The text was updated successfully, but these errors were encountered: