Bitcoin Forum
December 02, 2016, 08:20:00 PM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 [52] 53 54 55 56 57 58 59 60 »
  Print  
Author Topic: An (even more) optimized version of cpuminer (pooler's cpuminer, CPU-only)  (Read 1528037 times)
pooler
Hero Member
*****
Offline Offline

Activity: 644


View Profile
May 24, 2014, 05:09:48 PM
 #1021

Interesting... :-( Is it possible to test availability of submitblock method by a submit of random data after cpuminer start?

It is certainly possible, but it would be a bit pointless in my opinion. If a server provides a getblocktemplate method but no submitblock method, then it is violating the official specifications.

BTC: 15MRTcUweNVJbhTyH5rq9aeSdyigFrskqE · LTC: LTCPooLqTK1SANSNeTR63GbGwabTKEkuS7
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1480710000
Hero Member
*
Offline Offline

Posts: 1480710000

View Profile Personal Message (Offline)

Ignore
1480710000
Reply with quote  #2

1480710000
Report to moderator
1480710000
Hero Member
*
Offline Offline

Posts: 1480710000

View Profile Personal Message (Offline)

Ignore
1480710000
Reply with quote  #2

1480710000
Report to moderator
1480710000
Hero Member
*
Offline Offline

Posts: 1480710000

View Profile Personal Message (Offline)

Ignore
1480710000
Reply with quote  #2

1480710000
Report to moderator
PSL
Member
**
Offline Offline

Activity: 113


View Profile
May 24, 2014, 05:19:11 PM
 #1022

Interesting... :-( Is it possible to test availability of submitblock method by a submit of random data after cpuminer start?

It is certainly possible, but it would be a bit pointless in my opinion. If a server provides a getblocktemplate method but no submitblock method, then it is violating the official specifications.

I checked that Powercoin has really no code to support submitblock method. But it supports getblocktemplate method... XENcoin has newer code than Powercoin but it is similar case. Craftcoin is even newer but has similar problem... :-(

BTW, the submitblock method is defined in source file src/bitcoinrpc.cpp. If it is not there, coin cannot accept GBT blocks.
PSL
Member
**
Offline Offline

Activity: 113


View Profile
May 24, 2014, 09:40:10 PM
 #1023

I patched Powercoin with submitblock; I get the code from Noblecoin... I am not sure that the patch is perfect but it "works", I can mine in GBT mode. I see these problems now:

1) block is accepted but it is not assigned to address defined by cpuminer (listreceivedbyaddress reports 0.00)
2) block is added to total balance and it is visible in listtransactions
3) cpuminer reports this:
Code:
[2014-05-24 20:38:13] accepted: 0/1 (0.00%), 4.24 khash/s (booooo)

And these are details:
Code:
[2014-05-24 20:38:13] DEBUG: hash <= target
Hash:   0000011765198ac5ad42387fa26ced7b4ca049e17f6c2bef46f316a0379c5a06
Target: 000001d950000000000000000000000000000000000000000000000000000000
[2014-05-24 20:38:13] JSON protocol request:
{"method": "submitblock", "params": ["0100000007ee5bd17c4de91cf366b17a1f7972f6e7
b3554fb30d10df961e6a861601797373c351cf872223622531d84580ee236be2ff11016d9bfff875
5bacd4a1060fe514e7805350d9011ec0000112010100000001000000000000000000000000000000
0000000000000000000000000000000000ffffffff140318c9020f3536323663633765062f503253
482fffffffff0100286bee000000001976a91494049e424a5cdcfdb0bb3b07fee1abecfda382cc88
ac00000000"], "id":1}

* Re-using existing connection! (#0) with host testcoin
* Connected to testcoin (192.168.222.80) port 9863 (#0)
* Server auth using Basic with user 'PWC'
> POST / HTTP/1.1
Authorization: Basic UFdDOnJwY1BTTHBhc3M=
Host: testcoin:9863
Accept-Encoding: deflate, gzip
Content-Type: application/json
Content-Length: 423
User-Agent: cpuminer/2.4
X-Mining-Extensions: midstate

< HTTP/1.1 200 OK
< Date: Sat, 24 May 2014 18:39:02 +0000
< Connection: keep-alive
< Content-Length: 36
< Content-Type: application/json
< Server: powercoin-json-rpc/v0.6.3.0-unk-beta
<
* Connection #0 to host testcoin left intact
[2014-05-24 20:38:13] JSON protocol response:
{
   "error": null,
   "result": true,
   "id": 1
}
[2014-05-24 20:38:13] accepted: 0/1 (0.00%), 4.24 khash/s (booooo)

Is there some explanation, why cpuminer reports 0/1 (0.00%) and not 1/1 (100.00%)??
pooler
Hero Member
*****
Offline Offline

Activity: 644


View Profile
May 24, 2014, 10:15:23 PM
 #1024

Code:
[2014-05-24 20:38:13] JSON protocol response:
{
   "error": null,
   "result": true,
   "id": 1
}
[2014-05-24 20:38:13] accepted: 0/1 (0.00%), 4.24 khash/s (booooo)

The server implementation you are using is faulty. According to the specs, submitblock should never return a result of "true".
The result must be "null" when a submitted block is accepted, and that's why cpuminer considers any other result as a rejection. ("accepted: 0/1" means that you submitted 1 blocks, and 0 of them got accepted.)

BTC: 15MRTcUweNVJbhTyH5rq9aeSdyigFrskqE · LTC: LTCPooLqTK1SANSNeTR63GbGwabTKEkuS7
PSL
Member
**
Offline Offline

Activity: 113


View Profile
May 25, 2014, 07:48:08 PM
 #1025

I found that Franko (FRK) coin works in GBT mode well.

I tried to mine with several cpuminers those were mining to the same address and had no signature configured and those miners were finding different blocks, I was not observing collisions. I still don't understand that signature feature...
pooler
Hero Member
*****
Offline Offline

Activity: 644


View Profile
May 25, 2014, 08:53:02 PM
 #1026

I tried to mine with several cpuminers those were mining to the same address and had no signature configured and those miners were finding different blocks, I was not observing collisions. I still don't understand that signature feature...
It is actually pretty easy to produce a collision if the difficulty is low enough: just start two miners of about the same speed and try to keep the getblocktemplate calls synchronized. That way the two miners will be working on the exact same headers (same timestamp, same merkle root hash).
Out of curiosity, I tried this just now on the Litecoin testnet, and I was able to obtain a double submission (one accepted, one rejected) within a few minutes.

BTC: 15MRTcUweNVJbhTyH5rq9aeSdyigFrskqE · LTC: LTCPooLqTK1SANSNeTR63GbGwabTKEkuS7
PSL
Member
**
Offline Offline

Activity: 113


View Profile
May 26, 2014, 10:24:45 AM
 #1027

I want to report, that cpuminer found a block and I cannot see it in the "listtransactions" report... I mined Franko (FRK), GBT mode with address and no signature. I don't have cpuminer detail log but I have debug.log from frankod. cpuminer and server are running on the same PC. From the log file I have I assume it is some problem with frankod...

cpuminer:
Code:
[2014-05-25 16:54:33] 4 miner threads started, using 'scrypt' algorithm.
[2014-05-26 07:13:06] accepted: 1/1 (100.00%), 15.11 khash/s (yay!!!)

debug.log (frankod):
Code:
(2014-05-26 07:12:58)
received block 4ab88852eb336e3a41b69deb2ef2839f67ef42fc3c91c99b818234aa590321f0
Difficulty Retarget - Kimoto Gravity Well
PastRateAdjustmentRatio = 0.914426
Before: 1d012d37  000000012d370000000000000000000000000000000000000000000000000000
After:  1d012d2c  000000012d2c5e4c2f497d0fd4dc657cc90a0638d3d2ecd9a1906b4b6c9bb015
Committing 1 changed transactions to coin database...
SetBestChain: new best=4ab88852eb336e3a41b69deb2ef2839f67ef42fc3c91c99b818234aa590321f0  height=741280  log2_work=51.204934  tx=866957  date=2014-05-26 05:12:58 progress=0.999998
ProcessBlock: ACCEPTED
getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500

ThreadRPCServer method=submitblock

Difficulty Retarget - Kimoto Gravity Well
PastRateAdjustmentRatio = 0.914426
Before: 1d012d37  000000012d370000000000000000000000000000000000000000000000000000
After:  1d012d2c  000000012d2c5e4c2f497d0fd4dc657cc90a0638d3d2ecd9a1906b4b6c9bb015
ProcessBlock: ACCEPTED
getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
CreateNewBlock(): total size 1000
Difficulty Retarget - Kimoto Gravity Well
PastRateAdjustmentRatio = 0.919932
Before: 1d012d2c  000000012d2c0000000000000000000000000000000000000000000000000000
After:  1d012b8b  000000012b8b374f0329161f9add3c0ca4587e6b74f0329161f9add3c0ca4585

(2014-05-26 07:13:02)
received block b17f7ab98a1fe9739ddecba1fb992b61cc12ab8438390ee54d62bfddb99cbe6b
Difficulty Retarget - Kimoto Gravity Well
PastRateAdjustmentRatio = 0.919932
Before: 1d012d2c  000000012d2c0000000000000000000000000000000000000000000000000000
After:  1d012b8b  000000012b8b374f0329161f9add3c0ca4587e6b74f0329161f9add3c0ca4585
Committing 1 changed transactions to coin database...
SetBestChain: new best=b17f7ab98a1fe9739ddecba1fb992b61cc12ab8438390ee54d62bfddb99cbe6b height=741281  log2_work=51.204936  tx=866958  date=2014-05-26 05:13:02 progress=0.999992
ProcessBlock: ACCEPTED

Block founded by my cpuminer should be between blocks 741280 add 741281 but it is not there. I see ProcessBlock: ACCEPTED but block is missing and I cannot explain it...
Code:
$ frankod getblockhash 741280
4ab88852eb336e3a41b69deb2ef2839f67ef42fc3c91c99b818234aa590321f0
$ frankod getblockhash 741281
b17f7ab98a1fe9739ddecba1fb992b61cc12ab8438390ee54d62bfddb99cbe6b

After this experience, I will mine with --no-gbt parameter...

I found similar situation when block was really accepted. debug.log is different in this case, I see message Committing 1 changed transactions to coin database...:
Code:
received getdata for: block 10718ea1b6085cd6dd23b885432299e2b6caca83f3ae31fc7899c90dd41cc7b2
getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
ThreadRPCServer method=submitblock
Difficulty Retarget - Kimoto Gravity Well
PastRateAdjustmentRatio = 0.96709
Before: 1d013248  0000000132480000000000000000000000000000000000000000000000000000
After:  1d01319b  00000001319ba70336589c6b80db65bd2a63711babab573fca3edee7e2639b2b
AddToWallet 028ebced569d05b28f8fc4c79eaeb5753da593025b2fd8cccceba625faccef05  new
Committing 1 changed transactions to coin database...
SetBestChain: new best=5453e3528d550b8fd297cc6f3780b25a3aab3a97f3a5b6a8c2ab6d18a3cbe4b9  height=739480  log2_work=51.200899  tx=864616  date=2014-05-25 14:03:53 progress=0.999998
ProcessBlock: ACCEPTED
komozinek
Newbie
*
Offline Offline

Activity: 3


View Profile
May 26, 2014, 02:33:41 PM
 #1028

Hi guys, pls, can anyone help me ?

I want to mine X11 with this miner and i am geting error (in link) Sad Any ideas what to do ?

http://jyxo.info/uploads/18/1832c867aeb97b0cb5702fcadbeead5f6db31929.jpg
Massimo80
Full Member
***
Offline Offline

Activity: 168


View Profile
May 26, 2014, 03:04:33 PM
 #1029

Hi guys, pls, can anyone help me ?

I want to mine X11 with this miner and i am geting error (in link) Sad Any ideas what to do ?

http://jyxo.info/uploads/18/1832c867aeb97b0cb5702fcadbeead5f6db31929.jpg

Where did you get the impression cpuminer supports X11?!? Huh
usao
Hero Member
*****
Online Online

Activity: 602


View Profile
May 27, 2014, 10:56:25 PM
 #1030

Does minerd support X11 coins or Scrypt only?
qhy
Jr. Member
*
Offline Offline

Activity: 45


View Profile
May 28, 2014, 03:08:32 AM
 #1031

Does minerd support X11 coins or Scrypt only?

yes,  i want to know whether cpu minerd suppport x11 coins or not?

and who can tell me which cpu minerd support x11??

[ANN] PixxCoin | PoS | Free IPO
FootballCoin:Fpy9FoAqzAS61Nfi2rtWvQWB8YM1Cujbgu
pooler
Hero Member
*****
Offline Offline

Activity: 644


View Profile
May 28, 2014, 06:42:09 AM
 #1032

I want to mine X11 with this miner and [...]
Does minerd support X11 coins or Scrypt only?
Please read the FAQ in the first post.

and who can tell me which cpu minerd support x11??
Google.

BTC: 15MRTcUweNVJbhTyH5rq9aeSdyigFrskqE · LTC: LTCPooLqTK1SANSNeTR63GbGwabTKEkuS7
konradp
Full Member
***
Offline Offline

Activity: 126


View Profile
June 12, 2014, 10:21:09 AM
 #1033

Hi Pooler and everybody who understands the code:)! May I have a few questions?

I'm trying to analyze your code. I need to do that to create a pool. I have problems with understanding "difficulty", but please bear in mind that I read all(?) available sources related to this topic. Btw - My job is limited to stratum functionality.

1. I understand that stratum_gen_work function (cpu-miner.c) generates a new "work" when we reached max value of nonce. But what are the values in lines 692 & 693:
work->data[20] = 0x80000000;
work->data[31] = 0x00000280;
What these values do?

2. Where is the code responsible for finding a hash? In cpu-miner.c (line 780) I can see this:
work.data[19]++
It looks like incrementing nonce. But I can't see a place where you actually generate a hash and then send it to a pool server. I mean I can see a function called workio_submit_work which takes struct workio_cmd as an argument, but there is no hash variable in it.

I would be very grateful for answering these questions.

kmsalex
Member
**
Offline Offline

Activity: 99


Learn as you go...


View Profile
June 13, 2014, 03:43:41 AM
 #1034

Is scrypt n:2048 supported? I don't see any way to lunch it in the usage instructions...
konradp
Full Member
***
Offline Offline

Activity: 126


View Profile
June 13, 2014, 04:59:06 AM
 #1035

Thanks for the interest.

The algorithm in use is sha256d.

Pooler already answered my questions on github:
Quote
1. Those values are part of standard SHA-2 padding. You need not worry about them.
2. Hashing is delegated to the scanhash_* functions.

I'm analyzing the scanhash_sha256d function now, and I'll probably have more questions:)
usao
Hero Member
*****
Online Online

Activity: 602


View Profile
June 13, 2014, 05:05:17 AM
 #1036

Forgive my ignorance, but what algos are supported? I dont see a list in the OP...
konradp
Full Member
***
Offline Offline

Activity: 126


View Profile
June 13, 2014, 05:08:26 AM
 #1037

Forgive my ignorance, but what algos are supported? I dont see a list in the OP...
AFAIK scrypt and sha256d
konradp
Full Member
***
Offline Offline

Activity: 126


View Profile
June 13, 2014, 05:17:18 AM
 #1038

Do you guys know what stratum_gen_work function does? (cpu-miner.c -> line 653).
For example I don't understand the purpose of this line:
/* Increment extranonce2 */
   for (i = 0; i < sctx->xnonce2_size && !++sctx->job.xnonce2; i++);
usao
Hero Member
*****
Online Online

Activity: 602


View Profile
June 13, 2014, 05:18:17 AM
 #1039

Forgive my ignorance, but what algos are supported? I dont see a list in the OP...
AFAIK scrypt and sha256d
So, no X11 or X13 support?
Does anyone know where I can find a X11 or X13 miner?
pooler
Hero Member
*****
Offline Offline

Activity: 644


View Profile
June 13, 2014, 08:04:02 AM
 #1040

Do you guys know what stratum_gen_work function does? (cpu-miner.c -> line 653).
For example I don't understand the purpose of this line:
/* Increment extranonce2 */
   for (i = 0; i < sctx->xnonce2_size && !++sctx->job.xnonce2; i++);

As stated in the comment, that line increments the extranonce2 field so that every time that new work is generated it is different. See the Stratum protocol specifications.

BTC: 15MRTcUweNVJbhTyH5rq9aeSdyigFrskqE · LTC: LTCPooLqTK1SANSNeTR63GbGwabTKEkuS7
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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 [52] 53 54 55 56 57 58 59 60 »
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!