Bitcoin Forum
May 24, 2024, 08:47:45 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Note to Pool Operators (Public / Private) -Difficulty and Your Software/Database  (Read 1347 times)
eleuthria (OP)
Legendary
*
Offline Offline

Activity: 1750
Merit: 1007



View Profile
January 09, 2014, 08:18:29 AM
 #1

Just posting this as a note to any body running their own pool, either for themselves, or a major public pool.  I've been redoing my Stratum server code this last week, and just noticed something that could've been a major problem in a few months.


Make sure your pool software and/or database are setup to utilize 64-bit numerical values!  We're closing in on a network difficulty in excess of 2.1b and probably 4.2b shortly after, the maximum values for signed and unsigned 32-bit integers (and/or longs) respectively.  It would not surprise me at all if this will likely cause some issues for someone else once we cross those lines.

RIP BTC Guild, April 2011 - June 2015
empoweoqwj
Hero Member
*****
Offline Offline

Activity: 518
Merit: 500


View Profile
January 09, 2014, 10:35:58 AM
 #2

Just posting this as a note to any body running their own pool, either for themselves, or a major public pool.  I've been redoing my Stratum server code this last week, and just noticed something that could've been a major problem in a few months.


Make sure your pool software and/or database are setup to utilize 64-bit numerical values!  We're closing in on a network difficulty in excess of 2.1b and probably 4.2b shortly after, the maximum values for signed and unsigned 32-bit integers (and/or longs) respectively.  It would not surprise me at all if this will likely cause some issues for someone else once we cross those lines.

Great that you spotted the issue ahead of time. Sure everyone can fix it in time, and if they don't, nobody else to blame except themselves.
eleuthria (OP)
Legendary
*
Offline Offline

Activity: 1750
Merit: 1007



View Profile
January 09, 2014, 10:42:05 AM
 #3

Great that you spotted the issue ahead of time. Sure everyone can fix it in time, and if they don't, nobody else to blame except themselves.

Could be a non-issue, but I figured it's a good idea to bring it up now while there's still at least a few weeks to patch/fix it if the problem is there for others.  I haven't looked into open source solutions, and even those may have been altered by pool admins to fix it in advance.  I'm just remembering that *most* of the software out there was written over a year ago when the difficulty was only a few million, so it's not hard to believe that this could have been a common oversight among others. 

I know my history in programming tended to leave me working with integers/longs in 32-bit space.  Using 'long long' or 'int64_t' variables are something that just never crossed my mind since they're so rarely used in my past projects.

RIP BTC Guild, April 2011 - June 2015
empoweoqwj
Hero Member
*****
Offline Offline

Activity: 518
Merit: 500


View Profile
January 09, 2014, 11:10:22 AM
 #4

Great that you spotted the issue ahead of time. Sure everyone can fix it in time, and if they don't, nobody else to blame except themselves.

Could be a non-issue, but I figured it's a good idea to bring it up now while there's still at least a few weeks to patch/fix it if the problem is there for others.  I haven't looked into open source solutions, and even those may have been altered by pool admins to fix it in advance.  I'm just remembering that *most* of the software out there was written over a year ago when the difficulty was only a few million, so it's not hard to believe that this could have been a common oversight among others. 

I know my history in programming tended to leave me working with integers/longs in 32-bit space.  Using 'long long' or 'int64_t' variables are something that just never crossed my mind since they're so rarely used in my past projects.

I'm pretty sure it will be an issue. 32-bit is "natural" size for integers ...
Trongersoll
Hero Member
*****
Offline Offline

Activity: 490
Merit: 501



View Profile
January 10, 2014, 09:38:38 PM
 #5

will this affect Slush's stratum proxy?
eleuthria (OP)
Legendary
*
Offline Offline

Activity: 1750
Merit: 1007



View Profile
January 10, 2014, 09:44:14 PM
 #6

will this affect Slush's stratum proxy?

As far as I'm aware, it will not affect it.  The stratum proxy doesn't care about network difficulty.

RIP BTC Guild, April 2011 - June 2015
Entropy-uc
Hero Member
*****
Offline Offline

Activity: 756
Merit: 501


View Profile
January 10, 2014, 09:47:09 PM
 #7

It may affect cgminer though.

They show solved blocks so they must be tracking the current difficulty.

With all the embedded devices running cgminer it could be a real circus if anything breaks.

Good catch finding this and making sure people are aware in advance.
-ck
Legendary
*
Offline Offline

Activity: 4116
Merit: 1635


Ruu \o/


View Profile WWW
January 11, 2014, 06:20:42 AM
 #8

It may affect cgminer though.

They show solved blocks so they must be tracking the current difficulty.

With all the embedded devices running cgminer it could be a real circus if anything breaks.

Good catch finding this and making sure people are aware in advance.
cgminer uses doubles for difficulty so will be unaffected

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
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!