mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-14 19:24:03 +01:00
e11b649650validation: CVerifyDB::VerifyDB: Use locking annotation (Carl Dong)03f75c42e1validation: Use existing chain member in CChainState::LoadGenesisBlock (Carl Dong)5e4af77380validation: Use existing chain member in CChainState::AcceptBlock (Carl Dong)fee73347c0validation: Pass in chain to FindBlockPos+SaveBlockToDisk (Carl Dong)a9d28bcd8dvalidation: Use *this in CChainState::ActivateBestChainStep (Carl Dong)4744efc9bavalidation: Pass in chainstate to CTxMemPool::check (Carl Dong)1fb7b2c595validation: Use *this in CChainState::InvalidateBlock (Carl Dong)8cdb2f7e58validation: Move LoadBlockIndexDB to CChainState (Carl Dong)8b99efbcc0validation: Move invalid block handling to CChainState (Carl Dong)2bdf37fe18validation: Pass in chainstate to CVerifyDB::VerifyDB (Carl Dong)31eac50c72validation: Remove global ::VersionBitsTip{State,SinceHeight,Statistics} (Carl Dong)63e4c7316avalidation: Pass in chainstate to ::PruneBlockFilesManual (Carl Dong)4bada76237validation: Pass in chainstate to UpdateTip (Carl Dong)a3ba08ba7dvalidation: Remove global ::{{Precious,Invalidate}Block,ResetBlockFailureFlags} (Carl Dong)4927c9e699validation: Remove global ::LoadGenesisBlock (Carl Dong)9da106be4dvalidation: Check chain tip is non-null in CheckFinalTx (Carl Dong) Pull request description: Overall PR: #20158 (tree-wide: De-globalize ChainstateManager) Based on: - [x] #20750 | [Bundle 2/n] Prune g_chainman usage in mempool-related validation functions Note to reviewers: 1. This bundle may _apparently_ introduce usage of `g_chainman` or `::Chain(state|)Active()` globals, but these are resolved later on in the overall PR. [Commits of overall PR](https://github.com/bitcoin/bitcoin/pull/20158/commits) 2. There may be seemingly obvious local references to `ChainstateManager` or other validation objects which are not being used in callers of the current function in question, this is done intentionally to **_keep each commit centered around one function/method_** to ease review and to make the overall change systematic. We don't assume anything about our callers. Rest assured that once we are considering that particular caller in later commits, we will use the obvious local references. [Commits of overall PR](https://github.com/bitcoin/bitcoin/pull/20158/commits) 3. When changing a function/method that has many callers (e.g. `LookupBlockIndex` with 55 callers), it is sometimes easier (and less error-prone) to use a scripted-diff. When doing so, there will be 3 commits in sequence so that every commit compiles like so: 1. Add `new_function`, make `old_function` a wrapper of `new_function`, divert all calls to `old_function` to `new_function` **in the local module only** 2. Scripted-diff to divert all calls to `old_function` to `new_function` **in the rest of the codebase** 3. Remove `old_function` Note to self: - [x] Address: https://github.com/bitcoin/bitcoin/pull/20750#discussion_r579400663 ACKs for top commit: laanwj: Code review ACKe11b649650Tree-SHA512: 205a451a741e32f17d5966de289f2f5a3f0817738c0087b70ff4755ddd217b53d01050ed396669bda2b1d216a88d927b9778777f9ff95ab1fe20e59c5f341776
Test library
This contains files for the test library, which is used by the test binaries (unit tests, benchmarks, fuzzers, gui tests).
Generally, the files in this folder should be well-separated modules. New code should be added to existing modules or (when in doubt) a new module should be created.
The utilities in here are compiled into a library, which does not hold any state. However, the main file setup_common
defines the common test setup for all test binaries. The test binaries will handle the global state when they
instantiate the BasicTestingSetup (or one of its derived classes).