From b2ea7366ae8d6df8ed65d8ed745b4292dadae786 Mon Sep 17 00:00:00 2001 From: sdogi Date: Fri, 19 Aug 2011 00:44:30 +0300 Subject: [PATCH 1/2] Added changes from c00w's latest until 1efa7b0ceb362fcf37b8 --- README | 13 ++++++++++--- README_esp | 13 ++++++++++--- lp.py | 2 +- scheduler.py | 9 ++++----- user.cfg.default | 17 +++++++++-------- user.cfg.default_esp | 17 +++++++++-------- 6 files changed, 43 insertions(+), 28 deletions(-) diff --git a/README b/README index a88600c7..49c11bd7 100644 --- a/README +++ b/README @@ -46,9 +46,6 @@ You can launch bH with the following parameters: --listschedulers = List alternate schedulers available --scheduler = Select an alternate scheduler --threshold = Override difficulty threshold (default 0.43) - --altslicesize = Override Default AltSliceScheduler Slice Size of 900 - --altminslicesize = Override Default Minimum Pool Slice Size of 60 (AltSliceScheduler only) - --altslicejitter = Add some random variance to slice size, disabled by default (AltSliceScheduler only) --p2pLP = Starts up an IRC bot to validate LP based hopping --debug = Use twisted output @@ -67,6 +64,16 @@ The time based default scheduler. All that matters is time and it tries to be co Tries to be more aggressive at switching pools when thresholds are met rather than finishing a slice. Can be used with --altslicesize=xxx --altminslicesize=xxx (where you replace x with a number for slice size and min). Also slice size can be used with --altslicejitter=xx which adds some random variance to slice size. There can be issues with failing to re-slice often enough. +Specific parameters: + + --altslicesize = Override Default AltSliceScheduler Slice Size of 900 + --altminslicesize = Override Default Minimum Pool Slice Size of 60 (AltSliceScheduler only) + --altslicejitter = Add some random variance to slice size, disabled by default (AltSliceScheduler only) + --altsliceroundtimebias = Bias slicing slightly by round time duration with respect to round time target (default false) + --altsliceroundtimetarget = Round time target based on GHash/s (default 1000 Ghash/s) + --altsliceroundtimemagic = Round time magic number, increase to bias towards round time over shares + + RoundTimeScheduler Not currently in use. diff --git a/README_esp b/README_esp index c7286754..96f2a059 100644 --- a/README_esp +++ b/README_esp @@ -49,9 +49,6 @@ Puedes lanzar bH con los siguientes parametros: --listschedulers = Muestra los modos programados --scheduler = Selecciona otro modo programado --threshold = Sobrescribe dificultad de base (default 0.43) - --altslicesize = Sobrescribe trozo para el modo AltSliceScheduler, tamaño trozo base es 900 - --altminslicesize = Sobrescribe tamaño minimo de trozo, base 60 (AltSliceScheduler solo) - --altslicejitter = Añade variacion en el tamaño de trozo, deshabilitado por defecto (AltSliceScheduler solo) --p2pLP = Inicia el bot IRC para poder validar mucho mejor los saltos LP --debug = Visiona la salida de twisted @@ -70,6 +67,16 @@ Programador de base basado en tiempo. Todo lo que hace este programador es pasar Intenta un cambiar de un modo mas agresivo cuendo se llega a los limites preestablecidos (threshold). Se puede utilizar con los parametros --altslicesize=xxx --altminslicesize=xxx (donde reemplazas x con un numero para tamaño y trozo minimo). Tambien puedes utilizar --altslicejitter=xx para variar el tamaño de trozo de modo dinamico (aleatorio). De momento tiene problemas para recalcular los trozos bastante a menudo. +Parametros especificos: + + --altslicesize = Sobrescribe trozo para el modo AltSliceScheduler, tamaño trozo base es 900 + --altminslicesize = Sobrescribe tamaño minimo de trozo, base 60 (AltSliceScheduler solo) + --altslicejitter = Añade variacion en el tamaño de trozo, deshabilitado por defecto (AltSliceScheduler solo) + --altsliceroundtimebias = Moldea los trozos en funcion del tiempo de ronda con respecto al tiempo preestablecido (desactivado) + --altsliceroundtimetarget = Establece tiempo de ronda basado en velocidad de mina (GHash/s - establ. en 1000 Ghash/s) + --altsliceroundtimemagic = Numero magico de tiempo de ronda, incrementa to moldear hacia shares de final de ronda. + + RoundTimeScheduler En desuso actualmente. diff --git a/lp.py b/lp.py index d83f9ddf..af2807a5 100644 --- a/lp.py +++ b/lp.py @@ -45,7 +45,7 @@ def set_owner(self, server, block = None): self.blocks[block]['_defer'] = defer.Deferred() self.bitHopper.log_msg('Setting Block Owner ' + server+ ':' + str(block)) - if self.bitHopper.pool.servers[server]['role'] == 'mine_deepbit' and old_owner != server: + if server in self.bitHopper.pool.servers and self.bitHopper.pool.servers[server]['role'] == 'mine_deepbit' and old_owner != server: old_shares = self.bitHopper.pool.servers[server]['shares'] self.bitHopper.pool.servers[server]['shares'] = 0 self.bitHopper.select_best_server() diff --git a/scheduler.py b/scheduler.py index df0e328a..3bcea043 100644 --- a/scheduler.py +++ b/scheduler.py @@ -146,7 +146,7 @@ def select_best_server(self,): continue if info['role'] not in self.valid_roles: continue - if shares< min_shares: + if shares < min_shares: min_shares = shares #self.bh.log_dbg('Selecting pool ' + str(server) + ' with shares ' + str(info['shares']), cat='scheduler-default') server_name = server @@ -171,7 +171,7 @@ def select_latehop_server(self): if info['shares'] > max_share_count: server_name = server max_share_count = info['shares'] - self.bh.log_dbg('select_latehop_server: ' + str(server), cat='scheduler-default') + self.bh.log_dbg('select_latehop_server: ' + str(server), cat='scheduler-default') return server_name @@ -228,7 +228,6 @@ def __init__(self,bitHopper): def initData(self,): Scheduler.initData(self) if self.bh.options.threshold: - #self.bh.log_msg("Override difficulty threshold to: " + str(self.bh.options.threshold), cat='scheduler-default') self.difficultyThreshold = self.bh.options.threshold self.reset() @@ -465,8 +464,8 @@ def select_best_server(self,): for server in self.bh.pool.get_servers(): info = self.bh.pool.get_entry(server) if info['role'] not in self.valid_roles: - continue - if info['shares'] <=0: continue + continue + if info['shares'] <= 0: continue if server not in server_shares: continue shares = server_shares[server] + 1 if shares < min_shares and shares > 0: diff --git a/user.cfg.default b/user.cfg.default index fd457694..566f119d 100644 --- a/user.cfg.default +++ b/user.cfg.default @@ -34,7 +34,7 @@ # BACKUP SERVERS: Set it to the percent the server takes. # The penalty/100 is added to the reject rate when calculating # which server to use -# lp_penalty: normalize LP calls from this pool (bH thread for more info) +# lp_penalty: normalize LP's of this pool with "x" seconds (greater for fast LP response pools) # user: worker username you setup for this pool # pass: password you have for the worker (not needed for all pools) # @@ -214,6 +214,14 @@ role: info user: FSkyvM pass: xndzEU +[kiwipool] +# Seems like they're Prop. pool (thanks Clipse - IRC Chan.) +# Switched to PPS (page 154) +#CHANGE THIS (if you want) +role: disable +user: your_username +pass: your_password + ####################################### # These Pools are added recently # hop them at your risk @@ -295,13 +303,6 @@ role: disable user: paraipanakos.works pass: minero -[kiwipool] -# Switched to PPS (page 154) -#CHANGE THIS (if you want) -role: disable -user: your_username -pass: your_password - ###################################### # Namecoin pools. Good for hopping # with mine_nmc if you want some nmc diff --git a/user.cfg.default_esp b/user.cfg.default_esp index c64ef3f4..a5e55b35 100644 --- a/user.cfg.default_esp +++ b/user.cfg.default_esp @@ -34,7 +34,7 @@ # multiplica con este numero al comparar con la # dificultad (si incrementas este numero hace # que dejes la mina antes de dificultad*0.43) -# lp_penalty: normaliza las llamadas LP para esta mina (foro bH para mas info) +# lp_penalty: normaliza las LP de esta mina con "x" segundos (mayor para LP muy rapidos) # user: nombre del trabajador que se tiene que utilizar # pass: contraseña del trabajador (no se necesita para todas las minas) # @@ -213,6 +213,14 @@ role: info user: FSkyvM pass: xndzEU +[kiwipool] +# Se quedaron con el sist. Proporcional (gracias Clipse - Canal IRC) +# Cambio a sistema PPS (pagina 154) +#CAMBIA A CONTINUACION (si quieres) +role: disable +user: your_username +pass: your_password + ####################################### # Estas minas son muy nuevas para # saber si toman medidas anti-hoping @@ -297,13 +305,6 @@ role: disable user: paraipanakos.works pass: minero -[kiwipool] -# Cambio a sistema PPS (pagina 154) -#CAMBIA A CONTINUACION (si quieres) -role: disable -user: your_username -pass: your_password - ###################################### # Minas Namecoin. Se pueden saltar # con mine_nmc si quieres algo de nmc From fdc76a667c5b1acb190478ccf9008ee5219f5e92 Mon Sep 17 00:00:00 2001 From: sdogi Date: Fri, 19 Aug 2011 01:32:06 +0300 Subject: [PATCH 2/2] Fixing Linux bug that caused an exception I should have paid more attention when doing cleanup --- pool.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pool.py b/pool.py index 2fe8e3bb..50559afe 100644 --- a/pool.py +++ b/pool.py @@ -34,7 +34,9 @@ def loadConfig(self, bitHopper): if len(read) == 0: bitHopper.log_msg("user.cfg not found. You may need to move it from user.cfg.default") os._exit(1) - + + userpools = parser.sections() + try: # determine if application is a script file or frozen exe if hasattr(sys, 'frozen'): @@ -49,8 +51,6 @@ def loadConfig(self, bitHopper): if self.initialized == False: os._exit(1) - userpools = parser.sections() - for pool in userpools: self.servers[pool] = dict(parser.items(pool))