Author

Topic: Electrum 1.8.1 Stuck on Block 251526 (Read 10507 times)

hero member
Activity: 938
Merit: 1000
October 01, 2013, 03:46:37 AM
#35
Try a different server and make sure you included enough fees.
newbie
Activity: 17
Merit: 0
September 30, 2013, 04:32:25 PM
#34
This appears to be happening again. I cant send. TX rejected code -22.
full member
Activity: 624
Merit: 125
alcedoplatform.com
August 15, 2013, 03:28:10 PM
#33
I was wondering what was going on.  I'm connected to electrum.be now, but still not seeing a sent transaction in the blockchain, even unconfirmed.  Transaction shows in the electrum client as pending since about an hour ago.   I'm at 252,151 blocks right now.

Do you have the transactiond id?

I went to bed and when I looked again that one finally was OK.  But I just sent 1 BTC somewhere else 20 minutes ago and it's not showing up in the chain yet.  A few other transactions were pretty slow yesterday too, but I can't get a fix on if it was electrum or the sender, or both.

As for todays transaction, I'll PM you the ID. 


Well, as I was writing that, there were 2 confirmations  I opened and closed the client during that time.  Now I'm just wondering about the delays in general, previously, transactions would generally show up in the blockchain almost immediately, although unconfirmed.  Been slower since the stuck block it seems.  I'll keep monitoring it.
sr. member
Activity: 349
Merit: 250
August 15, 2013, 03:30:22 AM
#32
I was wondering what was going on.  I'm connected to electrum.be now, but still not seeing a sent transaction in the blockchain, even unconfirmed.  Transaction shows in the electrum client as pending since about an hour ago.   I'm at 252,151 blocks right now.

Do you have the transactiond id?
full member
Activity: 624
Merit: 125
alcedoplatform.com
August 14, 2013, 12:54:39 PM
#31
I was wondering what was going on.  I'm connected to electrum.be now, but still not seeing a sent transaction in the blockchain, even unconfirmed.  Transaction shows in the electrum client as pending since about an hour ago.   I'm at 252,151 blocks right now.
newbie
Activity: 2
Merit: 0
August 13, 2013, 07:46:59 PM
#30
That was a really helpful post as I experienced this problem today when attempting to send out some BTC. The strange thing was on my first attempt the funds actually arrived, but didn't show up on my transaction history - and other attempts to send failed, as per above comments. Changing the server fixed the problem - so thanks!

Servers electrum.be and electrum.no-ip.org are fixed and up to date.

Thanks to DigitalHermit for the fix, which is pushed to electrum-server on github (https://github.com/spesmilo/electrum-server/). We're urging all server operators to apply the fix. If you want to make sure your server database has a correct block 251526 indexed please re-index from a backup (i.e. from the foundry linked above). We're still researching how unpatched servers handled 251526...
newbie
Activity: 46
Merit: 0
August 13, 2013, 12:11:43 PM
#29
There appears to be a bug (regression) with servers not connected to IRC and Electrum > 1.7 . The client only shows the one server you're connected to, which is a problem if this is a server still stuck on 251526. It should show a list of built in servers.

To resolve this you manually have to enter one of the servers like:

electrum.be SSL 50002
electrum.no-ip.org SSL 50002
electrum.pdmc.net SSL 50002

legendary
Activity: 1258
Merit: 1001
August 13, 2013, 11:40:06 AM
#28
My Abe got struck at 251526. Updating of Abe from github resolved the issue and the scanning went ahead Smiley
newbie
Activity: 46
Merit: 0
August 12, 2013, 04:48:45 PM
#27
Transaction ID: 77822fd6663c665104119cb7635352756dfc50da76a92d417ec1a12c518fad69 contains the patch for the second bug:

Thx for posting this!
How is "second bug" meant? How do you read the patch? It's still the same issue? I guess I'm missing something?

Quote
I guess this was code monkey-copied from abe?  I suppose someone should go fix that too.

abe was fairly quick:

commit 2b721e1df441396d04cea8b34ebe7b77488ddf52
Author: John Tobey
Date:   Mon Aug 12 13:44:39 2013 -0400

    Merge bitcointools upstream changes and update callers.


If I read the timestamp right that's less than 2 hours after the fix got included in the blockchain. That's rather quick and the change fixes other things with it. Too quick, but maybe he got a PM around the time it was accepted in the mempool at Eligius Smiley?
legendary
Activity: 1120
Merit: 1164
August 12, 2013, 03:53:18 PM
#26
So, is this him? Anyone can write something with a header saying from "From: Satoshi Nakamoto <[email protected]>", but I can't picture someone searching through the entire commits history of bitcoin to find the relevant commit that matches what he's talking about (f1e1fb4bdef878c8fc1564fa418d44e7541a7e83, which does indeed exist and it is a commit by Satoshi)

Note that I mentioned double-byte opcodes a few weeks ago on the forums; there's lots of people who know about this stuff and could have made that transaction.

I should also point out that the transaction appears to not only include a patch to fix Electrum, but at the same time also triggers the bug it patches. I think what happens is that the OP_INVALIDOPCODE triggers the broken double-wide code to advance a byte, ORing that byte with OP_INVALIDOPCODE << 8. Unfortunately that character is a PUSHDATA, which means that Electrum now processes the data as though it were opcodes. The next byte is 0x4e, or OP_PUSHDATA4, followed by the length of the data to be pushed, 0xffffffff=2^32 bytes. Of course there aren't 4GiB of data in the script, so it fails and Electrum gets stuck.

I think the OP_IF/OP_ENDIF was meant so that the transaction could be spent, but whomever did so forgot that PUSHDATA's > 520 bytes make a transaction invalid. Thus unless we change that limit - a hard-fork - the 15mBTC will be unspendable forever. (invalid opcodes are legal in an un-executed IF/ELSE/ENDIF branch, but oversized pushdata's are not)

I rather doubt that Satoshi would have made that mistake.  Wink

I think he did include a git signature:

a3a61fef43309b9fb23225df7910b03afc5465b9

That's just a reference to the previous commit ID the patch is meant to apply too. If you save that patch to a file you can apply it with git am patch.diff, it was probably created with git format-patch from the looks of it.
member
Activity: 104
Merit: 11
August 12, 2013, 03:22:16 PM
#25
I think he did include a git signature:

a3a61fef43309b9fb23225df7910b03afc5465b9
full member
Activity: 140
Merit: 100
August 12, 2013, 03:11:38 PM
#24
Transaction ID: 77822fd6663c665104119cb7635352756dfc50da76a92d417ec1a12c518fad69 contains the patch for the second bug:

Code:
From a3a61fef43309b9fb23225df7910b03afc5465b9 Mon Sep 17 00:00:00 2001
From: Satoshi Nakamoto
Date: Mon, 12 Aug 2013 02:28:02 -0200
Subject: [PATCH] Remove (SINGLE|DOUBLE)BYTE

I removed this from Bitcoin in f1e1fb4bdef878c8fc1564fa418d44e7541a7e83
in Sept 7 2010, almost three years ago. Be warned that I have not
actually tested this patch.
---
 backends/bitcoind/deserialize.py |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/backends/bitcoind/deserialize.py b/backends/bitcoind/deserialize.py
index 6620583..89b9b1b 100644
--- a/backends/bitcoind/deserialize.py
+++ b/backends/bitcoind/deserialize.py
@@ -280,10 +280,8 @@ opcodes = Enumeration("Opcodes", [
     "OP_WITHIN", "OP_RIPEMD160", "OP_SHA1", "OP_SHA256", "OP_HASH160",
     "OP_HASH256", "OP_CODESEPARATOR", "OP_CHECKSIG", "OP_CHECKSIGVERIFY", "OP_CHECKMULTISIG",
     "OP_CHECKMULTISIGVERIFY",
-    ("OP_SINGLEBYTE_END", 0xF0),
-    ("OP_DOUBLEBYTE_BEGIN", 0xF000),
     "OP_PUBKEY", "OP_PUBKEYHASH",
-    ("OP_INVALIDOPCODE", 0xFFFF),
+    ("OP_INVALIDOPCODE", 0xFF),
 ])
 
 
@@ -293,10 +291,6 @@ def script_GetOp(bytes):
         vch = None
         opcode = ord(bytes[i])
         i += 1
-        if opcode >= opcodes.OP_SINGLEBYTE_END and i < len(bytes):
-            opcode <<= 8
-            opcode |= ord(bytes[i])
-            i += 1
 
         if opcode <= opcodes.OP_PUSHDATA4:
             nSize = opcode
--
1.7.9.4

I guess this was code monkey-copied from abe?  I suppose someone should go fix that too.

So, is this him? Anyone can write something with a header saying from "From: Satoshi Nakamoto <[email protected]>", but I can't picture someone searching through the entire commits history of bitcoin to find the relevant commit that matches what he's talking about (f1e1fb4bdef878c8fc1564fa418d44e7541a7e83, which does indeed exist and it is a commit by Satoshi). Satoshi, if you are reading this, add your digital signature next time, even if you are trying to be extra cautious it can't possibly do much harm.
legendary
Activity: 997
Merit: 1002
Gamdom.com
August 12, 2013, 02:16:53 PM
#23
Can't send anything from my electrum wallet, tried using electrum.be and electrum.no-ip.org, no joy. Keep seeing that error -22 message. Any ideas what I can do? thanks

EDIT: All sorted now  Grin
member
Activity: 79
Merit: 10
August 12, 2013, 01:39:23 PM
#22
I can write an email with "From: Satoshi Nakamoto <[email protected]>" in the header too, and embed it in the blockchain.

What would you like your letter from Satoshi to say?
legendary
Activity: 1974
Merit: 1030
August 12, 2013, 11:56:31 AM
#21
What's this?

Code:
From a3a61fef43309b9fb23225df7910b03afc5465b9 Mon Sep 17 00:00:00 2001
From: Satoshi Nakamoto
Date: Mon, 12 Aug 2013 02:28:02 -0200
Subject: [PATCH] Remove (SINGLE|DOUBLE)BYTE

I removed this from Bitcoin in f1e1fb4bdef878c8fc1564fa418d44e7541a7e83
in Sept 7 2010, almost three years ago. Be warned that I have not
actually tested this patch.

More specifically:

Code:
From: Satoshi Nakamoto
Date: Mon, 12 Aug 2013 02:28:02 -0200

It's been several hours since this was posted and I don't see the entire net screaming "Satoshi is alive!!!" all around, so I guess I must be the only one drawing the wrong conclusion from those two lines. Someone willing to state that obvious thing that I fail to see?
legendary
Activity: 1896
Merit: 1353
August 12, 2013, 11:36:42 AM
#20
Servers electrum.be and electrum.no-ip.org are fixed and up to date.

Thanks to DigitalHermit for the fix, which is pushed to electrum-server on github (https://github.com/spesmilo/electrum-server/). We're urging all server operators to apply the fix. If you want to make sure your server database has a correct block 251526 indexed please re-index from a backup (i.e. from the foundry linked above). We're still researching how unpatched servers handled 251526...

thank you guys for the quick fix!
newbie
Activity: 38
Merit: 0
August 12, 2013, 08:16:27 AM
#19
You can also use your electrum passphrase at carbon wallet. http://carbonwallet.com/
staff
Activity: 4326
Merit: 8951
August 12, 2013, 05:50:06 AM
#18
Transaction ID: 77822fd6663c665104119cb7635352756dfc50da76a92d417ec1a12c518fad69 contains the patch for the second bug:

Code:
From a3a61fef43309b9fb23225df7910b03afc5465b9 Mon Sep 17 00:00:00 2001
From: Satoshi Nakamoto
Date: Mon, 12 Aug 2013 02:28:02 -0200
Subject: [PATCH] Remove (SINGLE|DOUBLE)BYTE

I removed this from Bitcoin in f1e1fb4bdef878c8fc1564fa418d44e7541a7e83
in Sept 7 2010, almost three years ago. Be warned that I have not
actually tested this patch.
---
 backends/bitcoind/deserialize.py |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/backends/bitcoind/deserialize.py b/backends/bitcoind/deserialize.py
index 6620583..89b9b1b 100644
--- a/backends/bitcoind/deserialize.py
+++ b/backends/bitcoind/deserialize.py
@@ -280,10 +280,8 @@ opcodes = Enumeration("Opcodes", [
     "OP_WITHIN", "OP_RIPEMD160", "OP_SHA1", "OP_SHA256", "OP_HASH160",
     "OP_HASH256", "OP_CODESEPARATOR", "OP_CHECKSIG", "OP_CHECKSIGVERIFY", "OP_CHECKMULTISIG",
     "OP_CHECKMULTISIGVERIFY",
-    ("OP_SINGLEBYTE_END", 0xF0),
-    ("OP_DOUBLEBYTE_BEGIN", 0xF000),
     "OP_PUBKEY", "OP_PUBKEYHASH",
-    ("OP_INVALIDOPCODE", 0xFFFF),
+    ("OP_INVALIDOPCODE", 0xFF),
 ])
 
 
@@ -293,10 +291,6 @@ def script_GetOp(bytes):
         vch = None
         opcode = ord(bytes[i])
         i += 1
-        if opcode >= opcodes.OP_SINGLEBYTE_END and i < len(bytes):
-            opcode <<= 8
-            opcode |= ord(bytes[i])
-            i += 1
 
         if opcode <= opcodes.OP_PUSHDATA4:
             nSize = opcode
--
1.7.9.4

I guess this was code monkey-copied from abe?  I suppose someone should go fix that too.
yxt
legendary
Activity: 3528
Merit: 1116
August 12, 2013, 04:19:05 AM
#17
Thanks for the fast solution  Smiley
sr. member
Activity: 420
Merit: 250
August 11, 2013, 10:53:10 PM
#16
electrum.stepkrav.pw up n running.  Smiley
Thanks. Switched there, and everything's working! Smiley
full member
Activity: 188
Merit: 100
August 11, 2013, 07:19:18 PM
#15
electrum.stepkrav.pw up n running.  Smiley
newbie
Activity: 46
Merit: 0
August 11, 2013, 05:29:57 PM
#14
I did some simple tests with tx from block 251526 and they are indexed just fine on a crashed server after the fix is applied. Unless the server throws "LevelDBError: Corruption" on startup as has been reported but might be unrelated it's sufficient to stop the server, pull git head and start the server.
newbie
Activity: 46
Merit: 0
August 11, 2013, 05:01:25 PM
#13
Servers electrum.be and electrum.no-ip.org are fixed and up to date.

Thanks to DigitalHermit for the fix, which is pushed to electrum-server on github (https://github.com/spesmilo/electrum-server/). We're urging all server operators to apply the fix. If you want to make sure your server database has a correct block 251526 indexed please re-index from a backup (i.e. from the foundry linked above). We're still researching how unpatched servers handled 251526...
full member
Activity: 150
Merit: 100
Thank you! Thank you! ...
August 11, 2013, 03:07:15 PM
#12
I didn't know that electrum is that awesome! Smiley

It takes some hours until I finished the download of the blockchain.

You can create a wallet at blockchain.info and import the private keys from your electrum wallet if you need access to your funds immediately. Otherwise, sadly yes you will have to wait for a fix.
newbie
Activity: 46
Merit: 0
August 11, 2013, 02:44:02 PM
#11
Looks like we got caught off-guard on a Sunday. Rest assured we're working on getting this fixed asap. The coins are safe. Just seeing new tx and spending coins is not possible at this time.

To Server operators:

The dumps at http://electrum-foundry.no-ip.org/leveldb-dump/?C=M;O=D  generated this morning around midnight have a clean, uncorrupted database to use once we have a fix to get past offending block 251526.
See also http://electrum-foundry.no-ip.org/
full member
Activity: 124
Merit: 106
August 11, 2013, 02:43:17 PM
#10
I didn't know that electrum is that awesome! Smiley

It takes some hours until I finished the download of the blockchain.
hero member
Activity: 812
Merit: 1006
August 11, 2013, 02:41:20 PM
#9
Are their some servers already which have fixxed the problem? A lot of bitcoins are now on bitcoin addresses on which I have no access!
I need the bitcoins AT THIS MOMENT.

I guess with some code wizardy you can export the private keys to bitcoind or multibit.
cp1
hero member
Activity: 616
Merit: 500
Stop using branwallets
August 11, 2013, 02:40:32 PM
#8
Export your private key to another wallet client.
full member
Activity: 124
Merit: 106
August 11, 2013, 02:35:48 PM
#7
Is it possible to use the bitcoins at this moment? How long do you think does it take until this issues are fixxed?
hero member
Activity: 784
Merit: 1010
Bitcoin Mayor of Las Vegas
August 11, 2013, 02:08:56 PM
#6
Checking in as this was starting to effect me and was wondering what's going on. Thanks OP.
sr. member
Activity: 686
Merit: 250
August 11, 2013, 01:32:36 PM
#5
I am just surprised I hadn't read more people in the same situation.
full member
Activity: 150
Merit: 100
Thank you! Thank you! ...
August 11, 2013, 01:18:31 PM
#4
Code:
def script_GetOp(bytes):
  i = 0
  while i < len(bytes):
    vch = None
    opcode = ord(bytes[i])
    i += 1
    if opcode >= opcodes.OP_SINGLEBYTE_END:
      opcode <<= 8
      opcode |= ord(bytes[i])

Apparently there is an issue in script_GetOp(bytes) (deserialize.py) for this particular block that makes the electrum server code read off the end of the byte array when trying to read the operation. I don't know if this is an issue with the format of this specific block or with the python code. If it's an issue with the block format I'm surprised it has gone undetected this long - apparently bitcoind code permitted/accepted this block.
sr. member
Activity: 686
Merit: 250
August 11, 2013, 12:42:59 PM
#3
Thank you DigitalHermit, thought I would ask in here once I discovered a problem.
Hopefully it can be resolved quickly.
full member
Activity: 150
Merit: 100
Thank you! Thank you! ...
August 11, 2013, 12:18:34 PM
#2
As per the title, no matter what server I reconnect to, it will not go past block 251526

I have tried all the servers
Deleted the contents of /appdata/Roaming/Electrum
Recovered the wallet using my seed & resynced

All to no avail, It will not let me send my balance out of the wallet giving the error -22

Any help is appreciated.

It is not your wallet that is the problem; The problem is on the Electrum Server(s)... this will need to be fixed in order to make Electrum clients functional again.

The exception we are seeing server-side is:
Code:
[11/08/2013-12:06:38] hist [('0000000000000050efb2e0ea17635fa1c2bd8da1e7864ecc0695f2565643989e', 251526, 0)]
Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 755, in run
    self.function(*self.args, **self.kwargs)
  File "/home/electrum/src/electrum-20130112/server/backends/bitcoind/blockchain_processor.py", line 67, in
    threading.Timer(0, lambda: self.catch_up(sync=False)).start()
  File "/home/electrum/src/electrum-20130112/server/backends/bitcoind/blockchain_processor.py", line 675, in catch_up
    self.import_block(next_block, next_block_hash, self.height+1, sync)
  File "/home/electrum/src/electrum-20130112/server/backends/bitcoind/blockchain_processor.py", line 391, in import_block
    tx_hashes, txdict = self.deserialize_block(block)
  File "/home/electrum/src/electrum-20130112/server/backends/bitcoind/blockchain_processor.py", line 366, in deserialize_block
    tx = deserialize.parse_Transaction(vds, is_coinbase)
  File "/home/electrum/src/electrum-20130112/server/backends/bitcoind/deserialize.py", line 291, in parse_Transaction
    o = parse_TxOut(vds, i)
  File "/home/electrum/src/electrum-20130112/server/backends/bitcoind/deserialize.py", line 271, in parse_TxOut
    d['address'] = extract_public_key(scriptPubKey)
  File "/home/electrum/src/electrum-20130112/server/backends/bitcoind/deserialize.py", line 379, in extract_public_key
    decoded = [ x for x in script_GetOp(bytes) ]
  File "/home/electrum/src/electrum-20130112/server/backends/bitcoind/deserialize.py", line 335, in script_GetOp
    opcode |= ord(bytes[i])
IndexError: string index out of range

sr. member
Activity: 686
Merit: 250
August 11, 2013, 08:38:28 AM
#1
As per the title, no matter what server I reconnect to, it will not go past block 251526

I have tried all the servers
Deleted the contents of /appdata/Roaming/Electrum
Recovered the wallet using my seed & resynced

All to no avail, It will not let me send my balance out of the wallet giving the error -22

Any help is appreciated.
Jump to: