oliverw / miningcore

Miningcore is a high-performance Mining Pool Software for Linux and Windows.
https://store.miningcore.pro
MIT License
726 stars 665 forks source link

Block Finding issue with RVN. #509

Closed ucyildirim closed 5 years ago

ucyildirim commented 5 years ago

Description

Hi there, I'm currently testing RVN coin. I've increased shareDiff to 55K SGMiner shows the difficulty of the submitted share. As you can see from the screenshot, One of my rigs submitted a share with 593K difficulty Block diff is around 67K. The 593K diff share should find a block right? Or is there something that I miss?

https://imgur.com/a/zkRKMms

Steps to Reproduce

  1. Start MiningCore
  2. Start mining software (SGMiner)
  3. Mine RVN and find high diff shares

Expected behavior

A share with 595K diff should find block.

Actual behavior

Nothing happens, just accepts share and continues.

Reproduces how often

Allways

Version

44

Additional Information

Config file

{ "logging": { "level": "info", "enableConsoleLog": true, "enableConsoleColors": true, "logFile": "miningLog.txt", "logBaseDirectory": "", "perPoolLogFile": true }, "api": { "enabled": true, "listenAddress": "127.0.0.1", "port": 4000 }, "banning": { "manager": "integrated", "banOnJunkReceive": true, "banOnInvalidShares": false }, "notifications": { "enabled": false, "email": { "host": "smtp.example.com", "port": 587, "user": "user", "password": "password", "fromAddress": "info@yourpool.org", "fromName": "support" }, "admin": { "enabled": false, "emailAddress": "user@example.com", "notifyBlockFound": true } }, "persistence": { "postgres": { "host": "127.0.0.1", "port": 6344, , "user": "miningcore", "password": "PWD, "database": "miningcore" } }, "paymentProcessing": { "enabled": false, "interval": 600, "shareRecoveryFile": "recovered-shares.txt" }, "pools": [ { "id": "rvn", "enabled": true, "coin": "ravencoin", "address": "WALLETHERE", "rewardRecipients": [ { "address": "WALLETHERE", "percentage": 0 } ], "blockRefreshInterval": 100, "jobRebroadcastTimeout": 10, "clientConnectionTimeout": 600, "banning": { "enabled": true, "time": 600, "invalidPercent": 50, "checkThreshold": 50 }, "ports": { "16001": { "listenAddress": "192.168.1.22", "difficulty": 55000, "name": "GPU Mining" }, "16002": { "listenAddress": "192.168.1.22", "difficulty": 55000, "name": "GPU Mining" }, "16010": { "listenAddress": "192.168.1.22", "difficulty": 55000, "name": "GPU Mining" } }, "daemons": [ { "host": "127.0.0.1", "port": 42068, "user": "user1", "password": "112233Aa" } ], "paymentProcessing": { "enabled": false, "minimumPayment": 0.25, "minimumPaymentToPaymentId": 1.0, "payoutScheme": "PPLNS", "payoutSchemeConfig": { "factor": 2.0 } } } ] }

bitspill commented 5 years ago

Were there any logs in the Miningcore session regarding the the share in question?

Was a submission attempted but got rejected by the RVN daemon or Miningcore didn't even try?

ucyildirim commented 5 years ago

Yeah i have the logs. İ will post them once i go to work.

MiningCore didn’t even try to submit the block. There are no exceptions / rejected shares / rejected block requests.

ucyildirim commented 5 years ago

Were there any logs in the Miningcore session regarding the the share in question?

Was a submission attempted but got rejected by the RVN daemon or Miningcore didn't even try?

Here is the log file - 1. This is the first share. I was mining with 55K share difficulty.

[2018-12-10 13:45:45.2414] [I] [rvn] Detected new block 485277 via RPC polling [2018-12-10 13:45:45.2414] [I] [rvn] Broadcasting job [2018-12-10 13:45:49.8374] [I] [rvn] Detected new block 485278 via RPC polling [2018-12-10 13:45:49.8374] [I] [rvn] Broadcasting job [2018-12-10 13:45:54.8585] [I] [rvn] Broadcasting job [2018-12-10 13:46:04.8608] [I] [rvn] Broadcasting job [2018-12-10 13:46:14.8740] [I] [rvn] Broadcasting job [2018-12-10 13:46:24.8872] [I] [rvn] Broadcasting job [2018-12-10 13:46:34.8883] [I] [rvn] Broadcasting job [2018-12-10 13:46:44.8897] [I] [rvn] Broadcasting job [2018-12-10 13:46:54.9020] [I] [rvn] Broadcasting job [2018-12-10 13:47:04.9033] [I] [rvn] Broadcasting job [2018-12-10 13:47:14.9082] [I] [rvn] Broadcasting job [2018-12-10 13:47:24.9198] [I] [rvn] Broadcasting job [2018-12-10 13:47:34.9251] [I] [rvn] Broadcasting job [2018-12-10 13:47:44.9352] [I] [rvn] Broadcasting job [2018-12-10 13:47:54.9505] [I] [rvn] Broadcasting job [2018-12-10 13:48:00.6179] [I] [rvn] Detected new block 485279 via RPC polling [2018-12-10 13:48:00.6179] [I] [rvn] Broadcasting job [2018-12-10 13:48:04.9556] [I] [rvn] Broadcasting job [2018-12-10 13:48:14.9679] [I] [rvn] Broadcasting job [2018-12-10 13:48:15.0127] [I] [rvn] [0HLIUH0CPEU0J] Share accepted: D=214,844 [2018-12-10 13:48:22.4472] [I] [rvn] Detected new block 485280 via RPC polling [2018-12-10 13:48:22.4485] [I] [rvn] Broadcasting job [2018-12-10 13:48:24.9811] [I] [rvn] Broadcasting job [2018-12-10 13:48:26.6047] [I] [rvn] Detected new block 485281 via RPC polling [2018-12-10 13:48:26.6047] [I] [rvn] Broadcasting job [2018-12-10 13:48:34.9960] [I] [rvn] Broadcasting job [2018-12-10 13:48:45.0095] [I] [rvn] Broadcasting job [2018-12-10 13:48:55.0176] [I] [rvn] Broadcasting job [2018-12-10 13:48:57.6533] [I] [rvn] Detected new block 485282 via RPC polling [2018-12-10 13:48:57.6533] [I] [rvn] Broadcasting job [2018-12-10 13:49:00.7160] [I] [rvn] Detected new block 485283 via RPC polling [2018-12-10 13:49:00.7160] [I] [rvn] Broadcasting job [2018-12-10 13:49:05.0309] [I] [rvn] Broadcasting job [2018-12-10 13:49:15.0441] [I] [rvn] Broadcasting job [2018-12-10 13:49:15.2445] [I] [rvn] Detected new block 485284 via RPC polling [2018-12-10 13:49:15.2459] [I] [rvn] Broadcasting job [2018-12-10 13:49:25.0475] [I] [rvn] Broadcasting job [2018-12-10 13:49:35.0870] [I] [rvn] Broadcasting job [2018-12-10 13:49:38.7524] [I] [rvn] Detected new block 485285 via RPC polling [2018-12-10 13:49:38.7524] [I] [rvn] Broadcasting job [2018-12-10 13:49:45.0641] [I] [rvn] Broadcasting job [2018-12-10 13:49:55.0764] [I] [rvn] Broadcasting job [2018-12-10 13:49:58.0885] [I] [rvn] Detected new block 485286 via RPC polling [2018-12-10 13:49:58.0901] [I] [rvn] Broadcasting job [2018-12-10 13:50:05.0782] [I] [rvn] Broadcasting job [2018-12-10 13:50:15.0897] [I] [rvn] Broadcasting job [2018-12-10 13:50:25.0999] [I] [rvn] Broadcasting job [2018-12-10 13:50:35.1050] [I] [rvn] Broadcasting job

After that, I realized that high diff shares being ignored. I've added a few extra parameters to logs.

A few high diff share is missed again. This time I was mining with 80 share difficulty (Be aware, not 80K. just 80!)

[2018-12-12 05:26:24.7984] [I] [rvn] Broadcasting job [2018-12-12 05:26:34.7997] [I] [rvn] Broadcasting job [2018-12-12 05:26:39.8196] [I] [rvn] [0HLIVFCHUTNCR] Share accepted: D=0,312, NetworkDiff = 54447,8614622026, ShareDiff = 92,0122840277817, Ratio = 1,15, HeaderVal = 00000002c83dea4f55690274049a817554808016efadcc89e76a38ab0c94025f, BlockTargetValue = 0000000000013421000000000000000000000000000000000000000000000000, IsBlockCandicateTemp = False [2018-12-12 05:26:42.8325] [I] [rvn] [0HLIVFCHUTNCR] Share accepted: D=0,312, NetworkDiff = 54447,8614622026, ShareDiff = 216847,247133305, Ratio = 2710,591, HeaderVal = 00000000004d5e1dbaf086d6cb02112d10f70ee09058bc79b9677b54780fae9d, BlockTargetValue = 0000000000013421000000000000000000000000000000000000000000000000, IsBlockCandicateTemp = False [2018-12-12 05:26:44.8009] [I] [rvn] Broadcasting job [2018-12-12 05:26:54.8113] [I] [rvn] Broadcasting job [2018-12-12 05:27:04.8115] [I] [rvn] Broadcasting job [2018-12-12 05:27:14.8130] [I] [rvn] Broadcasting job

.....

[2018-12-10 18:03:24.7175] [I] [rvn] Broadcasting job [2018-12-10 18:03:26.6359] [I] [rvn] [0HLIULGJ42S9V] Share accepted: D=214,844, NetworkDiff = 63147,3190813656, ShareDiff = 153255,96781176, Ratio = 2,786, HeaderVal = 00000000006d785e687f5eb9154154fbd381a9a6e5c58827047f2b7e74d4aee7, BlockTargetValue = 00000000000109ae000000000000000000000000000000000000000000000000, IsBlockCandicateTemp = False [2018-12-10 18:03:34.7268] [I] [rvn] Broadcasting job [2018-12-10 18:03:44.7338] [I] [rvn] Broadcasting job

...

[2018-12-11 01:46:35.7958] [I] [rvn] Broadcasting job [2018-12-11 01:46:43.3478] [I] [rvn] [0HLIULGJ42SCR] Share accepted: D=214,844, NetworkDiff = 52054,3675764774, ShareDiff = 144120,240349463, Ratio = 2,62, HeaderVal = 00000000007468d2aa0c235a04847eed3d81970296f5744108c37aa1d210feac, BlockTargetValue = 000000000001424c000000000000000000000000000000000000000000000000, IsBlockCandicateTemp = False [2018-12-11 01:46:45.8090] [I] [rvn] Broadcasting job [2018-12-11 01:46:55.8102] [I] [rvn] Broadcasting job

....

[2018-12-11 02:10:16.8418] [I] [rvn] Broadcasting job [2018-12-11 02:10:23.0120] [I] [rvn] [0HLIULGJ42SCV] Share accepted: D=214,844, NetworkDiff = 55333,1241062111, ShareDiff = 646834,736688882, Ratio = 11,761, HeaderVal = 000000000019efdffc39422fd1fa7bfe586e73a24edaa1628d534a18923d5283, BlockTargetValue = 0000000000012f33000000000000000000000000000000000000000000000000, IsBlockCandicateTemp = False [2018-12-11 02:10:26.8440] [I] [rvn] Broadcasting job

...

[2018-12-11 21:24:03.8822] [I] [rvn] Broadcasting job [2018-12-11 21:24:08.7251] [I] [rvn] [0HLIVFCHUTNCB] Share accepted: D=0,312, NetworkDiff = 70168,9609201412, ShareDiff = 126443,878661708, Ratio = 1580,548, HeaderVal = 000000000084aedca317c6343b40f49caca5dcebe8bb1b274abae8f39e27c7b1, BlockTargetValue = 000000000000ef18000000000000000000000000000000000000000000000000, IsBlockCandicateTemp = False [2018-12-11 21:24:13.8925] [I] [rvn] Broadcasting job

...

[2018-12-12 04:32:22.5941] [I] [rvn] Broadcasting job [2018-12-12 04:32:23.8483] [I] [rvn] [0HLIVFCHUTNCO] Share accepted: D=0,312, NetworkDiff = 57605,6139597892, ShareDiff = 161057,087806292, Ratio = 2013,214, HeaderVal = 0000000000682af3eb4181f04155cac21caf911fd87f20a1b57bc4a6af8fbc88, BlockTargetValue = 000000000001233d000000000000000000000000000000000000000000000000, IsBlockCandicateTemp = False [2018-12-12 04:32:27.7476] [I] [rvn] [0HLIVFCHUTNCO] Share accepted: D=0,312, NetworkDiff = 57605,6139597892, ShareDiff = 4213,46679982831, Ratio = 52,668, HeaderVal = 000000000f8dbf4e37128efa744c822210d644ca58340221e48934e9baa2b381, BlockTargetValue = 000000000001233d000000000000000000000000000000000000000000000000, IsBlockCandicateTemp = False

....

[2018-12-12 05:26:34.7997] [I] [rvn] Broadcasting job [2018-12-12 05:26:39.8196] [I] [rvn] [0HLIVFCHUTNCR] Share accepted: D=0,312, NetworkDiff = 54447,8614622026, ShareDiff = 92,0122840277817, Ratio = 1,15, HeaderVal = 00000002c83dea4f55690274049a817554808016efadcc89e76a38ab0c94025f, BlockTargetValue = 0000000000013421000000000000000000000000000000000000000000000000, IsBlockCandicateTemp = False [2018-12-12 05:26:42.8325] [I] [rvn] [0HLIVFCHUTNCR] Share accepted: D=0,312, NetworkDiff = 54447,8614622026, ShareDiff = 216847,247133305, Ratio = 2710,591, HeaderVal = 00000000004d5e1dbaf086d6cb02112d10f70ee09058bc79b9677b54780fae9d, BlockTargetValue = 0000000000013421000000000000000000000000000000000000000000000000, IsBlockCandicateTemp = False [2018-12-12 05:26:44.8009] [I] [rvn] Broadcasting job

ucyildirim commented 5 years ago

Still having the same issue.

Screenshot Here

Any idea @oliverw ?

bitspill commented 5 years ago

@uurcm16 It looks as though the reported ShareDiff is inaccurate and those are indeed not valid, the HeaderVal is greater than the BlockTargetValue so it's not a proper block yet it doesn't meet the required difficulty (var isBlockCandidate = headerValue <= blockTargetValue;)

HeaderVal        = 00000000004d5e1dbaf086d6cb02112d10f70ee09058bc79b9677b54780fae9d
BlockTargetValue = 0000000000013421000000000000000000000000000000000000000000000000

In the build/coins.json file RVN needs to change the shareMultiplier from 256 to 4096


RVN uses a different powLimit/diff1 than BTC so we can can find the proper multiplier by dividing them

RVN powLimit https://github.com/RavenProject/Ravencoin/blob/dcfa859/src/chainparams.cpp#L127 BTC powLimit https://github.com/bitcoin/bitcoin/blob/2068f08/src/chainparams.cpp#L72

-> https://www.wolframalpha.com/input/?i=0x00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff+%2F+0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff -> 4096

If we scale the shareDiff you mined we can see it does not in reality exceed the blockDiff -> https://www.wolframalpha.com/input/?i=216847.247133305++*+256+%2F+4096 -> 13552.9529458315625 which is less than the required 54447.8614622026

This can be further verified by applying the shareDiff to the powLimit and we obtain the original HeaderVal -> https://www.wolframalpha.com/input/?i=0x00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff+%2F+13552.9529458315625 -> 4.d5e6b195ba043_16×16^55

oliverw commented 5 years ago

@bitspill So we need a fix for RVN in coins.json?

bitspill commented 5 years ago

@oliverw I believe so, yes, but I did not test anything just the math as I don't mine

ucyildirim commented 5 years ago

@bitspill I've increased the ShareMultiplier to 4096. The result is still the same. I've submitted a few high diff shares again and nothing happens :)

The ShareDiff you see in the log is Line 354 from BitcoinJob.cs

Here is the related parts of the log file.

[2018-12-15 13:35:02.4205] [I] [rvn] [0HLJ2DRV2U87E] Share accepted: D=0,02, NetworkDiff = 58137,418071066, ShareDiff = 116679,464550116 Ratio = 1458,493, HeaderVal = 0000000008fc967e2fc3153a5138c16569d637d29a84ddfa974960d858a02e0a, BlockTargetValue = 0000000000012093000000000000000000000000000000000000000000000000, IsBlockCandicateTemp = False ShareMult = 4096 [2018-12-15 13:15:28.1121] [I] [rvn] [0HLJ2DRV2U87E] Share accepted: D=0,02, NetworkDiff = 54845,5702409685, ShareDiff = 1276141,45065617 Ratio = 15951,768, HeaderVal = 0000000000d258992069a800004047c75e21c0b035469fcc431ac925ff8663d0, BlockTargetValue = 00000000000131e5000000000000000000000000000000000000000000000000, IsBlockCandicateTemp = False ShareMult = 4096 [2018-12-15 12:58:53.2750] [I] [rvn] [0HLJ2DRV2U87E] Share accepted: D=0,02, NetworkDiff = 54677,2980267346, ShareDiff = 61956,9306044574 Ratio = 774,462, HeaderVal = 0000000010ec8c390a47d3cb408122032fdada052e3f21089a4f16526e6e3c94, BlockTargetValue = 00000000000132d6000000000000000000000000000000000000000000000000, IsBlockCandicateTemp = False ShareMult = 4096 [2018-12-15 12:31:22.2762] [I] [rvn] [0HLJ2DRV2U87C] Share accepted: D=0,02, NetworkDiff = 58691,9627751889, ShareDiff = 816867,107204895 Ratio = 10210,839, HeaderVal = 0000000001489c5de72336b0cf71608ac1f0df912d1de8ed000d1450c1d172f7, BlockTargetValue = 0000000000011dd9000000000000000000000000000000000000000000000000, IsBlockCandicateTemp = False ShareMult = 4096

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.