Describe the bug
~sh
$ ~/src/ethminer/build/ethminer/ethminer -U --cuda-devices 0 -P http://127.0.0.1:8485
...
i 16:43:01 cuda-0 *Accepted 1 ms. 127.0.0.1
i 16:43:01 cuda-0 Solution: 0x958c867362f2b804
i 16:43:01 cuda-0 *Accepted 1 ms. 127.0.0.1
i 16:43:01 cuda-0 Solution: 0x958c867362f6354e
i 16:43:01 cuda-0 **Accepted 0 ms. 127.0.0.1
i 16:43:01 cuda-0 Solution: 0x958c867362f6c453
X 16:43:01 getwork Failed getting work!
i 16:43:01 main Disconnected from 127.0.0.1
Segmentation fault (core dumped)
~
To Reproduce
Steps to reproduce the behavior:
my test-genesis.json (with low difficulty)
~
{
"config": {
"chainId": 1347,
"homesteadBlock":0,
"eip155Block":0,
"eip158Block":0,
"progpowBlock":null,
"ethash": { }
},
"difficulty": "0x2000", // "0x20000" also tested
"timestamp": "0x5be6530c",
"nonce": "0x0000000000000042",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x",
"gasLimit": "3141592",
"alloc": { }
}
}
~
gethethminer with getwork parametersExpected behavior
before 0.15.0.dev11 (?) it works nicely, but after some libpoolprotocols updates, it broken.
Screenshots (Optional)

Desktop (please complete the following information):
I've recently completed a test work to refactor completely Getwork.
If you're able to build from source could you please test this fork ?
https://github.com/AndreaLanfranchi/ethminer
~~~sh
$ ethminer -U --cuda-devices 0 -P http://127.0.0.1:8485
ethminer 0.17.0.dev0-96+commit.ab4fd644.dirty
Build: linux/release/gnu
cu 18:35:27 ethminer Using grid size: 8,192, block size: 128, streams: 2 parallel hashes : 4
i 18:35:27 ethminer Configured pool 127.0.0.1:8485
i 18:35:27 ethminer Selected pool 127.0.0.1:8485
i 18:35:27 ethminer Established connection to 127.0.0.1:8485
i 18:35:27 ethminer Spinning up miners...
X 18:35:27 ethminer 127.0.0.1:8485 reported status 400 Bad Request
i 18:35:27 ethminer Disconnected from 127.0.0.1:8485
i 18:35:27 ethminer No connection. Suspend mining ...
i 18:35:27 ethminer Selected pool 127.0.0.1:8485
i 18:35:27 ethminer Established connection to 127.0.0.1:8485
i 18:35:27 ethminer Resume mining ...
X 18:35:27 ethminer 127.0.0.1:8485 reported status 400 Bad Request
i 18:35:27 ethminer Disconnected from 127.0.0.1:8485
i 18:35:27 ethminer No connection. Suspend mining ...
i 18:35:27 ethminer Selected pool 127.0.0.1:8485
i 18:35:27 ethminer Established connection to 127.0.0.1:8485
i 18:35:27 ethminer Resume mining ...
X 18:35:27 ethminer 127.0.0.1:8485 reported status 400 Bad Request
i 18:35:27 ethminer Disconnected from 127.0.0.1:8485
i 18:35:27 ethminer No connection. Suspend mining ...
i 18:35:27 ethminer No more connections to try. Exiting...
i 18:35:27 ethminer Shutting down miners...
i 18:35:27 main Signal intercepted ...
i 18:35:27 ethminer Terminated!
~~~
There is something wrong with your Geth node.
It responds with HTTP status 400 to ethminer's requests.
From a command prompt try execute
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getWork","params":[],"id":1}' http://127.0.0.1:8545
and report output
this is my test curl script. (with geth v1.8.17)
curl -i --header "Content-Type: application/json" -X POST --data '{"worker": "foobar", "jsonrpc":"2.0","id":1,"method":"eth_getWork","params":[]}'
and the result
{"jsonrpc":"2.0","id":1,"result":["0xfc7ccb8b8afb98baf95299461b82b429bfcb46081a0e1d3145f8215b96de92be","0x0000000000000000000000000000000000000000000000000000000000000000","0x00007fc01ff007fc01ff007fc01ff007fc01ff007fc01ff007fc01ff007fc01f","0x2735"]}
again, the old ethminer totally work with no problem.
this is my test curl script
Please remove the "worker" member and resubmit.
What is the output ?
~sh
NODE=http://127.0.0.1:8485
curl -i --header "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","id":1,"method":"eth_getWork","params":[]}' $NODE
~
~
{"jsonrpc":"2.0","id":1,"result":["0xfc7ccb8b8afb98baf95299461b82b429bfcb46081a0e1d3145f8215b96de92be","0x0000000000000000000000000000000000000000000000000000000000000000","0x00007fc01ff007fc01ff007fc01ff007fc01ff007fc01ff007fc01ff007fc01f","0x2735"]}
~
One last try (just to be sure).
Can you run ethminer against dwarfpool geth port ?
Use
-P http://eth-eu.dwarfpool.com:80/<yourethaddress>
and tell me what happens ?

when i append worker option, it does not emit 400 error but..

Ok that makes sense and I know where to patch. (the worker thing).
The second problem is your work notification passes a seed hash all zeroed
{
"jsonrpc": "2.0",
"id": 1,
"result": [
"0xfc7ccb8b8afb98baf95299461b82b429bfcb46081a0e1d3145f8215b96de92be",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x00007fc01ff007fc01ff007fc01ff007fc01ff007fc01ff007fc01ff007fc01f",
"0x2735"
]
}
Second element of the result array member
Thus ethminer is not able to determine epoch and, again, can't build the DAG.
I will manage this unfortunate case in code.
Nevertheless your node should output a seed hash
R u trying to implement ProgPoW on ethminer ?
as you can see, the seedhash is just fine.
~python
def get_seedhash(block):
s = '\x00' * 32
for i in range(block.number // EPOCH_LENGTH): # block.number is less then EPOCH_LENGTH in this case.
s = serialize_hash(sha3_256(s))
return s
~
R u trying to implement ProgPoW on ethminer ?
noop. but just doing some test with the ProgPoW fork (by ifelsedef) on top of the latest ethminer master branch.
I think it should run at least one time as at block 0 we're anyhow in epoch 1 (ie. we're in the first 30k blocks)
I have amended the problem bad request when there is no path in the URI.
@hackmod
I was wrong about assumption of epoch 0.
Just pushed new commit in fork.
Please try and report
works nicely!! (with or without "worker" parameter)
thank you! 馃憤
Resolved by #1704