spesmilo / spesmilo/electrum

TrustedCoin service is broken - critical bug

Open
#7,628 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

plugin-trustedcoin
Dominant language
Python
Stars
8.6k
Forks
3.5k
Avg merge
2d 8h
Merged PRs (30d)
61

Description

During Electrum 4.1.5 launch I got pop-up window - "Sorry! Something went wrong while executing Electrum."

I'm unable to complete any transactions because of this error. As far as I can understand, TrustedCoin is using Cloudflare services and it wants me to pass captcha, which is ridiculous because Electrum is not a browser.

Part of report contents below:

Traceback (most recent call last):
  File "/tmp/.mount_electrm2AfM4/usr/lib/python3.7/site-packages/electrum/util.py", line 1063, in run_with_except_hook
    run_original(*args2, **kwargs2)
  File "/tmp/.mount_electrm2AfM4/usr/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/tmp/.mount_electrm2AfM4/usr/lib/python3.7/site-packages/electrum/plugins/trustedcoin/trustedcoin.py", line 488, in f
    return func(self, *args, **kwargs)
  File "/tmp/.mount_electrm2AfM4/usr/lib/python3.7/site-packages/electrum/plugins/trustedcoin/trustedcoin.py", line 499, in request_billing_info
    billing_info = server.get(wallet.get_user_id()[1])
  File "/tmp/.mount_electrm2AfM4/usr/lib/python3.7/site-packages/electrum/plugins/trustedcoin/trustedcoin.py", line 210, in get
    return self.send_request('get', 'cosigner/%s' % quote(id))
  File "/tmp/.mount_electrm2AfM4/usr/lib/python3.7/site-packages/electrum/plugins/trustedcoin/trustedcoin.py", line 157, in send_request
    timeout=timeout)
  File "/tmp/.mount_electrm2AfM4/usr/lib/python3.7/site-packages/electrum/network.py", line 1322, in send_http_on_proxy
    return coro.result()
  File "/tmp/.mount_electrm2AfM4/usr/lib/python3.7/concurrent/futures/_base.py", line 435, in result
    return self.__get_result()
  File "/tmp/.mount_electrm2AfM4/usr/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/tmp/.mount_electrm2AfM4/usr/lib/python3.7/site-packages/electrum/network.py", line 1300, in _send_http_on_proxy
    return await on_finish(resp)
  File "/tmp/.mount_electrm2AfM4/usr/lib/python3.7/site-packages/electrum/plugins/trustedcoin/trustedcoin.py", line 135, in handle_response
    raise TrustedCoinException(message, resp.status)
electrum.plugins.trustedcoin.trustedcoin.TrustedCoinException: <!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>

<title>Please Wait... | Cloudflare</title>
  
<meta name="captcha-bypass" id="captcha-bypass" />
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" type="text/css" media="screen,projection" />
<!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" type="text/css" media="screen,projection" /><![endif]-->
<style type="text/css">body{margin:0;padding:0}</style>

Another part:

<noscript id="cf-captcha-bookmark" class="cf-captcha-info">
 <h1 data-translate="turn_on_js" style="color:#bd2426;">Please turn JavaScript on and reload the page.</h1>
 </noscript>
   <div id="no-cookie-warning" class="cookie-warning" data-translate="turn_on_cookies" style="display:none">
     <p data-translate="turn_on_cookies" style="color:#bd2426;">Please enable Cookies and reload the page.</p>
   </div>
 <script type="text/javascript">
 //<![CDATA[
   var a = function() {try{return !!window.addEventListener} catch(e) {return !1} },
     b = function(b, c) {a() ? document.addEventListener("DOMContentLoaded", b, c) : document.attachEvent("onreadystatechange", b)};
     b(function(){
       var cookiesEnabled=(navigator.cookieEnabled)? true : false;
       if(!cookiesEnabled){
         var q = document.getElementById('no-cookie-warning');q.style.display = 'block';

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with electrum/plugins/trustedcoin/trustedcoin.py, especially request_billing_info, send_request, and handle_response, then inspect electrum/network.py where the HTTP response is processed. Reproduce the TrustedCoin request and determine how the Cloudflare HTML response should be handled; done means TrustedCoin transactions can complete without the reported exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.