You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #20749: [Bundle 1/n] Prune g_chainman usage related to ::LookupBlockIndex
67c9a83 style-only: Remove redundant sentence in ActivateBestChain comment (Carl Dong)
b8e9565 style-only: Make TestBlockValidity signature readable (Carl Dong)
0cdad75 validation: Use accessible chainstate in ChainstateManager::ProcessNewBlock (Carl Dong)
ea4fed9 validation: Use existing chainstate in ChainstateManager::ProcessNewBlockHeaders (Carl Dong)
e0dc305 validation: Move LoadExternalBlockFile to CChainState (Carl Dong)
5f8cd7b validation: Remove global ::ActivateBestChain (Carl Dong)
2a69647 validation: Pass in chainstate to ::NotifyHeaderTip (Carl Dong)
9c300cc validation: Pass in chainstate to TestBlockValidity (Carl Dong)
0e17c83 validation: Make CChainState.m_blockman public (Carl Dong)
d363d06 validation: Pass in blockman to ContextualCheckBlockHeader (Carl Dong)
f11d116 validation: Move GetLastCheckpoint to BlockManager (Carl Dong)
e4b95ee validation: Move GetSpendHeight to BlockManager (Carl Dong)
b026e31 validation: Move FindForkInGlobalIndex to BlockManager (Carl Dong)
3664a15 validation: Remove global LookupBlockIndex (Carl Dong)
eae54e6 scripted-diff: Use BlockManager::LookupBlockIndex (Carl Dong)
15d20f4 validation: Move LookupBlockIndex to BlockManager (Carl Dong)
f92dc65 validation: Guard the active_chainstate with cs_main (Carl Dong)
Pull request description:
Overall PR: #20158 (tree-wide: De-globalize ChainstateManager)
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`
ACKs for top commit:
jnewbery:
utACK 67c9a83
laanwj:
re-ACK 67c9a83
ryanofsky:
Code review ACK 67c9a83. Changes since last review:
Tree-SHA512: 8744aba2dd57a40cd2fedca809b0fe24d771bc60da1bffde89601999384aa0df428057a86644a3f72fbeedbc8b04db6c4fd264ea0db2e73c279e5acc6d056cbf
0 commit comments