0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-05 10:17:30 -05:00
bitcoin-bitcoin-core/src
fanquake a55904a80c
Merge bitcoin/bitcoin#21866: [Bundle 7/7] validation: Farewell, global Chainstate!
6f994882de validation: Farewell, global Chainstate! (Carl Dong)
972c5166ee qt/test: Reset chainman in ~ChainstateManager instead (Carl Dong)
6c3b5dc0c1 scripted-diff: tree-wide: Remove all review-only assertions (Carl Dong)
3e82abb8dd tree-wide: Remove stray review-only assertion (Carl Dong)
f323248aba qt/test: Use existing chainman in ::TestGUI (can be scripted-diff) (Carl Dong)
6c15de129c scripted-diff: wallet/test: Use existing chainman (Carl Dong)
ee0ab1e959 fuzz: Initialize a TestingSetup for test_one_input (Carl Dong)
0d61634c06 scripted-diff: test: Use existing chainman in unit tests (Carl Dong)
e197076219 test: Pass in CoinsTip to ValidateCheckInputsForAllFlags (Carl Dong)
4d99b61014 test/miner_tests: Pass in chain tip to CreateBlockIndex (Carl Dong)
f0dd5e6bb4 test/util: Use existing chainman in ::PrepareBlock (Carl Dong)
464c313e30 init: Use existing chainman (Carl Dong)

Pull request description:

  Based on:  #21767

  à la Mr. Sandman
  ```
  Mr. Chainman, bring me a tip (bung, bung, bung, bung)
  Make it the most work that I've ever seen (bung, bung, bung, bung)
  Rewind old tip till we're at the fork point (bung, bung, bung, bung)
  Then tell it that it's time to call Con-nectTip

  Chainman, I'm so alone (bung, bung, bung, bung)
  No local objects to call my own (bung, bung, bung, bung)
  Please make sure I have a ref
  Mr. Chainman, bring me a tip!
  ```

  This is the last bundle in the #20158 series. Thanks everyone for their diligent review.
  I would like to call attention to https://github.com/bitcoin/bitcoin/issues/21766, where a few leftover improvements were collated.

  - Remove globals:
    - `ChainstateManager g_chainman`
    - `CChainState& ChainstateActive()`
    - `CChain& ChainActive()`
  - Remove all review-only assertions.

ACKs for top commit:
  jamesob:
    reACK 6f994882de based on the contents of
  ariard:
    Code Review ACK 6f99488.
  jnewbery:
    utACK 6f994882de
  achow101:
    Code Review ACK 6f994882de
  ryanofsky:
    Code review ACK 6f994882de.

Tree-SHA512: 4052ea79360cf0efd81ad0ee3f982e1d93aab1837dcec75f875a56ceda085de078bb3099a2137935d7cc2222004ad88da94b605ef5efef35cb6bc733725debe6
2021-06-12 11:29:31 +08: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 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
crc32c build: Update crc32c subtree 2020-12-08 19:26:30 +01:00
crypto crypto: Make MuHash Remove method efficient 2021-04-19 20:28:46 +02:00
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 Merge bitcoin-core/gui#4: UI external signer support (e.g. hardware wallet) 2021-06-09 18:59:59 +12:00
ipc multiprocess: Add echoipc RPC method and test 2021-04-23 03:02:50 -05:00
leveldb
logging
node validation: Farewell, global Chainstate! 2021-06-10 15:05:25 -04:00
policy MOVEONLY: context-free package policies 2021-06-02 17:26:44 +01:00
primitives scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
qt Merge bitcoin/bitcoin#21866: [Bundle 7/7] validation: Farewell, global Chainstate! 2021-06-12 11:29:31 +08:00
rpc scripted-diff: tree-wide: Remove all review-only assertions 2021-06-10 15:05:24 -04:00
script Add tr() descriptor (derivation only, no signing) 2021-05-24 12:14:16 -07:00
secp256k1 Update libsecp256k1 subtree to latest upstream master 2021-04-23 11:35:15 -07:00
support Merge #20464: refactor: Treat CDataStream bytes as uint8_t 2021-02-01 15:17:28 +01:00
test Merge bitcoin/bitcoin#21866: [Bundle 7/7] validation: Farewell, global Chainstate! 2021-06-12 11:29:31 +08:00
univalue Update univalue subtree 2020-11-19 15:48:24 +01:00
util Merge bitcoin/bitcoin#22137: util: Properly handle -noincludeconf on command line (take 2) 2021-06-07 13:20:57 +08:00
wallet scripted-diff: wallet/test: Use existing chainman 2021-06-10 15:04:39 -04:00
zmq zmq: use msg: prefix over errno= in zmqError 2021-06-09 19:25:13 +08:00
.clang-format [tools] Allow argument/parameter bin packing in clang-format 2021-02-18 10:07:37 +00:00
addrdb.cpp scripted-diff: Replace GetDataDir() calls with gArgs.GetDataDirNet() calls 2021-05-24 10:29:58 +02:00
addrdb.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
addrman.cpp refactor: Switch serialize to uint8_t (1/n) 2021-05-31 14:56:17 +02:00
addrman.h move-only: Group and re-order CAddrMan members by access type 2021-05-24 19:26:49 +03:00
amount.h
arith_uint256.cpp
arith_uint256.h
attributes.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
banman.cpp scripted-diff: Replace three dots with ellipsis in the UI strings 2021-05-02 22:17:16 +03:00
banman.h Clean up separated ban/discourage interface 2020-07-03 20:43:55 -07:00
base58.cpp refactor: replace sizeof(a)/sizeof(a[0]) by std::size (C++17) 2021-01-31 17:35:16 +01:00
base58.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
bech32.cpp naming nits 2021-03-17 17:59:22 -07:00
bech32.h naming nits 2021-03-17 17:59:22 -07:00
bitcoin-cli-res.rc Drop the leading 0 from the version number 2020-11-18 12:00:57 -05:00
bitcoin-cli.cpp scripted-diff: rename GetSystemTimeInSeconds to GetTimeSeconds 2021-05-31 15:11:18 +08:00
bitcoin-tx-res.rc Drop the leading 0 from the version number 2020-11-18 12:00:57 -05:00
bitcoin-tx.cpp rpc: deprecate addresses and reqSigs from rpc outputs 2021-03-23 10:51:43 -04:00
bitcoin-util-res.rc Add bitcoin-util command line utility 2021-01-12 18:34:25 +10:00
bitcoin-util.cpp Merge #20938: build: fix linking against -latomic when building for riscv 2021-01-18 18:33:24 +01:00
bitcoin-wallet-res.rc Drop the leading 0 from the version number 2020-11-18 12:00:57 -05:00
bitcoin-wallet.cpp util: Add ArgsManager::GetCommand() and use it in bitcoin-wallet 2021-01-21 19:31:28 +01:00
bitcoind-res.rc Drop the leading 0 from the version number 2020-11-18 12:00:57 -05:00
bitcoind.cpp Make SetupServerArgs callable without NodeContext 2021-06-10 09:58:45 -05:00
blockencodings.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
blockencodings.h Get rid of -Wthread-safety-precise warnings 2020-05-28 09:55:39 +03:00
blockfilter.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
blockfilter.h [indexes] Fix default [de]serialization of BlockFilter. 2020-05-26 17:27:15 -04:00
bloom.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
bloom.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
chain.cpp
chain.h doc: Various validation doc fixups 2021-06-03 13:53:31 +02:00
chainparams.cpp CRegTestParams: Use args instead of gArgs. 2021-06-02 22:36:48 +02:00
chainparams.h refactor: Use type-safe assumeutxo hash 2021-05-11 10:40:40 +02:00
chainparamsbase.cpp versionbits: Add support for delayed activation 2021-04-12 11:14:49 +10:00
chainparamsbase.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
chainparamsseeds.h contrib: remove torv2 seed nodes 2021-06-03 14:04:06 +02:00
checkqueue.h refactor: Drop boost::thread stuff in CCheckQueue 2020-09-24 06:55:34 +03:00
clientversion.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
clientversion.h refactor: Move STRINGIZE macro to macros.h 2021-02-01 22:30:05 +02:00
coins.cpp simplify ChainstateManager::SnapshotBlockhash() return semantics 2021-02-12 07:53:29 -06:00
coins.h refactor: Remove unused code 2021-05-11 10:39:44 +02:00
compat.h net: extend Sock with methods for robust send & read until terminator 2021-03-01 17:36:16 +01:00
compressor.cpp refactor: Use CPubKey vector constructor where possible 2021-05-04 06:53:32 +02:00
compressor.h
core_io.h rpc: deprecate addresses and reqSigs from rpc outputs 2021-03-23 10:51:43 -04:00
core_memusage.h
core_read.cpp doc: fix various typos 2021-01-04 12:31:31 +08:00
core_write.cpp rpc: deprecate addresses and reqSigs from rpc outputs 2021-03-23 10:51:43 -04:00
cuckoocache.h doc: Use https URLs where possible 2021-01-04 12:23:16 +08:00
dbwrapper.cpp refactor: Use only one temporary buffer in CreateObfuscateKey 2021-05-04 06:53:37 +02:00
dbwrapper.h Merge #20464: refactor: Treat CDataStream bytes as uint8_t 2021-02-01 15:17:28 +01:00
dummywallet.cpp tests: Skip SQLite fsyncs while testing 2021-04-12 19:29:03 -04:00
external_signer.cpp external_signer: remove ExternalSignerException 2021-04-13 20:09:34 +08:00
external_signer.h external_signer: remove ExternalSignerException 2021-04-13 20:09:34 +08:00
flatfile.cpp log: Move "Pre-allocating up to position 0x[...] in [...].dat" log message to debug category 2021-02-10 20:46:25 +00:00
flatfile.h Merge #18317: Serialization improvements step 6 (all except wallet/gui) 2020-05-20 07:30:29 -04:00
fs.cpp Replace fs::absolute calls with AbsPathJoin calls 2021-01-15 22:48:15 +01:00
fs.h Replace fs::absolute calls with AbsPathJoin calls 2021-01-15 22:48:15 +01:00
hash.cpp doc: Use https URLs where possible 2021-01-04 12:23:16 +08:00
hash.h Squashed 'src/secp256k1/' changes from 3967d96bf1..efad3506a8 2021-04-23 11:35:15 -07:00
httprpc.cpp Drop JSONRPCRequest constructors after #21366 2021-04-07 04:53:26 -04:00
httprpc.h refactor: replace util::Ref by std::any (C++17) 2021-03-29 23:29:42 +02:00
httpserver.cpp refactor: Add TSA annotations to the WorkQueue class members 2021-05-09 13:48:07 +03:00
httpserver.h
i2p.cpp i2p: cancel the Accept() method if waiting on the socket errors 2021-04-08 16:31:55 +02:00
i2p.h i2p: use pointers to Sock to accommodate mocking 2021-03-16 13:59:18 +01:00
indirectmap.h
init.cpp Merge bitcoin/bitcoin#21866: [Bundle 7/7] validation: Farewell, global Chainstate! 2021-06-12 11:29:31 +08:00
init.h Make SetupServerArgs callable without NodeContext 2021-06-10 09:58:45 -05:00
key.cpp refactor: Avoid &foo[0] on C-Style arrays 2021-05-04 06:55:30 +02:00
key.h refactor: Avoid &foo[0] on C-Style arrays 2021-05-04 06:55:30 +02:00
key_io.cpp Separate WitnessV1Taproot variant in CTxDestination 2021-05-24 12:14:16 -07:00
key_io.h Better error messages for invalid addresses 2021-01-24 02:44:53 +01:00
logging.cpp multiprocess: Add Ipc interface implementation 2021-04-23 03:02:50 -05:00
logging.h multiprocess: Add Ipc interface implementation 2021-04-23 03:02:50 -05:00
Makefile.am Merge bitcoin/bitcoin#22084: package testmempoolaccept followups 2021-06-10 19:09:54 +08:00
Makefile.bench.include net: Add libnatpmp support 2021-01-07 18:07:09 +02:00
Makefile.crc32c.include build: Update crc32c subtree 2020-12-08 19:26:30 +01:00
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 qt: Pre-splitoff translations update 2020-10-27 19:40:44 +01:00
Makefile.qttest.include test: remove qt byteswap compattests 2021-03-29 11:12:26 +08:00
Makefile.test.include Merge bitcoin/bitcoin#22029: [fuzz] Improve transport deserialization fuzz test coverage 2021-05-27 15:02:57 +02:00
Makefile.test_fuzz.include build: compile libnatpmp with -DNATPMP_STATICLIB on Windows 2021-03-04 12:34:46 +08:00
Makefile.test_util.include fuzz: [refactor] Use IsValidFlagCombination in signature_checker fuzz target 2021-03-30 10:42:45 +02:00
mapport.cpp refactor: Use appropriate thread constructor 2021-04-29 18:39:01 +03:00
mapport.h net: Add -natpmp command line option 2021-01-07 18:07:09 +02:00
memusage.h
merkleblock.cpp doc: fix various typos 2021-01-04 12:31:31 +08:00
merkleblock.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
miner.cpp scripted-diff: tree-wide: Remove all review-only assertions 2021-06-10 15:05:24 -04:00
miner.h miner: Pass in chainman to RegenerateCommitments 2021-05-27 13:50:11 -04:00
net.cpp Merge bitcoin/bitcoin#21969: refactor: Switch serialize to uint8_t (Bundle 1/2) 2021-06-01 09:01:29 +02:00
net.h Merge bitcoin/bitcoin#21186: net/net processing: Move addr data into net_processing 2021-05-24 20:28:31 +08: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 scripted-diff: tree-wide: Remove all review-only assertions 2021-06-10 15:05:24 -04:00
net_processing.h [net processing] Add internal _RelayTransactions() 2021-05-04 09:31:03 +01:00
net_types.h
netaddress.cpp p2p, rpc, fuzz: various tiny follow-ups 2021-06-06 15:49:22 +02:00
netaddress.h p2p: remove torv2 in SetIP() and ADDR_TORV2_SIZE constant 2021-06-03 13:36:46 +02:00
netbase.cpp Merge #21387: p2p: Refactor sock to add I2P fuzz and unit tests 2021-03-30 17:41:13 +02:00
netbase.h doc: fixup -Wdocumentation issues 2021-04-06 14:50:17 +08:00
netmessagemaker.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
noui.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
noui.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
outputtype.cpp refactor: Use C++17 std::array deduction for OUTPUT_TYPES 2021-01-03 18:37:59 +01:00
outputtype.h refactor: Use C++17 std::array deduction for OUTPUT_TYPES 2021-01-03 18:37:59 +01:00
pow.cpp
pow.h
prevector.h
protocol.cpp refactor: Replace memset calls with array initialization 2021-05-13 12:42:21 +01:00
protocol.h refactor: Replace memset calls with array initialization 2021-05-13 12:42:21 +01:00
psbt.cpp Merge #20464: refactor: Treat CDataStream bytes as uint8_t 2021-02-01 15:17:28 +01:00
psbt.h refactor: post Optional<> removal cleanups 2021-03-17 14:56:20 +08:00
pubkey.cpp Add TaprootBuilder class 2021-05-24 12:14:16 -07:00
pubkey.h Add tr() descriptor (derivation only, no signing) 2021-05-24 12:14:16 -07:00
random.cpp refactor: Replace &foo[0] with foo.data() 2021-05-04 06:55:31 +02:00
random.h
randomenv.cpp rand: only try and use freeifaddrs if available 2021-03-29 11:08:29 +08:00
randomenv.h
rest.cpp validation: Farewell, global Chainstate! 2021-06-10 15:05:25 -04:00
reverse_iterator.h
scheduler.cpp test: Fix off-by-one in mockscheduler test RPC 2021-05-14 12:49:16 +02:00
scheduler.h refactor: remove boost::thread_group usage 2021-01-29 15:39:44 +08:00
serialize.h refactor: Switch serialize to uint8_t (1/n) 2021-05-31 14:56:17 +02:00
shutdown.cpp move-only: Move AbortNode to shutdown 2021-04-04 18:08:36 +02:00
shutdown.h move-only: Move AbortNode to shutdown 2021-04-04 18:08:36 +02:00
signet.cpp Merge #21330: Deal with missing data in signature hashes more consistently 2021-04-13 10:24:31 +08:00
signet.h scripted-diff: remove Optional & nullopt 2021-03-15 10:41:30 +08:00
span.h Merge #19387: span: update constructors to match c++20 draft spec and add lifetimebound attribute 2020-11-25 15:18:33 +01:00
streams.h streams: Accept URef obj for VectorReader unserialize 2021-05-05 20:19:03 +02:00
sync.cpp refactor: remove straggling boost::mutex usage 2021-01-26 15:57:28 +08:00
sync.h refactor: Remove negative lock annotations from globals 2021-04-05 08:42:15 +02:00
threadinterrupt.cpp
threadinterrupt.h
threadsafety.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
timedata.cpp Avoid the use of abs64 in timedata 2020-10-12 19:50:16 -07:00
timedata.h
tinyformat.h refactor: Improve use of explicit keyword 2020-12-01 18:36:39 +01:00
torcontrol.cpp scripted-diff: Replace GetDataDir() calls with gArgs.GetDataDirNet() calls 2021-05-24 10:29:58 +02:00
torcontrol.h tests: Add fuzzing harness for TorController 2021-03-02 12:21:32 +00:00
txdb.cpp refactor: Switch serialize to uint8_t (1/n) 2021-05-31 14:56:17 +02:00
txdb.h txdb: add CCoinsViewDB::ChangeCacheSize 2020-07-01 14:44:24 -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 scripted-diff: Update txorphanage naming convention 2021-02-27 01:08:09 +10:00
txorphanage.h doc: Fix typos from codespell lint 2021-04-07 19:26:25 +01:00
txrequest.cpp doc: Fix typos from codespell lint 2021-04-07 19:26:25 +01:00
txrequest.h Report and verify expirations 2020-10-12 12:14:53 -07:00
uint256.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
uint256.h Make XOnlyPubKey act like byte container 2021-05-24 12:14:16 -07:00
undo.h
validation.cpp validation: Farewell, global Chainstate! 2021-06-10 15:05:25 -04:00
validation.h validation: Farewell, global Chainstate! 2021-06-10 15:05:25 -04:00
validationinterface.cpp Add 'sequence' zmq publisher to track all block (dis)connects, mempool deltas 2020-09-22 11:34:30 -04:00
validationinterface.h Add 'sequence' zmq publisher to track all block (dis)connects, mempool deltas 2020-09-22 11:34:30 -04:00
version.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
versionbits.cpp versionbits: simplify state transitions 2021-04-12 11:14:49 +10:00
versionbits.h versionbits: Add support for delayed activation 2021-04-12 11:14:49 +10:00
versionbitsinfo.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
versionbitsinfo.h
walletinitinterface.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
warnings.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
warnings.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00