Bitcoin Forum
April 25, 2024, 01:40:28 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 [24] 25 26 27 28 29 30 31 32 33 34 35 »
  Print  
Author Topic: [ANN] Stratum mining protocol - ASIC ready  (Read 145767 times)
Luke-Jr
Legendary
*
Offline Offline

Activity: 2576
Merit: 1186



View Profile
February 15, 2013, 02:43:26 AM
Last edit: February 15, 2013, 03:52:33 AM by Luke-Jr
 #461

Anyone care to review mining.resume support for Eloipool? Also live on Eligius ( stratum+tcp://mining.eligius.st:3334 ) for direct testing..

1714009228
Hero Member
*
Offline Offline

Posts: 1714009228

View Profile Personal Message (Offline)

Ignore
1714009228
Reply with quote  #2

1714009228
Report to moderator
The grue lurks in the darkest places of the earth. Its favorite diet is adventurers, but its insatiable appetite is tempered by its fear of light. No grue has ever been seen by the light of day, and few have survived its fearsome jaws to tell the tale.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714009228
Hero Member
*
Offline Offline

Posts: 1714009228

View Profile Personal Message (Offline)

Ignore
1714009228
Reply with quote  #2

1714009228
Report to moderator
1714009228
Hero Member
*
Offline Offline

Posts: 1714009228

View Profile Personal Message (Offline)

Ignore
1714009228
Reply with quote  #2

1714009228
Report to moderator
-ck
Legendary
*
Offline Offline

Activity: 4088
Merit: 1631


Ruu \o/


View Profile WWW
February 15, 2013, 07:11:45 AM
 #462

miner will call mining.resume('session-id') instead of mining.subscribe(...).
Also can you elaborate on the exact format of mining.subscribe with an example please? I'll inevitably get it wrong if I don't see a sample.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
slush (OP)
Legendary
*
Offline Offline

Activity: 1386
Merit: 1097



View Profile WWW
February 15, 2013, 11:08:42 AM
 #463

If mining.resume is successful, does this mean the miner does not need to do mining.authorize afterwards?

Yes. If pool returns true for the call, it means the connection can continue like if it wasn't interrupted (so no authorization is needed).

This is current response of mining.subscribe():

Code:
{"id": 1, "result": [[], "08000002", 4], "error": null}\n

This is response containing session id:
Code:
{"id": 1, "result": [[], "08000002", 4, "some-session-id"], "error": null}\n

This is also valid response of the server, but no session id is given, so no resume is available:
Code:
{"id": 1, "result": [[], "08000002", 4, null], "error": null}\n

-ck
Legendary
*
Offline Offline

Activity: 4088
Merit: 1631


Ruu \o/


View Profile WWW
February 15, 2013, 11:18:08 AM
 #464

If mining.resume is successful, does this mean the miner does not need to do mining.authorize afterwards?

Yes. If pool returns true for the call, it means the connection can continue like if it wasn't interrupted (so no authorization is needed).

This is current response of mining.subscribe():

Code:
{"id": 1, "result": [[], "08000002", 4], "error": null}\n

This is response containing session id:
Code:
{"id": 1, "result": [[], "08000002", 4, "some-session-id"], "error": null}\n

This is also valid response of the server, but no session id is given, so no resume is available:
Code:
{"id": 1, "result": [[], "08000002", 4, null], "error": null}\n

Thanks.

In the preliminary support in rEligius, wizkid tells me they still expect mining.authorize after mining.resume, and then they sent a new session-id which seems counterintuitive to me?

Code:
 [2013-02-15 22:03:25] SEND: {"id": 2, "method": "mining.resume", "params": ["08000000"]}                    
 [2013-02-15 22:03:26] RECVD: {"result": true, "id": 2, "error": null}                   
 [2013-02-15 22:03:26] Resumed stratum connection to pool 0                   
 [2013-02-15 22:03:26] SEND: {"id": 3, "method": "mining.subscribe", "params": []}                   
 [2013-02-15 22:03:26] RECVD: {"result": [[["mining.notify", "090000001"], ["mining.set_difficulty", "090000002"]], "09000000", 4, "09000000"], "id": 3, "error": null}         

I would have expected that mining.resume is enough without needing authorise, and then there would be no new mining.notify, and the sessionid would be the same.

Are there any security implications with allowing a miner to reconnect without re-authorising? I can't think of anything significant.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
slush (OP)
Legendary
*
Offline Offline

Activity: 1386
Merit: 1097



View Profile WWW
February 15, 2013, 11:45:15 AM
 #465

Why are you sending mining.subscribe after mining.resume??

I don't think there's any security issue. If the "attacker" knows the session id, then he obviously also known passwords used by workers for authentication.

-ck
Legendary
*
Offline Offline

Activity: 4088
Merit: 1631


Ruu \o/


View Profile WWW
February 15, 2013, 12:07:59 PM
 #466

Why are you sending mining.subscribe after mining.resume??

I don't think there's any security issue. If the "attacker" knows the session id, then he obviously also known passwords used by workers for authentication.
My mistake about redoing mining-subscribe. Fixed in git.

I will await to see what others have to say about needing to re-authorise since the only implementation currently does expect it.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
Luke-Jr
Legendary
*
Offline Offline

Activity: 2576
Merit: 1186



View Profile
February 15, 2013, 12:21:10 PM
 #467

Without mining.authorize, it would be easy for someone to hijack a session just by guessing its session id.

I'd actually prefer requiring mining.authorize before a resume, since that would enable disconnecting a prior (dead?) connection.
Right now, mining.resume will fail if a connection is still using the session id...

slush (OP)
Legendary
*
Offline Offline

Activity: 1386
Merit: 1097



View Profile WWW
February 15, 2013, 12:33:12 PM
 #468

Without mining.authorize, it would be easy for someone to hijack a session just by guessing its session id.

That's the matter of implementation. Put some hash into the session id and you're safe.

Quote
Right now, mining.resume will fail if a connection is still using the session id

This also depends on implementation. You can forcibly close all other connections once some connection tries to resume with the same session id.


-ck
Legendary
*
Offline Offline

Activity: 4088
Merit: 1631


Ruu \o/


View Profile WWW
February 15, 2013, 01:19:10 PM
 #469

Well, an extra authorise request is no big deal, so for the moment, that's how I've implemented it in cgminer. So most of the mining.resume support is now in the master git branch for cgminer.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
zvs
Legendary
*
Offline Offline

Activity: 1680
Merit: 1000


https://web.archive.org/web/*/nogleg.com


View Profile WWW
February 15, 2013, 06:06:23 PM
 #470

Stratum seems to cause a lot of problems w/ my systems with crappy CPU and 4+ GPUs....  they jump between 95-99% activity, and I can visibly see cursor jumping around... doesn't happen with longpolling

is there something that would help w/ this?  i've already tried turning off DCA and killed off all but the 5 or 6 essential services (all run windows)

ed: i'm speaking of p2pool only in regard to long poll vs stratum.  p2pool has a lot more stratum requests than a normal pool would, i guess
slush (OP)
Legendary
*
Offline Offline

Activity: 1386
Merit: 1097



View Profile WWW
February 15, 2013, 06:09:25 PM
 #471

is there something that would help w/ this?  i've already tried turning off DCA and killed off all but the 5 or 6 essential services (all run windows)

What miner are you using? Basically there's no reason for issues like this just because of switching from getwork to stratum...

zvs
Legendary
*
Offline Offline

Activity: 1680
Merit: 1000


https://web.archive.org/web/*/nogleg.com


View Profile WWW
February 15, 2013, 06:12:51 PM
 #472

is there something that would help w/ this?  i've already tried turning off DCA and killed off all but the 5 or 6 essential services (all run windows)

What miner are you using? Basically there's no reason for issues like this just because of switching from getwork to stratum...

cgminer, with intensity all at 7...  it possibly wouldnt occur on something other than p2pool. 

but i have used p2pool w/ both stratum & without and i don't get the short freezes when not using it.   

hmm, would nagle being disabled have some effect more on stratum than on getwork?
zvs
Legendary
*
Offline Offline

Activity: 1680
Merit: 1000


https://web.archive.org/web/*/nogleg.com


View Profile WWW
February 15, 2013, 07:08:35 PM
Last edit: February 15, 2013, 07:28:59 PM by zvs
 #473

OK, I made 3 screenshots, ignore all the core clocks and stuff that afterburner is showing (i only use it for temperature/usage monitoring and sometimes voltage).. the one computer is using catalyst 11.12 because of 5 gpu.  

i would have taken a screenshot of a computer similar to the 3rd (that is using catalyst 12.1) that showed GPU bumping around but i have all usb slots disabled in bios on that one and didnt want to reboot it... it's using catalyst 12.1 with crappy sempron and 3 gpu

the first, the GPU usage dipped just a little bit (where it has that big drop, that was just me doing something)..  that is on a dual core 3.2ghz (underclocked to 2.0ghz or so but didnt disable a core)


 
(^^ ed: I just looked at that more closely and not sure wtf happened there at the end, with the restart being overwritten)

the second, this is my main computer, i7 etc



the third, this is a Sempron, 3ghz?  maybe 3.2ghz...  the drops seem to coincide with the stratum restarts (the "somewhat" flat period was the 20 seconds or so with no restarts)



all intensities are at 7, and, yes, i get a lot of rejects (this is common to both, so nothing about stratum there).. 180ms to server, but better than using my home connection that has no upstream bandwidth




BitcoinOxygen
Sr. Member
****
Offline Offline

Activity: 336
Merit: 250



View Profile WWW
February 15, 2013, 09:35:47 PM
 #474

Anyone care to review mining.resume support for Eloipool? Also live on Eligius ( stratum+tcp://mining.eligius.st:3334 ) for direct testing..

It would be nice if you could add some comments to your code.

BTCOxygen PPS Mining Pool 2% Fee  <<<  Join Now
Luke-Jr
Legendary
*
Offline Offline

Activity: 2576
Merit: 1186



View Profile
February 19, 2013, 08:52:44 PM
 #475

Regarding mining.resume...
The proposed mining.resume protocol breaks stratum proxy, and cgminer's implementation is full of bugs, so I've decided to put off merging it to Eloipool master for now pending some kind of revision to deal with these bugs.

Regarding client.get_version...
Sadly, I've also found I cannot simply disable it based on client.get_version response - apparently requesting this information before initialization has completed breaks cgminer.
The only solution I can think of to deal with this bug is to have newer clients send their version unsolicited before trying to subscribe.

Regarding a default difficulty request...
Another feature request (which I have to note has been specified in GBT for a year now) is the ability for miners to send a default difficulty/target to the server.
Since clients are subscribing before authorizing, there's no reliable way to abuse to username/password for this purpose.
I propose clients simply send a mining.set_difficulty to the server when they connect, before subscribing, and adopt it only if the server replies with a true result.

Thoughts on any of these?

eleuthria
Legendary
*
Offline Offline

Activity: 1750
Merit: 1007



View Profile
February 19, 2013, 09:11:15 PM
 #476

Regarding mining.resume...
The proposed mining.resume protocol breaks stratum proxy, and cgminer's implementation is full of bugs, so I've decided to put off merging it to Eloipool master for now pending some kind of revision to deal with these bugs.

Regarding client.get_version...
Sadly, I've also found I cannot simply disable it based on client.get_version response - apparently requesting this information before initialization has completed breaks cgminer.
The only solution I can think of to deal with this bug is to have newer clients send their version unsolicited before trying to subscribe.

Regarding a default difficulty request...
Another feature request (which I have to note has been specified in GBT for a year now) is the ability for miners to send a default difficulty/target to the server.
Since clients are subscribing before authorizing, there's no reliable way to abuse to username/password for this purpose.
I propose clients simply send a mining.set_difficulty to the server when they connect, before subscribing, and adopt it only if the server replies with a true result.

Thoughts on any of these?

I've felt that the client should send their name/version unsolicited with the initial subscription from the start.  It makes sense for the client to push that data, rather than the server to ask for it explicitly.  It's just a few bytes sent once.

RIP BTC Guild, April 2011 - June 2015
jborkl
Sr. Member
****
Offline Offline

Activity: 246
Merit: 250


Team Heritage Motorsports


View Profile WWW
February 19, 2013, 10:30:23 PM
 #477

Luke, I thought you were still using this full of bugs codebase.....?

Luke , have you submitted a support ticket to Con, so he can help you out?

User defined Stratum diff is already available. So I don't see the rush to implement it into a miner.

-ck
Legendary
*
Offline Offline

Activity: 4088
Merit: 1631


Ruu \o/


View Profile WWW
February 19, 2013, 10:33:49 PM
 #478

Luke, I thought you were still using this full of bugs codebase.....?

Luke , have you submitted a support ticket to Con, so he can help you out?
He submitted 2 bugfixes, I took them. After that... no idea, but then I go out of my way to make myself uncontactable by him, but somehow he still gets through. I'm in a quandary here if I'm to fix bugs he reports but I don't give him a way to report them apart from random attacks on the codebase in the forum as quoted by someone else. If he could stop with the mindless attacks and other crap, I'd listen and he'd have a way, but I can't sift through his noise because it really is a mindfuck.

I really should give up, this is doing my head in.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
Luke-Jr
Legendary
*
Offline Offline

Activity: 2576
Merit: 1186



View Profile
February 19, 2013, 10:53:00 PM
 #479

Luke, I thought you were still using this full of bugs codebase.....?
Fixing bugs as I find them, but Eloipool still has to support cgminer for now.

Luke , have you submitted a support ticket to Con, so he can help you out?
Feel free to pass it on to him. The details on the mining.resume bug lie in send() succeeding even when the packets don't actually reach their destination, and cgminer leaking the sshare object since it never gets a response.
BFGMiner's codebase is too different from cgminer's in the relevant code, so if this gets fixed it can be the first cgminer-unique feature until I get a chance to write a version for BFGMiner. Wink

nathanrees19
Full Member
***
Offline Offline

Activity: 196
Merit: 100



View Profile
February 19, 2013, 10:54:10 PM
 #480

Quote
cgminer's implementation is

This unjustified assertion has no place in this thread.

Quote
Sadly, I've also found I cannot simply disable it based on client.get_version response - apparently requesting this information before initialization has completed breaks

It's normal for things to break if you hammer them with requests before initialization is finished.

Quote
The only solution I can think of to deal with this bug is to have newer clients send their version unsolicited before trying to subscribe.

This is surprisingly not a bad idea.

Quote
Another feature request (which I have to note has been specified in GBT for a year now)

There's no need to beat a dead horse here.

Quote
is the ability for miners to send a default difficulty/target to the server.

It should be up to the server to decide what rate of shares it can accept, but if an unsolicited client version is to be added, then perhaps a "suggested minimum difficulty" could be added as well.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 [24] 25 26 27 28 29 30 31 32 33 34 35 »
  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!