Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest difficulty after auth to fix ckpool issue #353

Merged
merged 2 commits into from
Sep 27, 2024
Merged

Conversation

eandersson
Copy link
Collaborator

@eandersson eandersson commented Sep 26, 2024

ckpool requires that the client is authorized before suggesting a new mining difficulty.

Dropping mining.suggest_difficulty from unauthorised client 300 172.0.1.242

https://bitbucket.org/ckolivas/ckpool-solo/src/d385b74b6fec45bca2d95f33c512f2827a8d90fc/src/stratifier.c#lines-6724

@eandersson eandersson changed the title Suggest difficulty after auth to fix ckpool disconnect Suggest difficulty after auth to fix ckpool issue Sep 26, 2024
@skot
Copy link
Owner

skot commented Sep 26, 2024

Can you check this on a few other pools for compatibility? I suggest OCEAN, Braiins and maybe Luxor

@skot skot added the accepted This issue will be worked on label Sep 26, 2024
@eandersson
Copy link
Collaborator Author

eandersson commented Sep 26, 2024

Owner

Tried it on OCEAN and Braiins for now. suggest_difficulity failed on both at startup, but it was failing the same way without this patch as well.

@skot
Copy link
Owner

skot commented Sep 27, 2024

I tried this out with Nicehash, the other picky pool, IIRC. Seems to work fine (they ignore our mining.suggest_difficulty)

@skot skot merged commit e30bbca into skot:master Sep 27, 2024
1 check passed
@skot
Copy link
Owner

skot commented Sep 27, 2024

Public-pool doesn't pickup the suggest_difficulty like this. I swear it did before?

I (19198) stratum_api: tx: {"id": 1, "method": "mining.subscribe", "params": ["bitaxe/BM1368/v2.2.2-20-g0dff6f8-dirty"]}
I (19208) stratum_api: tx: {"id": 2, "method": "mining.configure", "params": [["version-rolling"], {"version-rolling.mask": "ffffffff"}]}
I (19218) stratum_api: tx: {"id": 3, "method": "mining.authorize", "params": ["bc1q....bitaxe401", "x"]}
I (19228) stratum_api: tx: {"id": 4, "method": "mining.suggest_difficulty", "params": [1000]}
I (19328) stratum_task: rx: {"id":1,"error":null,"result":[[["mining.notify","a1cc61f9"]],"a1cc61f9",4]}
I (19328) stratum_api: extranonce_str: a1cc61f9
I (19338) stratum_api: extranonce_2_len: 4
I (19338) stratum_task: rx: {"id":2,"error":null,"result":{"version-rolling":true,"version-rolling.mask":"1fffe000"}}
I (19348) stratum_api: Set version mask: 1fffe000
I (19358) stratum_task: Set version mask: 1fffe000
I (19358) stratum_task: rx: {"id":3,"error":null,"result":true}
I (19368) stratum_task: setup message accepted
I (19378) stratum_task: rx: {"id":null,"method":"mining.set_difficulty","params":[1000000]}
I (19378) stratum_task: Set stratum difficulty: 1000000
I (19388) stratum_task: rx: {"id":null,"method":"mining.notify","params":["abfb1","7c97ad6b27f3f...],"20000000","17032f14","66f73b12",true]}
I (19498) SystemModule: Syncing clock
I (19498) create_jobs_task: Set chip version rolls 65535
I (19498) stratum_task: rx: {"id":null,"method":"mining.set_difficulty","params":[1000]}
I (19508) create_jobs_task: New Work Dequeued abfb1
I (19518) stratum_task: Set stratum difficulty: 1000
I (19518) ASIC_task: New pool difficulty 1000000

@eandersson
Copy link
Collaborator Author

Public-pool doesn't pickup the suggest_difficulty like this. I swear it did before?

I (19198) stratum_api: tx: {"id": 1, "method": "mining.subscribe", "params": ["bitaxe/BM1368/v2.2.2-20-g0dff6f8-dirty"]}
I (19208) stratum_api: tx: {"id": 2, "method": "mining.configure", "params": [["version-rolling"], {"version-rolling.mask": "ffffffff"}]}
I (19218) stratum_api: tx: {"id": 3, "method": "mining.authorize", "params": ["bc1q....bitaxe401", "x"]}
I (19228) stratum_api: tx: {"id": 4, "method": "mining.suggest_difficulty", "params": [1000]}
I (19328) stratum_task: rx: {"id":1,"error":null,"result":[[["mining.notify","a1cc61f9"]],"a1cc61f9",4]}
I (19328) stratum_api: extranonce_str: a1cc61f9
I (19338) stratum_api: extranonce_2_len: 4
I (19338) stratum_task: rx: {"id":2,"error":null,"result":{"version-rolling":true,"version-rolling.mask":"1fffe000"}}
I (19348) stratum_api: Set version mask: 1fffe000
I (19358) stratum_task: Set version mask: 1fffe000
I (19358) stratum_task: rx: {"id":3,"error":null,"result":true}
I (19368) stratum_task: setup message accepted
I (19378) stratum_task: rx: {"id":null,"method":"mining.set_difficulty","params":[1000000]}
I (19378) stratum_task: Set stratum difficulty: 1000000
I (19388) stratum_task: rx: {"id":null,"method":"mining.notify","params":["abfb1","7c97ad6b27f3f...],"20000000","17032f14","66f73b12",true]}
I (19498) SystemModule: Syncing clock
I (19498) create_jobs_task: Set chip version rolls 65535
I (19498) stratum_task: rx: {"id":null,"method":"mining.set_difficulty","params":[1000]}
I (19508) create_jobs_task: New Work Dequeued abfb1
I (19518) stratum_task: Set stratum difficulty: 1000
I (19518) ASIC_task: New pool difficulty 1000000

I tested on public pool, but let me test again.

@eandersson
Copy link
Collaborator Author

Yea looks good for me at least, but this does not have all the other patches

₿ (17119) main_task: Returned from app_main()
₿ (17239) stratum_api: Resetting stratum uid
₿ (17239) stratum_task: Clean Jobs: clearing queue
₿ (17249) stratum_api: tx: {"id": 1, "method": "mining.subscribe", "params": ["bitaxe/BM1368/v2.2.2-6-ga14fd14"]}
₿ (17259) stratum_api: tx: {"id": 2, "method": "mining.configure", "params": [["version-rolling"], {"version-rolling.mask": "ffffffff"}]}
₿ (17269) stratum_api: tx: {"id": 3, "method": "mining.authorize", "params": ["x.e2", "x"]}
₿ (17279) stratum_api: tx: {"id": 4, "method": "mining.suggest_difficulty", "params": [1000]}
₿ (17589) stratum_task: rx: {"id":1,"error":null,"result":[[["mining.notify","670aad97"]],"670aad97",4]}
₿ (17589) stratum_api: extranonce_str: 670aad97
₿ (17589) stratum_api: extranonce_2_len: 4
₿ (17599) stratum_task: rx: {"id":2,"error":null,"result":{"version-rolling":true,"version-rolling.mask":"1fffe000"}}
₿ (17609) stratum_api: Set version mask: 1fffe000
₿ (17609) stratum_task: Set version mask: 1fffe000
₿ (17619) stratum_task: rx: {"id":3,"error":null,"result":true}
₿ (17629) stratum_task: setup message accepted
₿ (17629) stratum_task: rx: {"id":null,"method":"mining.set_difficulty","params":[1000]}
₿ (17639) stratum_task: Set stratum difficulty: 1000
₿ (17649) stratum_task: rx: {"id":null,"method":"mining.notify","params":
₿ (17759) SystemModule: Syncing clock
₿ (17759) create_jobs_task: New Work Dequeued 21c471
₿ (17769) create_jobs_task: Job processed and queued: 21c471
₿ (17769) ASIC_task: New pool difficulty 1000

@eandersson eandersson deleted the auth branch October 9, 2024 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted This issue will be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants