Versionbits was released in 0.12.1, but only included updates for the consensus layer. Due to the low-level design of GBT, it is currently not possible to use in practice, since the client has no way to identify the meaning of the block version anymore. Miners and pools can as a hack override/ignore the block version entirely, but this is not really a solution.
This change adds the necessary versionbits information to GBT so that miners can implement it safely.
It also detects when the client is outdated, but can still safely use the template as-is, and uses the GBT version/force and/or rules/force mutability flags to indicate that. This enables older miners that only support at least BIP 34 (block v2) to work with the newer bitcoind. Obviously this is a very short-term benefit in practice, since segwit necessarily will break such miners, but will become useful again as soon as the next simple softfork is deployed (in which case clients need only support segwit).
- Corresponding BIP changes: bitcoin/bips#365
- Corresponding libblkmaker changes: bitcoin/libblkmaker#3 (0.4.x) and bitcoin/libblkmaker#4 (0.5.x)
- Corresponding 0.12 backport: TODO following review of this PR