krisklosterman / node-open-mining-portal

THIS IS NOT PRODUCTION READY, please use Zone117x version for PROD, this is dev only
GNU General Public License v2.0
20 stars 17 forks source link

digibyte(qubit) blockhash is wrong. #10

Closed shwuhk closed 6 years ago

shwuhk commented 6 years ago

I notice that the stratum can submit the block hex, which is accepted by the daemon. However, the blockhash we calculated is different from the daemon one. so the stratum cannot validate the hash by getblock. Here is the log:

2017-10-09 15:21:49 [Pool]  [digibyte] (Thread 5) Submitted Block using submitblock successfully to daemon instance(s)
2017-10-09 15:21:49 [Pool]  [digibyte] (Thread 5) We thought a block was found but it was rejected by the daemon, share data: {"job":"6da","ip":"::ffff:198.11.220.46","port":3211,"worker":"user.worker","height":5342315,"blockReward":84254559178,"difficulty":554.92109572,"shareDiff":"62479.22175471","blockDiff":52866.836041359,"blockDiffActual":52866.836041359,"blockHash":"0000000000010c85480553b49dbbe4c9999779cf9b9833308c10a2d9bc3bbd2a"}
2017-10-09 15:21:49 [Pool]  [digibyte] (Thread 5) Share accepted at diff 554.92109572/62479.22175471 by user.worker [::ffff:198.11.220.46]
2017-10-09 15:21:49 [MySQL] [digibyte] Share inserted

Here is the debug.log of digibyte

2017-10-09 15:21:39 block height for reward is 5342315
2017-10-09 15:21:39 CreateNewBlock(): total size: 898 block weight: 3484 txs: 1 fees: 134000 sigops 408
2017-10-09 15:21:39 block height for reward is 5342315
2017-10-09 15:21:39 block height for reward is 5342315
2017-10-09 15:21:39 CreateNewBlock(): total size: 898 block weight: 3484 txs: 1 fees: 134000 sigops 408
2017-10-09 15:21:39 block height for reward is 5342315
2017-10-09 15:21:48 block height for reward is 5342315
2017-10-09 15:21:48 CreateNewBlock(): total size: 1124 block weight: 4388 txs: 2 fees: 156600 sigops 416
2017-10-09 15:21:48 block height for reward is 5342315
2017-10-09 15:21:49 block height for reward is 5342315
2017-10-09 15:21:49 UpdateTip: new best=6e013acbcfdb037205a36e9c4b872486fc2d9d12802b7f625556733380a9d0c8 height=5342315 version=0x20000802 algo=4 (qubit) log2_work=77.387119 tx=10482575 date='2017-10-09 15:21:39' progress=0.999047 cache=0.4MiB(959tx)
2017-10-09 15:21:49 AddToWallet 21b045fed2fc8dde3c141b6d5288a311be8cb97bc31855263bd88e331445b8b3  new
ghost commented 6 years ago

@shwuhk Tested on LTCR LiteCred QUBIT All works. Is digibyte multialgo coin? Is there masternodes?

shwuhk commented 6 years ago

@foxer666 no, only dash has masternodes, but yes, digibyte is a multialgo coin. does it affect the hash generated?

shtse8 commented 6 years ago

I have just checked my MPOS database, I also have the same issue. all my shares' upstream results are N.

ghost commented 6 years ago

@shwuhk Not only dash has masternodes. I had problems with blocksubmit on multialgo coins.

Qubit (Shares works, blocks finding, but error 'We thought a block was found but it was rejected by the daemon'. No blocks presented in pools web interface)
shtse8 commented 6 years ago

The calculated hash is different from the block hash. But the diff seems fine, so submitting works. Block is mined but we can't verify the block.

ghost commented 6 years ago

@shtse8 It's different problems:

  1. Block finded, submited, but NOMP didn't see it.
  2. Block finded, but can't submit with daemon.

The second problem as it seems to me, I have solved.

@shwuhk has 1st problem, @shtse8 has 2nd problem. Is it right?

shtse8 commented 6 years ago

@foxer666 My problem is:

https://github.com/krisklosterman/node-stratum-pool/blob/master/lib/pool.js#L587-L605

ghost commented 6 years ago

@shtse8 Sorry. With problems with daemon I can help. Withs problems submiting to NOMP - can't. First of all - try to use UNOMP code. Can Qubit works with UNOMP? If it works - we can take code from UNOMP.

shtse8 commented 6 years ago

I tried to get the headerbuffer and compute the hash by multihashing.qubit. it's different from the actual hash. do you have any idea?

shtse8 commented 6 years ago

Should be this issue. https://github.com/zone117x/node-stratum-pool/issues/77

shwuhk commented 6 years ago

@shtse8 It is the same issue. It was fixed. Thanks.

shtse8 commented 6 years ago

I think NOMP should mention it can't support multi-algo coins for the latest release.

krisklosterman commented 6 years ago

Or we can add it :)

ghost commented 6 years ago

Guys. https://github.com/krisklosterman/node-stratum-pool/blob/master/lib/algoProperties.js for (var algo in algos){ if (!algos[algo].multiplier) algos[algo].multiplier = 1;

I think it's multialgo check. I'm right?

shwuhk commented 6 years ago

@foxer666 @krisklosterman How do I know which coins/algos have multiplier? And what is multiplier?

ghost commented 6 years ago

@shwuhk My bad. Ignore prev message. Multialgo and multiplier - different things.

shtse8 commented 6 years ago

I would also like to know what is multiplier. I still don't understand.

krisklosterman commented 6 years ago

Multiplier is used to calculate hashrate

multiplier * totalShare / time

or something like that