Bitcoin Forum
May 04, 2024, 09:20:20 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: BOUNTY - 1500 HUC (approx 2+ BTC) - Huntercoin Mining Bug  (Read 1209 times)
snailbrain (OP)
Legendary
*
Offline Offline

Activity: 1807
Merit: 1020



View Profile
February 09, 2014, 02:52:24 AM
Last edit: February 09, 2014, 09:52:33 AM by snailbrain
 #1

We are placing a bounty from the undecided bounty part of the pre-allocation --- we want to get this fixed sooner rather than later, so here is an opportunity for some coders to get some Hucs..

Problem - Miner getting stuck on blocks

Eligius Log:

http://pastebin.com/raw.php?i=fbAitJ1Q

Problem seems to be:

that there is some transaction that is currently in the memory pool of nodes that can be put into block and the block can be mined, but then won't be accepted. I.e. some discrepancy between CreateNewBlock and ProcessBlock.


we are looking through it, but it is time consuming - if someone spots it first before us, they can claim this bounty.

we are aware of the failing name_firstupdate bug when re-using name of killed player, who sent chat message in the last move.


Bounty = 1500 HUCs

p.s. no need to issue fix, just need the fault

show the place in source code. I.e. discrepancy between CreateNewBlock and ProcessBlock, or something like that Smiley

Check here first, to see if been solved: https://bitcointalk.org/index.php?topic=456182.0

You get merit points when someone likes your post enough to give you some. And for every 2 merit points you receive, you can send 1 merit point to someone else!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714857620
Hero Member
*
Offline Offline

Posts: 1714857620

View Profile Personal Message (Offline)

Ignore
1714857620
Reply with quote  #2

1714857620
Report to moderator
1714857620
Hero Member
*
Offline Offline

Posts: 1714857620

View Profile Personal Message (Offline)

Ignore
1714857620
Reply with quote  #2

1714857620
Report to moderator
DavidT
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile
February 09, 2014, 04:03:14 AM
 #2

Could it have to do with size? maybe something related to line 470 in cryptlib.h? Sorry, didn't have a look at the source at all before, so might be totally off, but would possibly make sense if there is a size issue. Anyway, I keep on looking for a bit, fingers crossed you can pinpoint it soon, without a debug environment and on the weekend hard to say, geeez.
DavidT
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile
February 09, 2014, 04:35:41 AM
 #3

gotta go, will maybe have a look later when I get time, good luck
ahmed_bodi
Hero Member
*****
Offline Offline

Activity: 518
Merit: 500

Bitrated user: ahmedbodi.


View Profile
February 09, 2014, 05:47:41 AM
 #4

a debug log would help

Bitrated user: ahmedbodi.
rsnel
Member
**
Offline Offline

Activity: 77
Merit: 10


View Profile WWW
February 09, 2014, 10:16:22 AM
Last edit: February 09, 2014, 01:02:49 PM by rsnel
 #5

My guess:

Failure probably is in  CBlock::ConnectBlock() at line 1319.

nFees is initailized at 0, never changed and then vtx[0].getValueOut is checked against GetBlockValue(pindex->nHeight, nFees), since nFees == 0 this silently fails.

Edit:

Code:
keypool keep 882
InvalidChainFound: invalid block=7ee9a9e1ff1ffc925894  height=39735  work=216983967497595029143
InvalidChainFound:  current best=77c39192bb4a4a8a88f2  height=39734  work=216897912273401034588
ERROR: SetBestChain() : ConnectBlock failed
ERROR: AcceptBlock() : AddToBlockIndex failed
ERROR: ProcessBlock() : AcceptBlock FAILED
ERROR: BitcoinMiner : ProcessBlock, block not accepted

As can be seen here: CBlock::SetBestChain() craps out at if(!ConnectBlock()) at line 1451. First visible error is from InvalidChainFound(), so ConnectBlock() fails silently (could also be txdb.Write(), but seems unlikely).

Edit2: mmmm, if nFees really doesn't get updated, why doesn't this function fail more often?

Maintainer of I0coin: http://i0coin.snel.it/ | SHA256 60GH/s | scrypt 600kH/s
I0coins can be traded on Vircurex, you can use this signup URL and pay less transaction fees.
snailbrain (OP)
Legendary
*
Offline Offline

Activity: 1807
Merit: 1020



View Profile
February 09, 2014, 03:52:38 PM
Last edit: February 09, 2014, 04:15:46 PM by snailbrain
 #6

My guess:

Failure probably is in  CBlock::ConnectBlock() at line 1319.

nFees is initailized at 0, never changed and then vtx[0].getValueOut is checked against GetBlockValue(pindex->nHeight, nFees), since nFees == 0 this silently fails.

Edit:

Code:
keypool keep 882
InvalidChainFound: invalid block=7ee9a9e1ff1ffc925894  height=39735  work=216983967497595029143
InvalidChainFound:  current best=77c39192bb4a4a8a88f2  height=39734  work=216897912273401034588
ERROR: SetBestChain() : ConnectBlock failed
ERROR: AcceptBlock() : AddToBlockIndex failed
ERROR: ProcessBlock() : AcceptBlock FAILED
ERROR: BitcoinMiner : ProcessBlock, block not accepted

As can be seen here: CBlock::SetBestChain() craps out at if(!ConnectBlock()) at line 1451. First visible error is from InvalidChainFound(), so ConnectBlock() fails silently (could also be txdb.Write(), but seems unlikely).

Edit2: mmmm, if nFees really doesn't get updated, why doesn't this function fail more often?

thanks for the response, much appreciated

seems not the issue, and could be the buggy tx is no longer in the memory pool - asking pools if they have had any issues since

Quote
nFees is updated properly and if there was such an bug, all blocks would fail as you pointed out

Quote
I've been running a dummy miner (with minimum difficulty for 10 hours) and the error never happened. Maybe the buggy tx stopped broadcasting and is not in the memory pool anymore.


Will be an update to fix name/death/chat bug -- Miners must upgrade last -- (have messaged pools)
Quote
Also I added more debug messages into ConnectBlock and related functions, hopefully it'll help to locate the problem.

rsnel
Member
**
Offline Offline

Activity: 77
Merit: 10


View Profile WWW
February 09, 2014, 04:31:58 PM
Last edit: February 09, 2014, 04:46:54 PM by rsnel
 #7

Indeed:
Code:
bool CTransaction::ConnectInputs(CTxDB& txdb, map<uint256, CTxIndex>& mapTestPool, CDiskTxPos posThisTx,
                                 CBlockIndex* pindexBlock, int64& nFees, bool fBlock, bool fMiner, int64 nMinFee)

nFees is passed as a reference, so it is updated  Grin

Will look further, I suspect some edge case in the calculation of the fees. That would be why this error only occurs in a busy game and not in a test setup.

I still would place a debug output at line 1320, detailing vtx[0].getValueOut() and GetBlockValue()

Maintainer of I0coin: http://i0coin.snel.it/ | SHA256 60GH/s | scrypt 600kH/s
I0coins can be traded on Vircurex, you can use this signup URL and pay less transaction fees.
snailbrain (OP)
Legendary
*
Offline Offline

Activity: 1807
Merit: 1020



View Profile
February 09, 2014, 05:03:18 PM
 #8

Indeed:
Code:
bool CTransaction::ConnectInputs(CTxDB& txdb, map<uint256, CTxIndex>& mapTestPool, CDiskTxPos posThisTx,
                                 CBlockIndex* pindexBlock, int64& nFees, bool fBlock, bool fMiner, int64 nMinFee)

nFees is passed as a reference, so it is updated  Grin

Will look further, I suspect some edge case in the calculation of the fees. That would be why this error only occurs in a busy game and not in a test setup.

I still would place a debug output at line 1320, detailing vtx[0].getValueOut() and GetBlockValue()

Great, could be closer to the truth Smiley - keep going <3

Quote
I had a similar guess and placed a debug output (line 1320), though I did not print values (just prints whether they are correct/wrong).

Will add a more detailed message

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!