elements/src
MarcoFalke a063647413
Merge bitcoin/bitcoin#23280: init: Coalesce Chainstate loading sequence between {,non-}unittest codepaths
7f15eff2dd style-only: Remove redundant scope in *Chainstate (Carl Dong)
89bec827fd Collapse the 2 cs_main locks in LoadChainstate (Carl Dong)
3b1584b794 Remove all #include // for * comments (Carl Dong)
9a5a5a3d08 test/setup: Use LoadChainstate (Carl Dong)
c541da0d62 node/chainstate: Add options for in-memory DBs (Carl Dong)
ceb9790341 node/caches: Remove intermediate variables (Carl Dong)
ac4bf138b8 node/caches: Extract cache calculation logic (Carl Dong)
15f2e33bb3 validation: VerifyDB only needs Consensus::Params (Carl Dong)
4da9c076d1 node/chainstate: Decouple from ShutdownRequested (Carl Dong)
05441c2dc5 node/chainstate: Decouple from GetTime (Carl Dong)
2414ebc18b init: Delay RPC block notif until warmup finished (Carl Dong)
8d466a8504 Move -checkblocks LogPrintf to AppInitMain (Carl Dong)
aad8d59789 node/chainstate: Reduce coupling of LogPrintf (Carl Dong)
b345979a2b node/chainstate: Decouple from concept of uiInterface (Carl Dong)
ca7c0b934d Split off VerifyLoadedChainstate (Carl Dong)
adf4912d77 node/chainstate: Remove do/while loop (Carl Dong)
975235ca0a Move init logistics message for BAD_GENESIS_BLOCK to init.cpp (Carl Dong)
8715658983 Move mempool nullptr Assert out of LoadChainstate (Carl Dong)
9162a4f93e node/chainstate: Decouple from concept of NodeContext (Carl Dong)
c7a5c46e6f node/chainstate: Decouple from ArgsManager (Carl Dong)
ae9121f958 node/chainstate: Decouple from stringy errors (Carl Dong)
cbac28b72f node/chainstate: Decouple from GetTimeMillis (Carl Dong)
cb64af9635 node: Extract chainstate loading sequence (Carl Dong)

Pull request description:

  This PR:
  1. Coalesce the Chainstate loading sequence between `AppInitMain` and `*TestingSetup` (which makes it more tested)
  2. Makes the Chainstate loading sequence reusable in preparation for future work extracting out our consensus engine.

  Code-wise, this PR:
  1. Extracts `AppInitMain`'s Chainstate loading sequence into a `::LoadChainstateSequence` function
  2. Makes this `::LoadChainstateSequence` function reusable by
      1. Decoupling it from various concepts (`ArgsManager`, `uiInterface`, etc)
      2. Making it report errors using an `enum` rather than by setting a `bilingual_str`
  3. Makes `*TestingSetup` use this new `::LoadChainstateSequence`

  Reviewers: Aside from commentary, I've also included `git diff` flags of interest in the commit messages which I hope will aid review!

ACKs for top commit:
  ryanofsky:
    Code review ACK 7f15eff2dd. Thanks for updates!
  MarcoFalke:
    review ACK 7f15eff2dd 💳

Tree-SHA512: fb9a6cbd1c511a52b477c62a5e68e53a8be5dec2fff0e44a279966afb91efbab44bf1fe7c6b1519f8464ecc25f42dd4bae8e1efbf55ee91fc90fa0b92e3a83e2
2021-12-10 17:17:43 +01:00
..
bench Merge bitcoin/bitcoin#22019: wallet: Introduce SelectionResult for encapsulating a coin selection solution 2021-12-09 17:21:46 +01:00
common scripted-diff: Move bloom to src/common 2021-10-05 11:10:37 +02:00
compat compat: remove glibc_compat.cpp 2021-09-10 11:18:58 +08:00
config
consensus doc: Fix typos in endif header comments 2021-11-16 09:56:45 +01:00
crc32c Update crc32c subtree 2021-09-29 14:10:29 +02:00
crypto Fix K1/K2 use in the comments in ChaCha20-Poly1305 AEAD 2021-10-20 11:54:03 +05:30
index Fix outdated comments referring to ::ChainActive() 2021-10-12 14:36:51 +13:00
init Merge bitcoin/bitcoin#23006: multiprocess: Add new bitcoin-gui, bitcoin-qt, bitcoin-wallet init implementations 2021-10-26 15:54:52 +01:00
interfaces wallet: Replace confusing getAdjustedTime() with GetTime() 2021-12-01 16:26:11 +01:00
ipc refactor: Block unsafe fs::path std::string conversion calls 2021-10-05 11:10:47 -04:00
leveldb
logging log, timer: add LOG_TIME_MILLIS_WITH_CATEGORY_MSG_ONCE macro 2021-10-05 17:28:02 +02:00
minisketch Merge commit 'b6487dc4ef' as 'src/minisketch' 2021-10-21 09:36:07 +08:00
node Merge bitcoin/bitcoin#23280: init: Coalesce Chainstate loading sequence between {,non-}unittest codepaths 2021-12-10 17:17:43 +01:00
policy Merge bitcoin/bitcoin#23413: Replace MakeSpan helper with Span deduction guide 2021-12-03 10:44:37 +01:00
primitives Make GenTxid boolean constructor private 2021-10-22 12:32:16 +02:00
qt Merge bitcoin/bitcoin#19499: p2p: Make timeout mockable and type safe, speed up test 2021-12-10 10:02:12 +01:00
rpc Merge bitcoin/bitcoin#23280: init: Coalesce Chainstate loading sequence between {,non-}unittest codepaths 2021-12-10 17:17:43 +01:00
script More Span simplifications 2021-11-29 17:59:44 -05:00
secp256k1
support refactor: remove references to deprecated values under std::allocator 2021-10-20 18:36:40 -04:00
test Merge bitcoin/bitcoin#23280: init: Coalesce Chainstate loading sequence between {,non-}unittest codepaths 2021-12-10 17:17:43 +01:00
univalue Update univalue subtree to latest upstream 2021-10-11 20:45:56 +08:00
util fuzz: Fix RPC internal bug detection 2021-12-08 14:20:16 +01:00
wallet Merge bitcoin/bitcoin#22514: psbt: Actually use SIGHASH_DEFAULT for PSBT signing 2021-12-10 10:17:36 +01:00
zmq doc: Fix typos in endif header comments 2021-11-16 09:56:45 +01:00
.clang-format Use c++17 in clang-format 2021-11-12 11:46:34 +01:00
.clang-tidy Enable clang-tidy bugprone-argument-comment and fix violations 2021-09-07 09:11:10 +02:00
addrdb.cpp refactor: Block unsafe fs::path std::string conversion calls 2021-10-05 11:10:47 -04:00
addrdb.h scripted-diff: Rename CAddrMan to AddrMan 2021-09-28 22:21:10 -04:00
addrman.cpp Merge bitcoin/bitcoin#22872: log: improve checkaddrman logging with duration in milliseconds 2021-11-10 17:38:45 +01:00
addrman.h [addrman] Remove AddrMan friends 2021-11-09 17:09:50 +00:00
addrman_impl.h Merge bitcoin/bitcoin#22872: log: improve checkaddrman logging with duration in milliseconds 2021-11-10 17:38:45 +01:00
arith_uint256.cpp
arith_uint256.h
attributes.h
banman.cpp
banman.h doc: Fix typos in endif header comments 2021-11-16 09:56:45 +01:00
base58.cpp Replace MakeSpan helper with Span deduction guide 2021-11-29 17:58:53 -05:00
base58.h
bech32.cpp Make Bech32 LocateErrors return error list rather than using out-arg 2021-12-06 14:17:41 +13:00
bech32.h Make Bech32 LocateErrors return error list rather than using out-arg 2021-12-06 14:17:41 +13:00
bitcoin-cli-res.rc windres: use PACKAGE_VERSION rather than building more version numbers 2021-08-17 16:54:47 +08:00
bitcoin-cli.cpp cli: hoist networks class data members to a constant 2021-11-11 13:14:01 +01:00
bitcoin-tx-res.rc windres: use PACKAGE_VERSION rather than building more version numbers 2021-08-17 16:54:47 +08:00
bitcoin-tx.cpp bitcoin-tx: Reject non-integral and out of range multisig numbers 2021-10-12 12:45:55 +02:00
bitcoin-util-res.rc windres: use PACKAGE_VERSION rather than building more version numbers 2021-08-17 16:54:47 +08:00
bitcoin-util.cpp
bitcoin-wallet-res.rc windres: use PACKAGE_VERSION rather than building more version numbers 2021-08-17 16:54:47 +08:00
bitcoin-wallet.cpp Merge bitcoin/bitcoin#23346: util, refactor: Improve headers for bitcoin-wallet tool 2021-12-09 13:44:24 +01:00
bitcoind-res.rc windres: use PACKAGE_VERSION rather than building more version numbers 2021-08-17 16:54:47 +08:00
bitcoind.cpp Add syscall sandboxing (seccomp-bpf) 2021-10-01 13:51:10 +00:00
blockencodings.cpp
blockencodings.h
blockfilter.cpp Remove unused (and broken) functionality in SpanReader 2021-12-06 16:18:14 -05:00
blockfilter.h
chain.cpp doc: Tidy up nMinDiskSpace comment 2021-11-26 11:17:43 +01:00
chain.h Merge bitcoin/bitcoin#13875: [doc] nChainTx needs to become a 64-bit earlier due to SegWit 2021-10-20 15:52:08 +02:00
chainparams.cpp Use absolute FQDN for DNS seed domains 2021-10-14 17:49:52 +05:30
chainparams.h
chainparamsbase.cpp scripted-diff: disable unimplemented ArgsManager BOOL/INT/STRING flags 2021-10-25 10:44:17 -04:00
chainparamsbase.h
chainparamsseeds.h
checkqueue.h Exit early for an empty vChecks in CCheckQueue::Add 2021-11-03 11:26:57 +02:00
clientversion.cpp wallet: use FormatFullVersion instead of CLIENT_BUILD in rpcdump 2021-08-16 16:04:47 +08:00
clientversion.h wallet: use FormatFullVersion instead of CLIENT_BUILD in rpcdump 2021-08-16 16:04:47 +08:00
coins.cpp [tracing] tracepoints to utxocache add, spent and uncache 2021-11-28 11:51:21 +05:30
coins.h
compat.h
compressor.cpp
compressor.h Replace MakeSpan helper with Span deduction guide 2021-11-29 17:58:53 -05:00
core_io.h rpc: Add level 3 verbosity to getblock RPC call. 2021-10-05 10:42:34 +02:00
core_memusage.h
core_read.cpp psbt: Actually use SIGHASH_DEFAULT 2021-12-08 09:43:30 -05:00
core_write.cpp core_write: Rename calculate_fee to have_undo for clarity 2021-10-05 10:42:34 +02:00
cuckoocache.h refactor: Fix implicit-signed-integer-truncation in cuckoocache.h 2021-11-29 14:32:51 +01:00
dbwrapper.cpp Improve fs::PathToString documentation 2021-11-15 12:08:49 -05:00
dbwrapper.h
deploymentinfo.cpp
deploymentinfo.h
deploymentstatus.cpp
deploymentstatus.h
dummywallet.cpp Remove -rescan startup parameter 2021-09-30 12:06:27 +13:00
external_signer.cpp external_signer: improve fingerprint matching logic (stop on first match) 2021-08-24 11:30:09 +02:00
external_signer.h
flatfile.cpp refactor: Block unsafe fs::path std::string conversion calls 2021-10-05 11:10:47 -04:00
flatfile.h
fs.cpp refactor: include a missing <limits> header in fs.cpp 2021-10-22 04:03:45 +03:00
fs.h Improve fs::PathToString documentation 2021-11-15 12:08:49 -05:00
hash.cpp refactor: use {Read,Write}BE32 helpers for BIP32 nChild (de)serialization 2021-10-05 23:53:33 +02:00
hash.h
httprpc.cpp Replace use of boost::trim use with locale-independent TrimString 2021-09-02 13:17:46 +08:00
httprpc.h doc: Fix typos in endif header comments 2021-11-16 09:56:45 +01:00
httpserver.cpp Merge bitcoin/bitcoin#20487: Add syscall sandboxing using seccomp-bpf (Linux secure computing mode) 2021-10-04 22:45:43 +02:00
httpserver.h
i2p.cpp refactor: Block unsafe fs::path std::string conversion calls 2021-10-05 11:10:47 -04:00
i2p.h doc: Fix typos in endif header comments 2021-11-16 09:56:45 +01:00
indirectmap.h
init.cpp Remove all #include // for * comments 2021-12-07 14:48:49 -05:00
init.h
key.cpp Make signing follow BIP340 exactly w.r.t. aux randomness 2021-11-12 12:04:20 -05:00
key.h Make signing follow BIP340 exactly w.r.t. aux randomness 2021-11-12 12:04:20 -05:00
key_io.cpp Make Bech32 LocateErrors return error list rather than using out-arg 2021-12-06 14:17:41 +13:00
key_io.h Add Bech32 error location function 2021-10-12 12:03:14 +13:00
logging.cpp blockstorage: use debug log category 2021-10-11 21:45:49 +10:00
logging.h blockstorage: use debug log category 2021-10-11 21:45:49 +10:00
Makefile.am Merge bitcoin/bitcoin#23280: init: Coalesce Chainstate loading sequence between {,non-}unittest codepaths 2021-12-10 17:17:43 +01:00
Makefile.bench.include
Makefile.crc32c.include build: remove support for weak linking getauxval() 2021-09-24 15:40:04 +08:00
Makefile.leveldb.include build: remove build stubs for external leveldb 2021-10-15 01:02:45 +00:00
Makefile.minisketch.include build: add minisketch build file and include it 2021-10-21 09:37:30 +08:00
Makefile.qt.include build: Fix make apk if ccache enabled 2021-11-08 07:19:10 +02:00
Makefile.qt_locale.include
Makefile.qttest.include multiprocess: Add new bitcoin-gui, bitcoin-qt, bitcoin-wallet init implementations 2021-09-16 13:17:01 -05:00
Makefile.test.include Merge bitcoin/bitcoin#21206: refactor: Make CWalletTx sync state type-safe 2021-11-25 19:41:53 +01:00
Makefile.test_fuzz.include
Makefile.test_util.include move-only: unittest: add test/util/chainstate.h 2021-09-15 15:46:48 -04:00
Makefile.univalue.include Integrate univalue into our buildsystem 2021-10-11 20:46:25 +08:00
mapport.cpp Add syscall sandboxing (seccomp-bpf) 2021-10-01 13:51:10 +00:00
mapport.h
memusage.h
merkleblock.cpp
merkleblock.h style: Sort 2021-10-05 11:11:18 +02:00
net.cpp Merge bitcoin/bitcoin#19499: p2p: Make timeout mockable and type safe, speed up test 2021-12-10 10:02:12 +01:00
net.h Merge bitcoin/bitcoin#19499: p2p: Make timeout mockable and type safe, speed up test 2021-12-10 10:02:12 +01:00
net_permissions.cpp
net_permissions.h
net_processing.cpp Merge bitcoin/bitcoin#19499: p2p: Make timeout mockable and type safe, speed up test 2021-12-10 10:02:12 +01:00
net_processing.h rpc: getblockfrompeer 2021-12-02 13:16:18 +07:00
net_types.cpp MOVEONLY: Expose BanMapToJson / BanMapFromJson 2021-09-03 05:21:58 -04:00
net_types.h MOVEONLY: Expose BanMapToJson / BanMapFromJson 2021-09-03 05:21:58 -04:00
netaddress.cpp More Span simplifications 2021-11-29 17:59:44 -05:00
netaddress.h Replace MakeSpan helper with Span deduction guide 2021-11-29 17:58:53 -05:00
netbase.cpp Merge bitcoin/bitcoin#17160: refactor: net: subnet lookup: use single-result LookupHost() 2021-12-06 19:59:35 +01:00
netbase.h
netmessagemaker.h
noui.cpp
noui.h
outputtype.cpp make ParseOutputType return a std::optional<OutputType> 2021-08-04 19:20:32 +08:00
outputtype.h make ParseOutputType return a std::optional<OutputType> 2021-08-04 19:20:32 +08:00
pow.cpp
pow.h
prevector.h
protocol.cpp Make GenTxid boolean constructor private 2021-10-22 12:32:16 +02:00
protocol.h doc: Remove incorrect INIT_PROTO_VERSION from nTime comment 2021-08-23 18:53:34 +02:00
psbt.cpp Merge bitcoin/bitcoin#22513: rpc: Allow walletprocesspsbt to sign without finalizing 2021-11-29 17:20:20 +01:00
psbt.h psbt: Make sighash_type std::optional<int> 2021-12-08 09:43:26 -05:00
pubkey.cpp refactor: use {Read,Write}BE32 helpers for BIP32 nChild (de)serialization 2021-10-05 23:53:33 +02:00
pubkey.h More Span simplifications 2021-11-29 17:59:44 -05:00
random.cpp
random.h
randomenv.cpp build: remove support for weak linking getauxval() 2021-09-24 15:40:04 +08:00
randomenv.h doc: Fix typos in endif header comments 2021-11-16 09:56:45 +01:00
rest.cpp rpc: move Ensure* helpers to server_util.h 2021-12-02 13:15:32 +07:00
reverse_iterator.h
scheduler.cpp Add syscall sandboxing (seccomp-bpf) 2021-10-01 13:51:10 +00:00
scheduler.h doc: Fix typos in endif header comments 2021-11-16 09:56:45 +01:00
serialize.h
shutdown.cpp
shutdown.h doc: Fix typos in endif header comments 2021-11-16 09:56:45 +01:00
signet.cpp Remove unused (and broken) functionality in SpanReader 2021-12-06 16:18:14 -05:00
signet.h
span.h More Span simplifications 2021-11-29 17:59:44 -05:00
streams.h Remove unused (and broken) functionality in SpanReader 2021-12-06 16:18:14 -05:00
sync.cpp log: Avoid broken DEBUG_LOCKORDER log 2021-09-29 18:46:30 +02:00
sync.h sync: inline lock contention logging macro to fix time duration 2021-09-06 23:43:51 +02:00
threadinterrupt.cpp
threadinterrupt.h doc: Fix typos in endif header comments 2021-11-16 09:56:45 +01:00
threadsafety.h
timedata.cpp scripted-diff: Rename overloaded int GetArg to GetIntArg 2021-09-27 06:57:20 -04:00
timedata.h
tinyformat.h
torcontrol.cpp Remove strtol in torcontrol 2021-11-18 18:13:21 +01:00
torcontrol.h doc: Fix typos in endif header comments 2021-11-16 09:56:45 +01:00
txdb.cpp scripted-diff: Rename overloaded int GetArg to GetIntArg 2021-09-27 06:57:20 -04:00
txdb.h Remove txindex migration code 2021-08-20 16:59:41 +02:00
txmempool.cpp clean up txmempool includes 2021-12-02 14:49:19 +00:00
txmempool.h clean up txmempool includes 2021-12-02 14:49:19 +00:00
txorphanage.cpp
txorphanage.h
txrequest.cpp Make GenTxid boolean constructor private 2021-10-22 12:32:16 +02:00
txrequest.h
uint256.cpp
uint256.h
undo.h
validation.cpp Merge bitcoin/bitcoin#23280: init: Coalesce Chainstate loading sequence between {,non-}unittest codepaths 2021-12-10 17:17:43 +01:00
validation.h Merge bitcoin/bitcoin#23280: init: Coalesce Chainstate loading sequence between {,non-}unittest codepaths 2021-12-10 17:17:43 +01:00
validationinterface.cpp
validationinterface.h
version.h
versionbits.cpp
versionbits.h
walletinitinterface.h
warnings.cpp
warnings.h doc: Fix typos in endif header comments 2021-11-16 09:56:45 +01:00