lfm (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 15, 2010, 07:04:11 PM Last edit: August 15, 2010, 11:54:29 PM by satoshi Merited by vapourminer (2) |
|
seems a block at height 74638 has expoited a bug in the net. It uses an integer overflow to make a negative total transaction. The two transaction outputs are: out Value:92233720368.54(7ffffffffff85ee0) out Value:92233720368.54(7ff ffffffff85ee0) We need a fix asap Edit: (satoshi) 0.3.10 patch download links here: http://bitcointalk.org/index.php?topic=827.0
|
|
|
|
kencausey
Newbie
Offline
Activity: 15
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 15, 2010, 07:25:58 PM |
|
|
|
|
|
NewLibertyStandard
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 15, 2010, 08:26:44 PM Last edit: August 15, 2010, 09:11:29 PM by NewLibertyStandard |
|
Whether to stop generating depends on the possible solution. If there are ever bad blocks, I can imagine an officially patched Bitcoin could be hard coded to exclude bad transactions contained in the block chain so that although the bad transactions would still be sitting in the chain, they would be ignored. I recommend people keep on generating if you were previously generating but be cautious about transactions until we hear back from Satoshi.The recommendation is to stop generating.
|
Treazant: A Fullever Rewarding Bitcoin - Backup Your Wallet TODAY to Double Your Money! - Dual Currency Donation Address: 1Dnvwj3hAGSwFPMnkJZvi3KnaqksRPa74p
|
|
|
Gavin Andresen
Legendary
Offline
Activity: 1652
Merit: 2297
Chief Scientist
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 15, 2010, 08:39:42 PM |
|
Until there is a better fix... after a very small amount of testing this seems to work: --- a/main.h +++ b/main.h @@ -473,8 +473,12 @@ public: // Check for negative values foreach(const CTxOut& txout, vout) + { if (txout.nValue < 0) return error("CTransaction::CheckTransaction() : txout.nValue negative"); + if (txout.nValue > 21000000*COIN) + return error("CTransaction::CheckTransaction() : txout.nValue over-max"); + } if (IsCoinBase()) { @@ -520,6 +524,8 @@ public: int64 nValueOut = 0; foreach(const CTxOut& txout, vout) { + if (txout.nValue > 21000000*COIN) + continue; // ignore over-max-value... if (txout.nValue < 0) throw runtime_error("CTransaction::GetValueOut() : negative value"); nValueOut += txout.nValue;
You'll need to re-download the part of the block chain before the bad block-- remove the blkindex.dat and blk0001.dat files. I started with knightmb's blockchain snapshot.
|
How often do you get the chance to work on a potentially world-changing project?
|
|
|
|
satoshi
Founder
Sr. Member
Offline
Activity: 364
Merit: 7058
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 15, 2010, 08:59:09 PM Merited by SwayStar123 (10) |
|
Here's the preliminary change. Look right? I have more changes to make, this isn't all of it. Will SVN shortly. bool CheckTransaction() const { // Basic checks that don't depend on any context if (vin.empty() || vout.empty()) return error("CTransaction::CheckTransaction() : vin or vout empty");
// Check for negative and overflow values int64 nTotal = 0; foreach(const CTxOut& txout, vout) { if (txout.nValue < 0) return error("CTransaction::CheckTransaction() : txout.nValue negative"); if (txout.nValue > 21000000 * COIN) return error("CTransaction::CheckTransaction() : txout.nValue too high"); nTotal += txout.nValue; if (nTotal > 21000000 * COIN) return error("CTransaction::CheckTransaction() : txout total too high"); }
if (IsCoinBase()) { if (vin[0].scriptSig.size() < 2 || vin[0].scriptSig.size() > 100) return error("CTransaction::CheckTransaction() : coinbase script size"); } else { foreach(const CTxIn& txin, vin) if (txin.prevout.IsNull()) return error("CTransaction::CheckTransaction() : prevout is null"); }
return true; }
Don't sticky the topic, nobody looks up there. There'll be enough posts to bump.
|
|
|
|
satoshi
Founder
Sr. Member
Offline
Activity: 364
Merit: 7058
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 15, 2010, 09:06:45 PM |
|
It would help if people stop generating. We will probably need to re-do a branch around the current one, and the less you generate the faster that will be.
A first patch will be in SVN rev 132. It's not uploaded yet. I'm pushing some other misc changes out of the way first, then I'll upload the patch for this.
|
|
|
|
kencausey
Newbie
Offline
Activity: 15
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 15, 2010, 09:09:53 PM |
|
I'm afraid the community is just too big and distributed now to expect much in the way of voluntary quick action on anything, especially generation which I'm sure many have on automatic and largely unmoderated.
|
|
|
|
Gavin Andresen
Legendary
Offline
Activity: 1652
Merit: 2297
Chief Scientist
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 15, 2010, 09:10:33 PM |
|
Looks good to me.
Can you easily hardcode a check for the bad block's hash at startup and orphan it and subsequent blocks if they're on the best-block chain? It's painful to have to re-download all or most of the chain to fix this...
|
How often do you get the chance to work on a potentially world-changing project?
|
|
|
NewLibertyStandard
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 15, 2010, 09:15:18 PM |
|
Looks good to me.
Can you easily hardcode a check for the bad block's hash at startup and orphan it and subsequent blocks if they're on the best-block chain? It's painful to have to re-download all or most of the chain to fix this... Or just a quick re-verification of all blocks. After all, it is 5x faster than it used t be. ![Wink](https://bitcointalk.org/Smileys/default/wink.gif)
|
Treazant: A Fullever Rewarding Bitcoin - Backup Your Wallet TODAY to Double Your Money! - Dual Currency Donation Address: 1Dnvwj3hAGSwFPMnkJZvi3KnaqksRPa74p
|
|
|
satoshi
Founder
Sr. Member
Offline
Activity: 364
Merit: 7058
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 15, 2010, 09:23:55 PM |
|
Once you have an update, you could download knightmb's block chain. You'll want one that's old enough that it ends before block 74000 so the most recent security lockin will check it. Can someone find the link for that?
|
|
|
|
theymos
Administrator
Legendary
Offline
Activity: 5292
Merit: 13204
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 15, 2010, 09:26:09 PM |
|
Once you have an update, you could download knightmb's block chain. You'll want one that's old enough that it ends before block 74000 so the most recent security lockin will check it. Can someone find the link for that?
http://knightmb.dyndns.org/files/bitcoin/blocks/
|
1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
|
|
|
NewLibertyStandard
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 15, 2010, 09:29:08 PM |
|
I prefer to just re-download them.
Block verification after the patch but before everyone upgrades is going to be SLOW! It'll probably cause the next difficulty adjustment to decrease significantly. Of course everyone will probably have upgraded by the time the next adjustment rolls around, so we'll probably roll through it relatively quickly.
|
Treazant: A Fullever Rewarding Bitcoin - Backup Your Wallet TODAY to Double Your Money! - Dual Currency Donation Address: 1Dnvwj3hAGSwFPMnkJZvi3KnaqksRPa74p
|
|
|
kencausey
Newbie
Offline
Activity: 15
Merit: 0
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 15, 2010, 09:36:30 PM |
|
Edit: Hmm, I see there is an info file included which might just clue me in.
How about explaining to us stupid newbies what we would do with the blockchain once we download it?
|
|
|
|
jgarzik
Legendary
Offline
Activity: 1596
Merit: 1099
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 15, 2010, 09:38:41 PM |
|
How about explaining to us stupid newbies what we would do with the blockchain once we download it?
It means replacing files in the bitcoin data directory. It is not recommended, unless you know what you're doing. Easiest and safest way is to backup wallet.dat then redownload everything.
|
Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own. Visit bloq.com / metronome.io Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
|
|
|
satoshi
Founder
Sr. Member
Offline
Activity: 364
Merit: 7058
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 15, 2010, 09:40:19 PM |
|
Patch is uploaded to SVN rev 132!
For now, recommended steps: 1) Shut down. 2) Download knightmb's blk files. (replace your blk0001.dat and blkindex.dat files) 3) Upgrade. 4) It should start out with less than 74000 blocks. Let it redownload the rest.
If you don't want to use knightmb's files, you could just delete your blk*.dat files, but it's going to be a lot of load on the network if everyone is downloading the whole block index at once.
I'll build releases shortly.
|
|
|
|
NewLibertyStandard
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 15, 2010, 09:40:31 PM Last edit: August 15, 2010, 09:57:35 PM by NewLibertyStandard |
|
How about explaining to us stupid newbies what we would do with the blockchain once we download it?
While Bitcoin is not running, you put it in your Bitcoin data directory. ~/.bitcoin on Linux. If you want to re-download the whole chain, you just delete the file from the data directory while Bitcoin is not running. I'm going to be move my blk00x.dat files and blkindex.dat file out of by data directory and restart the client. Those are the correct files, right? Edit: I'll also backup the whole directory, like I usually do before upgrades.
|
Treazant: A Fullever Rewarding Bitcoin - Backup Your Wallet TODAY to Double Your Money! - Dual Currency Donation Address: 1Dnvwj3hAGSwFPMnkJZvi3KnaqksRPa74p
|
|
|
jgarzik
Legendary
Offline
Activity: 1596
Merit: 1099
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 15, 2010, 09:50:57 PM |
|
If you don't want to use knightmb's files, you could just delete your blk*.dat files, but it's going to be a lot of load on the network if everyone is downloading the whole block index at once.
Anybody wanna volunteer to create blk*.dat for block chain <= 64637 ? Maybe the official binaries could simply ship a known-good block chain, to save time and bandwidth?
|
Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own. Visit bloq.com / metronome.io Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
|
|
|
NewLibertyStandard
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 15, 2010, 10:05:11 PM |
|
Will the bug fix include the 4-way SSE2 patch of 0.3.9 rc2? Thanks for letting me know that it is included, theymos. Please release another release candidate when you have a moment if it is not included.What about the transactions from 74000 to the invalid block. Are those all invalid now as well?
Only the blocks including and after the invalid block are invalid. All previous blocks are valid.
|
Treazant: A Fullever Rewarding Bitcoin - Backup Your Wallet TODAY to Double Your Money! - Dual Currency Donation Address: 1Dnvwj3hAGSwFPMnkJZvi3KnaqksRPa74p
|
|
|
theymos
Administrator
Legendary
Offline
Activity: 5292
Merit: 13204
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
August 15, 2010, 10:06:02 PM |
|
What about the transactions from 74000 to the invalid block. Are those all invalid now as well?
Only this aberrant transaction and coins generated after it in the block chain will be removed. All other transactions will continue to exist. Will the bug fix include the 4-way SSE2 patch included in 0.3.9rc2? It's included.
|
1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
|
|
|
|