Bitcoin Forum
May 10, 2024, 06:04:15 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [1 BTC payment] 2 BUG FIXES + 1 FEATURE (cgminer/sgminer)  (Read 1120 times)
djeZo (OP)
Hero Member
*****
Offline Offline

Activity: 588
Merit: 520


View Profile
April 22, 2014, 09:57:47 PM
 #1

Need following done:

Quote
1. FORK OF CGMINER 3.7.2 (create fork on github)

- fix stratum extranonce bug (fixed in later versions of cgminer and in all sgminers)
- fix stratum refused auth bug *
- add stratum mining.subscribe.extranonce method **
- create 32/64bit binaries for Linux (Ubuntu, SMOS, BAMT)
- create 32/64bit binaries for Windows

2. UPDATE OF LATEST SGMINER (create fork on github)

- fix stratum refused auth bug
- add stratum mining.subscribe.extranonce method **
- create 32/64bit binaries for Linux (Ubuntu, SMOS, BAMT)
- create 32/64bit binaries for Windows


* Stratum refused auth bug (sgminer 4.0.0+ affected, not sure for cgminer)
-------------------------------------------------------------------------

Miner falls into idle state if authorization is refused. Miner does not move onto work
provided by second pool, but rather stays at first pool and idle.

How to invoke this bug?

Start miner with 2 pools and perform some work on pool #1. Pool #1 then drops connection
and miner will switch to pool #2. Pool #1 becomes available right after drop, but refuses
authentication (sends back result=false). Miner will detect pool #1 as being stable and
after several seconds switch back to pool #1, even though it does not authorize the miner
nor provide any kind of work. Because no work is provided, miner goes into idle state,
hashrate drops to 0. Miner is connecting to pool #1 every 30 seconds butgetting
authorization refused and connection dropped each time. Meanwhile, miner is connected to
pool #2 and getting work from it without issues.

This bug does not happen if authorization is refused when miner is starting up. That is
why bug is fixed by restarting the miner.



** Stratum mining.subscribe.extranonce method
---------------------------------------------

Uppon successful subscription to stratum with "mining.subscribe" method, client should
send "mining.subscribe.extranonce" method.

{"id": X, "method": "mining.subscribe.extranonce", "params": []}\n

This informs the server (pool) that client (miner) supports extranonce1 change on-the-fly
without the need to reestablish connection.

Servers supporting this method will reply:

{"id": X, "result": true, "error": null}\n

If the server does not support method, reply will be:

{"id": X, "result": false, "error": [20, "Not supported.", null]}\n

Server may also simply ignore this subscription and return no reply or return invalid method.
In all cases, client does not perform any logic when receiving back these replies.


With mining.subscribe.extranonce subscription, client should handle extranonce1 changes correctly.
Server would send:

{"id": X, "method": "mining.set_extranonce", "params": ["08000002", 4]}\n

First parameter is string extranonce1 value, second parameter is integer value of extranonce2 size.
Miner should immediatelly drop current work and create new work with new extranonce1 value.
Client should reply following, if extranonce1 is changed:

{"id": X, "result": true, "error": null}\n

Uppon error, client responds back with error:

{"id": X, "result": false, "error": [20, "Error message here.", null]}\n

Client MUST always respond back to server's request. This is important, so server can know how to
act on client that failed to change extranonce1 (in most cases, reconnect will be needed).

Payment is 1 BTC for the job with everything above working correctly (tested).

My reputation thread: https://bitcointalk.org/index.php?topic=392425.0

Previous job I offered: https://bitcointalk.org/index.php?topic=548984 (was completed and paid)

1715364255
Hero Member
*
Offline Offline

Posts: 1715364255

View Profile Personal Message (Offline)

Ignore
1715364255
Reply with quote  #2

1715364255
Report to moderator
1715364255
Hero Member
*
Offline Offline

Posts: 1715364255

View Profile Personal Message (Offline)

Ignore
1715364255
Reply with quote  #2

1715364255
Report to moderator
1715364255
Hero Member
*
Offline Offline

Posts: 1715364255

View Profile Personal Message (Offline)

Ignore
1715364255
Reply with quote  #2

1715364255
Report to moderator
"You Asked For Change, We Gave You Coins" -- casascius
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715364255
Hero Member
*
Offline Offline

Posts: 1715364255

View Profile Personal Message (Offline)

Ignore
1715364255
Reply with quote  #2

1715364255
Report to moderator
elbandi
Hero Member
*****
Offline Offline

Activity: 525
Merit: 529


View Profile
April 22, 2014, 11:05:53 PM
 #2

PM'ed
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!