pooler / cpuminer

CPU miner for Litecoin and Bitcoin
https://bitcointalk.org/index.php?topic=55038.0
Other
2.79k stars 1.21k forks source link

submitblock is rejected on the signet: bad-signet-blksig #238

Closed tengge1 closed 3 years ago

tengge1 commented 3 years ago

run bitcoind:

./bitcoind -signet --prune=550

run miner:

./minerd -o http://127.0.0.1:38332 -O user:pass -a sha256d -D -t 1 -P --coinbase-addr=tb1q8m5t0jq0w23zngm5lt9yvgzn4rz0sgt8t9ujdk

result:

[2021-06-26 22:43:20] JSON protocol request:
{"method": "submitblock", "params": ["000000208f168dc8921996bc8156119c083a9460641a21b4d80ec9e4b95b78896200000082c7e5288a94970361ed7447108f65c62197976687cad9c73eac6b1cb0b69163053dd760a569011e022b7f6c0301000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0403edab00ffffffff026cf3052a010000001600143ee8b7c80f72a229a374faca462053a8c4f821670000000000000000266a24aa21a9ed510389165e8c81286765c177bd4d3e69ba7d24e093e504896ea0ecde1a856b85000000000200000000010186b95774586b731fdb0079516c480d1c959e8355c664b624ecf216f71371722d0100000000feffffff028096980000000000160014b769087e085cb34f6412bb2a9350af08c0afc0c3d44176c90000000016001428ab04d264eab2a6f9eab14e86b7bbb32c4ff6b00247304402206e566375e2781bc41384e7378fb52ce36ea3c3345dcc97ede9ce710b75d2f17302205ada8210dde8c2ab5366247ff5971ebb9eec3c8fb56bd90cefcbcc55f279e8a00121022bc62f33f48b85d2ad74e4830810b8f2f95539e61efd527cac6f174ec0ce3863ecab000002000000000101f7e940712c20e16bb1980a9df4b38bb1ceb6980b637d5a7dfca59acb69181ab70000000000feffffff02c64d7bc60000000016001406b9dd3103ee70d9d6b70dfca733cce6849146b980969800000000001600142c14715d41e78762d628df7bfd371ecd11badbf20247304402203ad36f29dc213f5ce190062cd53893d41f417788a3cfe254796a3bf2f87dfba30220497a2f8c8e2917abbb1c09f8a9a00ab9965abcf7db25e87b5baa3d22cd00e37b0121034f7ada4d8b2062f3f7d21aadacabb44ad9a6176ecf4789eaa1fedf91f0f8b34eecab0000"], "id":1}

* Found bundle for host 127.0.0.1: 0x7f027000cf30 [serially]
* Can not multiplex, even if we wanted to!
* Re-using existing connection! (#0) with host 127.0.0.1
* Connected to 127.0.0.1 (127.0.0.1) port 38332 (#0)
* Server auth using Basic with user 'liteng'
> POST / HTTP/1.1
Host: 127.0.0.1:38332
Authorization: Basic bGl0ZW5nOng=
Accept-Encoding: deflate, gzip, br
Content-Type: application/json
User-Agent: cpuminer/2.5.1
X-Mining-Extensions: midstate
Content-Length: 1367

* upload completely sent off: 1367 out of 1367 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Sat, 26 Jun 2021 14:43:20 GMT
< Content-Length: 51
< 
* Connection #0 to host 127.0.0.1 left intact
[2021-06-26 22:43:20] JSON protocol response:
{
   "result": "bad-signet-blksig",
   "error": null,
   "id": 1
}
[2021-06-26 22:43:20] accepted: 0/7 (0.00%), 10999 khash/s (booooo)
[2021-06-26 22:43:20] DEBUG: reject reason: bad-signet-blksig

the bitcoind outputs:

2021-06-26T14:43:20Z ERROR: ProcessNewBlock: AcceptBlock FAILED (bad-signet-blksig, signet block signature validation failure)
pooler commented 3 years ago

https://bitcoin.stackexchange.com/questions/105364/error-generate-new-block-with-signet-test

You can't create blocks yourself for the global signet; it requires signatures by the parties running that signet.

tengge1 commented 3 years ago

Thank you very much. I create my own signet challenge: https://en.bitcoin.it/wiki/Signet:Custom:Script

I create some servers:

#!/bin/bash
bitcoind -server -listen -port=17591 -rpcuser=rpc -rpcpassword=x -rpcport=16591 -datadir=$HOME/.bitcoin/signet/A/ -connect=localhost:17592 -signet -signetchallenge=512103bb1425519423e645b7c687747d5bf6a983719b3ab6bdd39eb214f1bcca47d66751ae -daemon
bitcoind -server -listen -port=17592 -rpcuser=rpc -rpcpassword=x -rpcport=16592 -datadir=$HOME/.bitcoin/signet/B/ -connect=localhost:17593 -signet -signetchallenge=512103bb1425519423e645b7c687747d5bf6a983719b3ab6bdd39eb214f1bcca47d66751ae -daemon
bitcoind -server -listen -port=17593 -rpcuser=rpc -rpcpassword=x -rpcport=16593 -datadir=$HOME/.bitcoin/signet/C/ -connect=localhost:17594 -signet -signetchallenge=512103bb1425519423e645b7c687747d5bf6a983719b3ab6bdd39eb214f1bcca47d66751ae -daemon
bitcoind -server -listen -port=17594 -rpcuser=rpc -rpcpassword=x -rpcport=16594 -datadir=$HOME/.bitcoin/signet/D/ -connect=localhost:17595 -signet -signetchallenge=512103bb1425519423e645b7c687747d5bf6a983719b3ab6bdd39eb214f1bcca47d66751ae -daemon
bitcoind -server -listen -port=17595 -rpcuser=rpc -rpcpassword=x -rpcport=16595 -datadir=$HOME/.bitcoin/signet/E/ -connect=localhost:17591 -signet -signetchallenge=512103bb1425519423e645b7c687747d5bf6a983719b3ab6bdd39eb214f1bcca47d66751ae -daemon

generate is working now.

user@machine:~$ bitcoin-cli -signet -signetchallenge=512103bb1425519423e645b7c687747d5bf6a983719b3ab6bdd39eb214f1bcca47d66751ae -rpcuser=rpc -rpcpassword=x -rpcport=16591 -generate 1
{
  "address": "tb1qdldmr8nzy9j09zzlc8jwpcny8j7z0y8rsl8dz8",
  "blocks": [
  ]
}

But when I call getblocktemplate method, I get an error:

user@machine:~$ bitcoin-cli -signet -signetchallenge=512103bb1425519423e645b7c687747d5bf6a983719b3ab6bdd39eb214f1bcca47d66751ae -rpcuser=rpc -rpcpassword=x -rpcport=16591 getblocktemplate '{"rules": ["signet","segwit"]}'
error code: -10
error message:
Bitcoin Core is in initial sync and waiting for blocks...

I wait for a long time, and I still get the error, and I cannot mine on my own signet.

pooler commented 3 years ago

Sorry but your issue is unrelated to cpuminer. While we're on the subject, however, I should probably mention that there are no plans to add BIP325 support to cpuminer. The tooling provided with Bitcoin Core should be sufficient.

Sjors commented 5 months ago

Producing blocks for custom signets with no signature requirements is simple though, see #285.