aboutsummaryrefslogtreecommitdiff
path: root/src/node/chainstate.cpp
AgeCommit message (Collapse)Author
2022-09-09scripted-diff: rename CChainState -> ChainstateJames O'Beirne
-BEGIN VERIFY SCRIPT- sed -i 's/CChainState/Chainstate/g' $(git grep -l CChainState ':(exclude)doc/release-notes*') -END VERIFY SCRIPT- Co-authored-by: MacroFake <falke.marco@gmail.com>
2022-09-01Move blockstorage option logging to LoadChainstate()MacroFake
2022-08-29Move validation option logging to LoadChainstate()MacroFake
2022-07-21refactor: Fix iwyu on node/chainstateMacroFake
2022-07-19refactor: Reduce number of LoadChainstate return valuesRussell Yanofsky
2022-07-19refactor: Reduce number of LoadChainstate parametersRussell Yanofsky
2022-07-19Add missing includes to node/chainstateMacroFake
This is needed for the next commit
2022-05-18Do not pass Consensus::Params& to Chainstate helpersMacroFake
2022-05-18Do not pass time getter to Chainstate helpersMacroFake
2022-04-27init: Reset mempool and chainman via reconstructionCarl Dong
Fixes https://github.com/bitcoin/bitcoin/issues/22964 Previously, we used UnloadBlockIndex() in order to reset node.mempool and node.chainman. However, that has proven to be fragile (see https://github.com/bitcoin/bitcoin/issues/22964), and requires UnloadBlockIndex and its callees to be updated manually for each member that's introduced to the mempool and chainman classes. In this commit, we stop using the UnloadBlockIndex function and we simply reconstruct node.mempool and node.chainman. Since PeerManager needs a valid reference to both node.mempool and node.chainman, we also move PeerManager's construction via `::make` to after the chainstate activation sequence is complete. There are no more callers to UnloadBlockIndex after this commit, so it and its sole callees can be pruned.
2022-04-19scripted-diff: Rename pindexBestHeader, fHavePrunedCarl Dong
...to m_best_header and m_have_pruned -BEGIN VERIFY SCRIPT- find_regex="\bpindexBestHeader\b" \ && git grep -l -E "$find_regex" -- src \ | xargs sed -i -E "s@$find_regex@m_best_header@g" find_regex="\bfHavePruned\b" \ && git grep -l -E "$find_regex" -- src \ | xargs sed -i -E "s@$find_regex@m_have_pruned@g" -END VERIFY SCRIPT-
2022-04-19move-mostly: Make fHavePruned a BlockMan memberCarl Dong
[META] In the next commit, we move the clearing of fHavePruned to BlockManager::Unload()
2022-04-06doc: Convert remaining comments to clang-tidy formatMarcoFalke
2022-03-10Remove utxo db upgrade codeMarcoFalke
2022-02-21Avoid implicit-integer-sign-change in VerifyLoadedChainstateMarcoFalke
2022-01-06Add src/node/* code to node:: namespaceRussell Yanofsky
2021-12-23node/chainstate: Use MAX_FUTURE_BLOCK_TIMECarl Dong
2021-12-07style-only: Remove redundant scope in *ChainstateCarl Dong
I strongly recommend reviewing with the following git-diff flags: --ignore-space-change
2021-12-07Collapse the 2 cs_main locks in LoadChainstateCarl Dong
2021-12-07Remove all #include // for * commentsCarl Dong
2021-12-07node/chainstate: Add options for in-memory DBsCarl Dong
[META] In a future commit, these options will be used in TestingSetup to ensure that the DBs are in-memory.
2021-12-07validation: VerifyDB only needs Consensus::ParamsCarl Dong
Previously we were passing in CChainParams, when VerifyDB only needed the Consensus::Params subset.
2021-12-07node/chainstate: Decouple from ShutdownRequestedCarl Dong
...instead allow optionally passing in a std::function<bool()>
2021-12-07node/chainstate: Decouple from GetTimeCarl Dong
...instead pass in a std::function<int64_t()> Note that the static_cast is needed (apparently) for the compiler to know which overloaded GetTime to choose.
2021-12-07init: Delay RPC block notif until warmup finishedCarl Dong
See added code comment for more details.
2021-12-06Move -checkblocks LogPrintf to AppInitMainCarl Dong
2021-12-06node/chainstate: Reduce coupling of LogPrintfCarl Dong
...by moving the try/catch out of LoadChainstate I strongly recommend reviewing with the following git-diff flags: --color-moved=dimmed_zebra --color-moved-ws=allow-indentation-change
2021-12-06node/chainstate: Decouple from concept of uiInterfaceCarl Dong
...instead allow the caller to optionally pass in callbacks which are triggered for certain events. Behaviour change: The string "Verifying blocks..." was previously printed for each chainstate in chainman which did not have an effectively empty coinsview, now it will be printed once unconditionally before we call VerifyLoadedChain.
2021-12-06Split off VerifyLoadedChainstateCarl Dong
2021-12-06node/chainstate: Remove do/while loopCarl Dong
I strongly recommend reviewing with the following git-diff flags: --ignore-space-change
2021-12-06Move init logistics message for BAD_GENESIS_BLOCK to init.cppCarl Dong
2021-12-06Move mempool nullptr Assert out of LoadChainstateCarl Dong
2021-12-06node/chainstate: Decouple from concept of NodeContextCarl Dong
...instead pass in only the necessary information Also allow mempool to be a nullptr
2021-12-06node/chainstate: Decouple from ArgsManagerCarl Dong
...instead pass in only the necessary information
2021-12-06node/chainstate: Decouple from stringy errorsCarl Dong
This allows us to separate the initialization code from translations and error reporting. This change changes the caller semantics of LoadChainstate quite drastically. To see that this change doesn't change behaviour, observe that: 1. Prior to this change, LoadChainstate returned false only in the "bad genesis block" failure case (by returning InitError()), indicating that the caller should immediately bail. After this change, the corresponding ERROR_BAD_GENESIS_BLOCK handler in src/init.cpp maintains behavioue by also bailing immediately. 2. The failed_* temporary booleans were only used to break out of the outer do/while(false) loop. They can therefore be safely removed.
2021-12-06node/chainstate: Decouple from GetTimeMillisCarl Dong
...instead just move it out
2021-12-06node: Extract chainstate loading sequenceCarl Dong
I strongly recommend reviewing with the following git-diff flags: --color-moved=dimmed_zebra --color-moved-ws=allow-indentation-change [META] This commit is intended to be as close to a move-only commit as possible, and lingering ugliness will be resolved in subsequent commits. A few variables that are passed in by value instead of by reference deserve explanation: - fReset and fReindexChainstate are both local variables in AppInitMain and are not modified in the sequence - fPruneMode, despite being a global, is only modified in AppInitParameterInteraction, long before LoadChainstate is called ---- [META] This semantic will change in a future commit named "node/chainstate: Decouple from stringy errors"