bitcoin/src/consensus
MarcoFalke ddc6979b8b
Merge bitcoin/bitcoin#19438: Introduce deploymentstatus
e48826ad87 tests: remove ComputeBlockVersion shortcut from versionbits tests (Anthony Towns)
c5f36725e8 [refactor] Move ComputeBlockVersion into VersionBitsCache (Anthony Towns)
4a69b4dbe0 [move-only] Move ComputeBlockVersion from validation to versionbits (Anthony Towns)
0cfd6c6a8f [refactor] versionbits: make VersionBitsCache a full class (Anthony Towns)
8ee3e0bed5 [refactor] rpc/blockchain.cpp: SoftForkPushBack (Anthony Towns)
92f48f360d deploymentinfo: Add DeploymentName() (Anthony Towns)
ea68b3a572 [move-only] Rename versionbitsinfo to deploymentinfo (Anthony Towns)
c64b2c6a0f scripted-diff: rename versionbitscache (Anthony Towns)
de55304f6e [refactor] Add versionbits deployments to deploymentstatus.h (Anthony Towns)
2b0d291da8 [refactor] Add deploymentstatus.h (Anthony Towns)
eccd736f3d versionbits: Use dedicated lock instead of cs_main (Anthony Towns)
36a4ba0aaa versionbits: correct doxygen comments (Anthony Towns)

Pull request description:

  Introduces helper functions to make it easy to bury future deployments, along the lines of the suggestion from [11398](https://github.com/bitcoin/bitcoin/pull/11398#issuecomment-335599326) "I would prefer it if a buried deployment wouldn't require all code paths that check the BIP9 status to require changing".

  This provides three functions: `DeploymentEnabled()` which tests if a deployment can ever be active, `DeploymentActiveAt()` which checks if a deployment should be enforced in the given block, and `DeploymentActiveAfter()` which checks if a deployment should be enforced in the block following the given block, and overloads all three to work both with buried deployments and versionbits deployments.

  This adds a dedicated lock for the versionbits cache, which is acquired internally by the versionbits functions, rather than relying on `cs_main`. It also moves moves versionbitscache into deploymentstatus to avoid a circular dependency with validation.

ACKs for top commit:
  jnewbery:
    ACK e48826ad87
  gruve-p:
    ACK e48826ad87
  MarcoFalke:
    re-ACK e48826ad87 🥈

Tree-SHA512: c846ba64436d36f8180046ad551d8b0d9e20509b9bc185aa2639055fc28803dd8ec2d6771ab337e80da0b40009ad959590d5772f84a0bf6199b65190d4155bed
2021-07-01 19:15:09 +02:00
..
consensus.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
merkle.cpp scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
merkle.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
params.h [move-only] Rename versionbitsinfo to deploymentinfo 2021-06-30 08:19:12 +10:00
tx_check.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
tx_check.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
tx_verify.cpp doc: IsFinalTx comment about nSequence & OP_CLTV 2021-04-27 11:52:13 +00:00
tx_verify.h Mark CheckTxInputs [[nodiscard]] (out-param txfee only set if call is successful). Avoid UUM in fuzzing harness coins_view. 2021-05-25 21:09:05 +00:00
validation.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00