0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-04 10:07:27 -05:00
bitcoin-bitcoin-core/src
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
..
bench scripted-diff: tree-wide: Remove all review-only assertions 2021-06-10 15:05:24 -04:00
compat Remove support for double serialization 2021-05-24 16:15:05 -07:00
config
consensus Merge bitcoin/bitcoin#19438: Introduce deploymentstatus 2021-07-01 19:15:09 +02:00
crc32c
crypto
index scripted-diff: tree-wide: Remove all review-only assertions 2021-06-10 15:05:24 -04:00
init Make SetupServerArgs callable without NodeContext 2021-06-10 09:58:45 -05:00
interfaces refactor: reduce #ifdef ENABLE_EXTERNAL_SIGNER usage 2021-06-16 10:48:58 +02:00
ipc
leveldb
logging
node [refactor] Add versionbits deployments to deploymentstatus.h 2021-06-30 08:18:58 +10:00
policy MOVEONLY: context-free package policies 2021-06-02 17:26:44 +01:00
primitives
qt Translations update 2021-07-01 17:16:14 +03:00
rpc [refactor] versionbits: make VersionBitsCache a full class 2021-06-30 08:19:12 +10:00
script Merge bitcoin/bitcoin#21329: descriptor wallet: Cache last hardened xpub and use in normalized descriptors 2021-07-01 09:58:40 +12:00
secp256k1
support
test Merge bitcoin/bitcoin#19438: Introduce deploymentstatus 2021-07-01 19:15:09 +02:00
univalue
util build: Fix Boost Process compatibility with mingw-w64 compiler 2021-07-01 12:16:47 +03:00
wallet Merge bitcoin/bitcoin#22334: wallet: do not spam about non-existent spk managers 2021-07-01 19:11:20 +08:00
zmq zmq: use msg: prefix over errno= in zmqError 2021-06-09 19:25:13 +08:00
.clang-format
addrdb.cpp banman: save the banlist in a JSON format on disk 2021-06-21 14:39:44 +02:00
addrdb.h banman: save the banlist in a JSON format on disk 2021-06-21 14:39:44 +02:00
addrman.cpp Add AssertLockHeld to CAddrMan private functions 2021-06-14 17:28:38 +03:00
addrman.h refactor: Make CAddrMan::cs non-recursive 2021-06-14 17:28:38 +03:00
amount.h
arith_uint256.cpp
arith_uint256.h
attributes.h
banman.cpp banman: save the banlist in a JSON format on disk 2021-06-21 14:39:44 +02:00
banman.h banman: save the banlist in a JSON format on disk 2021-06-21 14:39:44 +02:00
base58.cpp
base58.h
bech32.cpp
bech32.h
bitcoin-cli-res.rc
bitcoin-cli.cpp cli: Avoid truncating -rpcwaittimeout 2021-06-23 14:40:55 +02:00
bitcoin-tx-res.rc
bitcoin-tx.cpp Add support for SIGHASH_DEFAULT in RPCs, and make it default 2021-06-12 12:38:17 -07:00
bitcoin-util-res.rc
bitcoin-util.cpp refactor: Pass grind args vector as const reference 2021-06-18 20:10:07 +02:00
bitcoin-wallet-res.rc
bitcoin-wallet.cpp Remove unused OptionsCategory arg from AddCommand 2021-06-18 20:09:23 +02:00
bitcoind-res.rc
bitcoind.cpp Make SetupServerArgs callable without NodeContext 2021-06-10 09:58:45 -05:00
blockencodings.cpp
blockencodings.h
blockfilter.cpp
blockfilter.h
bloom.cpp
bloom.h
chain.cpp
chain.h doc: Various validation doc fixups 2021-06-03 13:53:31 +02:00
chainparams.cpp [move-only] Rename versionbitsinfo to deploymentinfo 2021-06-30 08:19:12 +10:00
chainparams.h
chainparamsbase.cpp
chainparamsbase.h
chainparamsseeds.h contrib: remove torv2 seed nodes 2021-06-03 14:04:06 +02:00
checkqueue.h
clientversion.cpp
clientversion.h
coins.cpp refactor: wrap CCoinsViewCursor in unique_ptr 2021-06-17 09:47:08 -04:00
coins.h refactor: wrap CCoinsViewCursor in unique_ptr 2021-06-17 09:47:08 -04:00
compat.h
compressor.cpp
compressor.h
core_io.h
core_memusage.h
core_read.cpp Add support for SIGHASH_DEFAULT in RPCs, and make it default 2021-06-12 12:38:17 -07:00
core_write.cpp
cuckoocache.h
dbwrapper.cpp
dbwrapper.h
deploymentinfo.cpp deploymentinfo: Add DeploymentName() 2021-06-30 08:19:12 +10:00
deploymentinfo.h deploymentinfo: Add DeploymentName() 2021-06-30 08:19:12 +10:00
deploymentstatus.cpp scripted-diff: rename versionbitscache 2021-06-30 08:19:12 +10:00
deploymentstatus.h [refactor] versionbits: make VersionBitsCache a full class 2021-06-30 08:19:12 +10:00
dummywallet.cpp
external_signer.cpp refactor: make ExternalSigner NetworkArg() and m_chain private 2021-06-16 10:48:58 +02:00
external_signer.h refactor: make ExternalSigner NetworkArg() and m_chain private 2021-06-16 10:48:58 +02:00
flatfile.cpp
flatfile.h
fs.cpp
fs.h
hash.cpp
hash.h
httprpc.cpp
httprpc.h
httpserver.cpp refactor: Make httpserver work queue a unique_ptr 2021-06-28 11:47:05 +02:00
httpserver.h
i2p.cpp
i2p.h
indirectmap.h
init.cpp [refactor] Add deploymentstatus.h 2021-06-29 17:11:12 +10:00
init.h Make SetupServerArgs callable without NodeContext 2021-06-10 09:58:45 -05:00
key.cpp Add CKey::SignSchnorr function for BIP 340/341 signing 2021-06-12 12:25:28 -07:00
key.h Add CKey::SignSchnorr function for BIP 340/341 signing 2021-06-12 12:25:28 -07:00
key_io.cpp Separate WitnessV1Taproot variant in CTxDestination 2021-05-24 12:14:16 -07:00
key_io.h
logging.cpp
logging.h
Makefile.am [move-only] Rename versionbitsinfo to deploymentinfo 2021-06-30 08:19:12 +10:00
Makefile.bench.include
Makefile.crc32c.include
Makefile.leveldb.include
Makefile.qt.include Merge bitcoin/bitcoin#21654: build, qt: Make Qt rcc output always deterministic 2021-06-03 21:25:30 +08:00
Makefile.qt_locale.include
Makefile.qttest.include
Makefile.test.include fuzz: fix fuzz binary linking order 2021-06-16 10:41:24 +02:00
Makefile.test_fuzz.include
Makefile.test_util.include
mapport.cpp
mapport.h
memusage.h
merkleblock.cpp
merkleblock.h
miner.cpp [refactor] Move ComputeBlockVersion into VersionBitsCache 2021-06-30 08:19:12 +10:00
miner.h miner: Pass in chainman to RegenerateCommitments 2021-05-27 13:50:11 -04:00
net.cpp Merge bitcoin/bitcoin#22144: Randomize message processing peer order 2021-06-16 11:27:16 +08:00
net.h p2p: extend inbound eviction protection by network to I2P peers 2021-06-14 14:01:35 +02:00
net_permissions.cpp p2p: pass strings to NetPermissions::TryParse functions by const ref 2021-05-19 19:41:05 +02:00
net_permissions.h p2p: pass strings to NetPermissions::TryParse functions by const ref 2021-05-19 19:41:05 +02:00
net_processing.cpp [refactor] Add deploymentstatus.h 2021-06-29 17:11:12 +10:00
net_processing.h
net_types.h
netaddress.cpp p2p, rpc, fuzz: various tiny follow-ups 2021-06-06 15:49:22 +02:00
netaddress.h Merge bitcoin/bitcoin#18722: addrman: improve performance by using more suitable containers 2021-06-12 11:41:27 +08:00
netbase.cpp
netbase.h
netmessagemaker.h
noui.cpp
noui.h
outputtype.cpp Disallow bech32m addresses for legacy wallet things 2021-06-22 21:57:04 -04:00
outputtype.h Disallow bech32m addresses for legacy wallet things 2021-06-22 21:57:04 -04:00
pow.cpp
pow.h
prevector.h
protocol.cpp
protocol.h Add roundtrip fuzz tests for CAddress serialization 2021-05-24 18:06:35 -07:00
psbt.cpp Make GetInputUTXO safer: verify non-witness UTXO match 2021-06-12 12:25:28 -07:00
psbt.h Construct and use PrecomputedTransactionData in PSBT signing 2021-06-12 12:25:28 -07:00
pubkey.cpp Add CKey::SignSchnorr function for BIP 340/341 signing 2021-06-12 12:25:28 -07:00
pubkey.h Add CKey::SignSchnorr function for BIP 340/341 signing 2021-06-12 12:25:28 -07:00
random.cpp
random.h
randomenv.cpp
randomenv.h
rest.cpp validation: Farewell, global Chainstate! 2021-06-10 15:05:25 -04:00
reverse_iterator.h
scheduler.cpp
scheduler.h
serialize.h refactor: Switch serialize to uint8_t (1/n) 2021-05-31 14:56:17 +02:00
shutdown.cpp
shutdown.h
signet.cpp
signet.h
span.h
streams.h
sync.cpp
sync.h
threadinterrupt.cpp
threadinterrupt.h
threadsafety.h
timedata.cpp
timedata.h
tinyformat.h
torcontrol.cpp scripted-diff: Replace GetDataDir() calls with gArgs.GetDataDirNet() calls 2021-05-24 10:29:58 +02:00
torcontrol.h
txdb.cpp doc: add comment about CCoinsViewDBCursor constructor 2021-06-18 14:15:39 -04:00
txdb.h move-only(ish): don't expose CCoinsViewDBCursor 2021-06-18 14:14:15 -04:00
txmempool.cpp scripted-diff: tree-wide: Remove all review-only assertions 2021-06-10 15:05:24 -04:00
txmempool.h [refactor] comment/naming improvements 2021-06-02 09:40:40 +01:00
txorphanage.cpp
txorphanage.h
txrequest.cpp
txrequest.h
uint256.cpp
uint256.h Make XOnlyPubKey act like byte container 2021-05-24 12:14:16 -07:00
undo.h
validation.cpp [refactor] Move ComputeBlockVersion into VersionBitsCache 2021-06-30 08:19:12 +10:00
validation.h [move-only] Move ComputeBlockVersion from validation to versionbits 2021-06-30 08:19:12 +10:00
validationinterface.cpp
validationinterface.h
version.h
versionbits.cpp [refactor] Move ComputeBlockVersion into VersionBitsCache 2021-06-30 08:19:12 +10:00
versionbits.h [refactor] Move ComputeBlockVersion into VersionBitsCache 2021-06-30 08:19:12 +10:00
walletinitinterface.h
warnings.cpp
warnings.h