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

negative hashrate #46

Closed loadavg closed 10 years ago

loadavg commented 10 years ago

for some reason I am getting a negative hash rate in my stats ?

screen shot 2014-04-06 at 11 06 41 pm

loadavg commented 10 years ago

any idea on whats happening here ? i am testing out mining bitcoin and while my 4 antminer u1's are running at 1.8 ghz each in bfgminer, showing up perfectly and accepting shares perfectly - i am getting a negative hash rate in the web stats of -1789569.71 ?



zone117x commented 10 years ago

Not sure why this is happening. But front-end and stats are getting a total reworking so lets see if the issue is still happening once I push the new code.

bluecircle commented 10 years ago

w00t!

loadavg commented 10 years ago

great just a heads up i also notice this in redis - not sure if the +inf and -inf next to hash rate help out

397239453.392549 [0 127.0.0.1:35539] "zrangebyscore" "Bitcoin_hashrate" "1397238853" "+inf" 1397239453.392572 [0 127.0.0.1:35539] "hgetall" "Bitcoin_stats" 1397239453.392580 [0 127.0.0.1:35539] "scard" "Bitcoin_blocksPending" 1397239453.392585 [0 127.0.0.1:35539] "scard" "Bitcoin_blocksConfirmed" 1397239453.392591 [0 127.0.0.1:35539] "scard" "Bitcoin_blocksOrphaned" 1397239453.392598 [0 127.0.0.1:35539] "EXEC" 1397239454.894968 [0 127.0.0.1:35539] "MULTI" 1397239454.894998 [0 127.0.0.1:35539] "zremrangebyscore" "Bitcoin_hashrate" "-inf" "(1397238854" 1397239454.895015 [0 127.0.0.1:35539] "zrangebyscore" "Bitcoin_hashrate" "1397238854" "+inf"

zone117x commented 10 years ago

I pushed the new front-end code. Update and see if its still happening. That redis log looks fine btw.

pflux commented 10 years ago

still happening for me. I will try and nail this down, but I might have to get your help zone in actually submitting a commit

zone117x commented 10 years ago

I just did some major changes to the node-stratum-pool module with how difficulty and share validation works. It made numbers more accurate for scrypt based algos and x11. The changes might have fixed the negative sha256 hashrate bug. I tested on bitcoin testnet and wasn't able to reproduce the bug.

Please pull latest and see if bug still happens

crackfoo commented 10 years ago

With the latest update, I still get negative hashrates

zone117x commented 10 years ago

Finally got this issue taken care of. For some reason there was a binary operator on the hashrate which would scramble the number if it went above max int32 size. It is fixed now.