Skip to content

Remove BIP9 support

This fully removes BIP9 support.

Rationale

  • There are no plans to use BIP9 to decide anything.
  • BIP9 is designed specifically for one-way binary consensus changes; being a minority chain, BIP9 will be difficult to use for the forseeable future. [BIP9 may be useful for timing activation of non-controversial features even on a minority chain.]
  • BIP9 is fundamentally incompatible with Bitcoin Cash periodic network upgrades (regardless of our opinions about the ideal frequency).
  • BIP9 does not take the per-block Difficulty Adjustment Algorithm of Bitcoin Cash into account (some blocks represent more hash than others).
  • A significant part of BIP9 and perhaps the most useful part (getblocktemplate) is missing from the implementation. (!72 (merged))
  • There are no plans to maintain this code, causing it to rot.
  • If in the future we do decide to use miner voting for whatever reason, BIP9 is not at all guaranteed to be the best choice for that situation - we should carefully reevaluate how we want the voting system to work, and not just pick BIP9 because we-need-something-this-is-something.
  • Cleanly removing BIP9 now makes it easier to implement future voting systems without interfering with legacy BIP9 code. [The current BIP9 code may actually be a good start for such future implementations.]

Summary of source code changes

  • consensus/params.h: BIP9-related structures removed.
  • consensus/params.h, chainparams.cpp: BIP9-related chain parameter fields removed.
  • rpc/blockchain.cpp: getblockchaininfo now simply sets the softforks field to an empty object (for backward compatibility)
  • validation.h, validation.cpp: BIP9-related functions removed.
  • validation.cpp: ComputeBlockVersion now simply returns VERSIONBITS_TOP_BITS.
  • versionbits.h, versionbits.cpp: only version constants left behind.
  • versionbitsinfo.h, versionbitsinfo.cpp: removed.

Unit test versionbits_tests is removed.

Functional test rpc_blockchain is changed to no longer expect to see the testdummy soft fork.

How code changes were located

I manually reviewed the following Bitcoin ABC differentials to locate all code to remove:

  1. D5282 Implement miner funding features
  2. D5218 Update blockchain RPC to report all BIP9 based on versionbitsinfo
  3. D5139 Ensure the thresold for BIP9 can be configured on a per activation basis.
  4. D5135 Restore BIP9 RPC support in getblockchaininfo
  5. D5134 Ressurect BIP9 style activation mechanism

In combination with further searches, making the thing compile, and making tests succeed, I am sufficiently confident all BIP9 code is removed.

Test plan

Test as follows: (both build paths - ninja & autoconf)

  1. build (ninja && ninja test_bitcoin for ninja build)
  2. run unit tests: src/test/test_bitcoin
  3. full regression tests: test/functional/test_runner.py --extended
Edited by BigBlockIfTrue

Merge request reports

Loading