Is there an existing issue for this?
- I have searched the existing issues
Current behaviour
When ZMQ announces a new chain tip via “sequence” “C” message, if getblocktemplate
is called immediately, it can return a block template that does not reflect the new chain tip.
This is important for Braidpool, which needs to switch to a new chain tip as quickly as possible when a new block comes in.
Expected behaviour
getblocktemplate
should return a result consistent with the information announced via ZMQ and correctly reflect the current chain tip.
Steps to reproduce
This was seen on the cpunet
testnet fork (which does not touch any of the consensus or ZMQ code). The bug report there is: https://github.com/braidpool/bitcoin/issues/1#issuecomment-2341397203
This occurs infrequently and it may be necessary to run the miner script for a day or more to see it.
The script that receives the ZMQ messages and calls getblocktemplate
is here: https://github.com/braidpool/bitcoin/blob/cpunet/contrib/cpunet/miner
Relevant log output
Please see https://github.com/braidpool/bitcoin/issues/1#issuecomment-2341397203 for log output.
How did you obtain Bitcoin Core
Compiled from source
What version of Bitcoin Core are you using?
Bitcoin Core version v27.99.0-e8b157f687eb-dirty
Operating system and version
Arch Linux 6.10.5-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC
Machine specifications
8 core Ryzen, SSD.