zone117x / node-open-mining-portal

A scalable all-in-one easy to setup cryptocurrency mining pool and portal written entirely in Node.js.
GNU General Public License v2.0
1.02k stars 1.03k forks source link

blockhash undefined for tx #138

Closed crackfoo closed 10 years ago

crackfoo commented 10 years ago

2014-05-04 21:45:11 [Payments] [21coin] Daemon reports blockhash undefined for tx 563ae9ae7395e67d2d55c5d72b3ca7e9bcb009dcadc2edd3c412a4c60efe1bcb is not the one we have stored: 00000000000139716b584b6928686a3bc4745f9772814ae5f7f8f2536d219ea2

Getting these errors on lastest pull.

KaTXi commented 10 years ago

Same here, these are for GlobalBoost coin:

2014-05-05 09:16:20 [Payments] [GlobalBoost] Daemon reports blockhash undefined for tx d0d612bd742e8bba4cc5dd139acacf63fe18a53b02bb513131605691e346386c is not the one we have stored: ef71ad8fc5b8767d708391b779aa0de33a5b76e095d82fbf9116f940cc1189c5

2014-05-05 09:16:20 [Payments] [GlobalBoost] Daemon reports blockhash undefined for tx 81dd9f1574b9f16767e23cafbca2303d7ad20d05783b81a0c7c34db5f95eab44 is not the one we have stored: 50dea3204ce20afb1924000a05cba4e1e158be33a492063be5d30f1a90a84963

2014-05-05 09:16:20 [Payments] [GlobalBoost] Daemon reports blockhash undefined for tx 2f8926e2340ef37c001943bbb9d1aee71d46d4983d99e3067053b871d2aa5848 is not the one we have stored: 01a37ba3010a916545fbbb999325cbe0624e32041b83af59f30bbbee0c6ea504

2014-05-05 09:16:20 [Payments] [GlobalBoost] Daemon reports blockhash undefined for tx 584df2ed7d85189852dc1ec35403f262961f7a430bcca43cfbfcb5185bbb19bf is not the one we have stored: 590257e2f614d7cf70618645fea0d14e07b6ad2f381599ea04ac82a2a3e4ed1a

2014-05-05 09:16:20 [Payments] [GlobalBoost] Daemon reports blockhash undefined for tx 5f540fb134cab6db2f8c48392e6b40726d5c68751e403519815c78eb3c7a5c9a is not the one we have stored: bce7dc6e6b1b9f663ae820a518c336da55ad2907706f39a01639181e9d846443 2

Those 5 blocks where mined using a key instead of a "real" address. The strange thing is that a lot more blocks where mined with the same key and they got paid (we imported the private key and made sure). The stats for the pool to see those 5 blocks still unpaid:

http://mmostories.com:8080/stats

A BlockExplorer for GlobalBoost coin to see those ids:

http://mmostories.com/blockexplorerBST/

bonesoul commented 10 years ago

Same here..

zacons commented 10 years ago

I could confirm that same strange behaviour was seen on my server with CoinoCoin. Most blocks get paid and like less than 10% show the "Daemon reports blockhash undefined for tx ...." or " Daemon reports invalid transaction xxxxxxxxxxxxxxxxx {"code":-5,"message":"Invalid or non-wallet transaction id"} errors in the log.

zone117x commented 10 years ago

The daemon occasional gives two strange types of responses when payment processor asks if a block's tx was confirmed/orhpaned.

Its a really strange problem because a block hash along with its tx hash is only stored in redis after it is submitted then reconfirmed by the stratum server that the block is totally valid.

My original best guess (when I first saw these a month or two ago) was that these are both instances of blocks essentially being orphaned in a non-typical way. I implemented this in the previous version of the payment processor - however, it was giving false positives and some other problems.

I can't replicate these two issues so we if want them fixed then I need the cooperation of someone having these issues...

Once I get that info I can come to a conclusion to why the daemon has these two types of behaviors and figure out what to do about it.

KaTXi commented 10 years ago

Here we go, these are from globalboost coin:

http://pastebin.com/hLrN1uYW

zone117x commented 10 years ago

Thanks KaTXi, can you do do a pastebin of globalboostd getblock ef71ad8fc5b8767d708391b779aa0de33a5b76e095d82fbf9116f940cc1189c5

Thanks

crackfoo commented 10 years ago

Not happening now on 21coin but on another:

http://pastebin.com/rnfzyzNJ

whothisbeme commented 10 years ago

The problem is from what I can tell is that node-stratum-pool only checks if the blockhash is correct with the daemon. It doesn't check to see if the blockhash's transaction ID is available.

KaTXi commented 10 years ago

Yep:

http://pastebin.com/LALHsyf0

zone117x commented 10 years ago

Alright so from my research it appears that the daemon reports a block as orphaned three different types of ways:

  1. The typical way where the details field says 'orphan'
  2. The ignorant way where the daemon acts like it has no clue about the transaction's existence
  3. The odd way where it acknowledges the transaction but doesn't give any details about it

I've decided to identify these last two types of situations as 'kicked' blocks so you will now see those blocks moved into the _blocksKicked array in redis.

These changes where made in my latest commit here: https://github.com/zone117x/node-open-mining-portal/commit/baadebd97da91ca938a9b85b5ef58ce06298465c

Please test it out and make sure its all working well - as I am not able to reproduce the errors being reported so I'm coding based off the pastebin links you guys are giving me and now able to test these error cases myself.

Thanoos commented 5 years ago

Hey I am using cpuminer and it is generating coin to some unknown address on startum. I am very confused. The blocks are visible in the explorer but not very sure where these coins are going. Please can you guide me. It will be great help. This is for the altcoin i have created using bitcoin fork v0,17.1