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

c-lightning: getblockhash 532924 exited with status 5 #61

Closed
Stadicus opened this issue Jul 21, 2018 · 4 comments
Closed

c-lightning: getblockhash 532924 exited with status 5 #61

Stadicus opened this issue Jul 21, 2018 · 4 comments
Labels
bug Something isn't working

Comments

@Stadicus
Copy link
Contributor

Stadicus commented Jul 21, 2018

I run sPRUNED together with c-lightning and run into the issue that c-lightning requests a block that is not yet known, sPRUNED anwers with an error and this is not what c-lightning expects.

Is there something I am missing? Or is this something that could be fixed in sPRUNED, or unexpected behaviour by c-lightning?

bitcoin ~/.lightning ฿ tail lightning.log -f
2018-07-21T08:19:27.790Z lightningd(19444): Server started with public key 0283126f4322e67b4537674ae430b5eec1d53f4725ae578b25492296deda48eccf, alias Stadicus (color #028312) and lightningd v0.6
2018-07-21T08:19:29.213Z lightningd(19444): Adding block 532909: 0000000000000000001cf197ed5d33e83ed8ecbc44cce53159ab5867b4ae150f
2018-07-21T08:19:29.370Z lightningd(19444): No fee estimate for Immediate: basing on default fee rate
2018-07-21T08:19:29.370Z lightningd(19444): Immediate feerate 2274 (was 0)
2018-07-21T08:19:29.370Z lightningd(19444): No fee estimate for Normal: basing on Immediate rate
2018-07-21T08:19:29.370Z lightningd(19444): Normal feerate 1261 (was 0)
2018-07-21T08:19:29.370Z lightningd(19444): No fee estimate for Slow: basing on Immediate rate
2018-07-21T08:19:29.370Z lightningd(19444): No fee estimate for Slow: basing on Normal rate
2018-07-21T08:19:29.370Z lightningd(19444): Slow feerate 253 (was 0)
2018-07-21T08:19:29.505Z lightningd(19444): Adding block 532910: 00000000000000000013e99ce1fa83ec4bf2307454d3689b0cd2f700b463010f
2018-07-21T08:19:30.505Z lightningd(19444): Adding block 532911: 00000000000000000002829d2b02fde402f14e001ae27036c41eff06966197a7
2018-07-21T08:19:31.415Z lightningd(19444): Adding block 532912: 000000000000000000137420a9612a5282befeaff773c4e6c1306e47b922806c
2018-07-21T08:19:31.585Z lightningd(19444): Adding block 532913: 0000000000000000001398a986bb38770a50ee0b63d5f082f63ca547688c7388
2018-07-21T08:19:32.181Z lightningd(19444): Adding block 532914: 0000000000000000001f2deba673d0bb65ac20a3690240324b0bb6bfe9286e23
2018-07-21T08:19:33.695Z lightningd(19444): Adding block 532915: 0000000000000000000ca2e1e68383ac8c94445d641dbb623f5103fc4d054cc6
2018-07-21T08:19:34.300Z lightningd(19444): Adding block 532916: 00000000000000000028b958250802a46feb931b97b1a938c016ec9b56fdd65b
2018-07-21T08:19:36.670Z lightningd(19444): Adding block 532917: 00000000000000000012b5df76ccbe6087f1645deeae639888248dff094b35a6
2018-07-21T08:19:38.974Z lightningd(19444): Adding block 532918: 0000000000000000000bb429cbf751b8ef12e2ae624b8e7a22a1dcf469e2466b
2018-07-21T08:19:41.371Z lightningd(19444): Adding block 532919: 0000000000000000002aaccac3fed5b9b010af2f48690b196a05c3618af6b18e
2018-07-21T08:19:45.792Z lightningd(19444): Adding block 532920: 000000000000000000075a60644792ce3bc800353cff0fd990f6b7dad1cab9f8
2018-07-21T08:19:47.226Z lightningd(19444): Adding block 532921: 000000000000000000013e4e5f0fd21d768c3d591a331cbba322ae1e0e4d621a
2018-07-21T08:19:58.595Z lightningd(19444): Adding block 532922: 0000000000000000002d498b00da4f1ece0322d3d33bd621cbe02651ef02073b
2018-07-21T08:20:00.286Z lightningd(19444): Adding block 532923: 000000000000000000320bb059c9271f73c12553872e721c8d1749556c7b15f1
2018-07-21T08:20:00.376Z lightningd(19444): bitcoin-cli -rpcconnect=localhost -rpcport=8332  -rpcuser=XXX -rpcpassword=XXX getblockhash 532924 exited with status 5
2018-07-21T08:20:01.384Z lightningd(19444): bitcoin-cli -rpcconnect=localhost -rpcport=8332  -rpcuser=XXX -rpcpassword=XXX getblockhash 532924 exited with status 5
2018-07-21T08:20:02.394Z lightningd(19444): bitcoin-cli -rpcconnect=localhost -rpcport=8332  -rpcuser=XXX -rpcpassword=XXX getblockhash 532924 exited with status 5
2018-07-21T08:20:03.402Z lightningd(19444): bitcoin-cli -rpcconnect=localhost -rpcport=8332  -rpcuser=XXX -rpcpassword=XXX getblockhash 532924 exited with status 5

bitcoin ~/.lightning ฿ bitcoin-cli getblockchaininfo
{
  "chainwork": null,
  "bestblockhash": "000000000000000000320bb059c9271f73c12553872e721c8d1749556c7b15f1",
  "warning": "spruned 0.0.2a2, emulating bitcoind v0.16",
  "verificationprogress": 100,
  "pruned": false,
  "headers": 532923,
  "chain": "main",
  "blocks": 532923,
  "mediantime": 1532160671,
  "difficulty": null
}

bitcoin ~/.spruned ฿ tail spruned.log
2018-07-21 08:22:31,064 - jsonrpcserver.dispatcher.request - INFO - {'method': 'estimatesmartfee', 'id': 1, 'params': [2, 'CONSERVATIVE']}
2018-07-21 08:22:31,191 - aiohttp.access - INFO - 127.0.0.1 [21/Jul/2018:08:22:31 +0000] "POST / HTTP/1.1" 200 294 "-" "-"
2018-07-21 08:22:31,193 - jsonrpcserver.dispatcher.request - INFO - {'method': 'estimatesmartfee', 'id': 1, 'params': [4, 'ECONOMICAL']}
2018-07-21 08:22:31,317 - aiohttp.access - INFO - 127.0.0.1 [21/Jul/2018:08:22:31 +0000] "POST / HTTP/1.1" 200 294 "-" "-"
2018-07-21 08:22:31,319 - jsonrpcserver.dispatcher.request - INFO - {'method': 'estimatesmartfee', 'id': 1, 'params': [100, 'ECONOMICAL']}
2018-07-21 08:22:31,339 - aiohttp.access - INFO - 127.0.0.1 [21/Jul/2018:08:22:31 +0000] "POST / HTTP/1.1" 200 296 "-" "-"
2018-07-21 08:22:31,509 - jsonrpcserver.dispatcher.request - INFO - {'method': 'getblockhash', 'id': 1, 'params': [532924]}
2018-07-21 08:22:31,512 - aiohttp.access - INFO - 127.0.0.1 [21/Jul/2018:08:22:31 +0000] "POST / HTTP/1.1" 400 294 "-" "-"
2018-07-21 08:22:32,516 - jsonrpcserver.dispatcher.request - INFO - {'method': 'getblockhash', 'id': 1, 'params': [532924]}
2018-07-21 08:22:32,519 - aiohttp.access - INFO - 127.0.0.1 [21/Jul/2018:08:22:32 +0000] "POST / HTTP/1.1" 400 294 "-" "-"
@gdassori
Copy link
Member

Looks like clightning had become more strict on errors validation, pointing out a discrepancy on the rpc apis.

@gdassori gdassori added the bug Something isn't working label Jul 21, 2018
@gdassori
Copy link
Member

Error code -5 changed to the proper -8.
Should be ok since commit 254d864.
If you use pypi you can checkout the 0.0.2a3

@Stadicus
Copy link
Contributor Author

Your fix works like a charm, thanks!

bitcoin ~ ฿ bitcoin-cli getblockchaininfo
{
  "bestblockhash": "00000000000000000020ccb8af25453c87930d2ed1c784a69ce45b69aba7be74",
  "verificationprogress": 16.0,
  "chain": "main",
  "difficulty": null,
  "blocks": 533149,
  "chainwork": null,
  "pruned": false,
  "mediantime": 1532289944,
  "warning": "spruned 0.0.2a3, emulating bitcoind v0.16",
  "headers": 533149
}
bitcoin ~ ฿ tail .lightning/lightning.log -f
2018-07-22T20:12:20.531Z lightningd(10741): Adding block 533140: 000000000000000000301ea0ce946aa3efe476295a77848810f63566c1b5ea30
2018-07-22T20:12:20.604Z lightningd(10741): Adding block 533141: 000000000000000000137da4b64d56f7e13d0380cce807266a3fa500fffb3f7a
2018-07-22T20:12:20.662Z lightningd(10741): Adding block 533142: 000000000000000000168b0a2fed9d885b5f8236a21944e8ea9f9f0aecb25f3f
2018-07-22T20:12:20.716Z lightningd(10741): Adding block 533143: 000000000000000000334a07c66fb4bdf1c49dc5e9d1bfdd84c0947e8a499b7d
2018-07-22T20:12:20.764Z lightningd(10741): Adding block 533144: 000000000000000000339f87013a9ca7e63592a46912be99741b7b7e6902caec
2018-07-22T20:12:20.897Z lightningd(10741): Adding block 533145: 000000000000000000206b86c992ef0d34cfd135096217c5ed98b84edcd18e24
2018-07-22T20:12:21.066Z lightningd(10741): Adding block 533146: 0000000000000000001c0726f58817612f872bd173a5a78960d5643da8b6153f
2018-07-22T20:12:21.591Z lightningd(10741): Adding block 533147: 0000000000000000002b03c91e80fc5b2e5f847cecd2d58d851a0829d4f0577e
2018-07-22T20:12:21.825Z lightningd(10741): Adding block 533148: 0000000000000000000fdb3f538171475768ca84726f645555661e23113397ac
2018-07-22T20:12:22.251Z lightningd(10741): Adding block 533149: 00000000000000000020ccb8af25453c87930d2ed1c784a69ce45b69aba7be74
2018-07-22T20:13:18.982Z lightningd(10741): Immediate feerate 1903 (was 1788)
2018-07-22T20:15:19.799Z lightningd(10741): Immediate feerate 1788 (was 1903)
2018-07-22T20:15:22.674Z lightningd(10741): Adding block 533150: 00000000000000000029b8afdfefb52c730dab3fe54df70fd2ab1722d1779e13
2018-07-22T20:16:20.275Z lightningd(10741): Immediate feerate 1903 (was 1788)
2018-07-22T20:18:23.227Z lightningd(10741): Adding block 533151: 00000000000000000001b051a3e93129aa75c7c39f0b714ba09b590e756a04e6
2018-07-22T20:22:22.681Z lightningd(10741): Immediate feerate 1788 (was 1903)
2018-07-22T20:22:52.759Z lightningd(10741): Immediate feerate 1903 (was 1788)
2018-07-22T20:23:23.719Z lightningd(10741): Immediate feerate 1788 (was 1903)

@gdassori
Copy link
Member

Awesome 👍 Thanks for the report.
Sad to see the well known glitch on the fee estimation. that should be averaged. I'll work on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants