0

Just doing

while :
do
 time bitcoin-cli generatetoaddress 1 <non_local_wallet_address>
 bitcoin-cli getblockcount
done

brings regtest blockgen times up to 600ms when generating a block at the height 120k, even with all empty blocks.

I have noted down the following numbers:

height, gen-time
800 -> 7ms
5500 -> 18ms
11000 -> 31ms
22000 -> 65ms
37000 -> 110ms

and so on.

This makes my test suite slowing down a lot, over time. Is this something we can deal with?

Thanks!

5
  • I can confirm this behavior. The difficulty is the same in regtest, so I don't think this should be happening. Unfortunately, I cannot provide any more help apart from suggesting to restructure your suite so that it does use 120k blocks. – sanket1729 Jul 16 at 14:07
  • This is probably not related to block height. Because running invalidate and mining again from genesis does not help. – sanket1729 Jul 16 at 14:10
  • Why do you need 120k blocks for a test? – Andrew Chow Jul 16 at 18:40
  • If you add -debug=bench to your bitcoind command, then the debug.log file will contain log lines with benchmarks for some part of the block generation process. That may help inform where the slow down is. – Andrew Chow Jul 16 at 18:48
  • Hi Andrew, infrastructures developers may have infinite reasons for having a private, permanent, regtest network. The debug (=all) doesn't highlight where bitcoincore is spending time to generate blocks. I'll try with bench. – JonSnow Jul 17 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.