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 #21270: [Bundle 4/n] Prune g_chainman usage in validation-adjacent modules
a67983c net_processing: Add review-only assertion to PeerManager (Carl Dong)
272d993 scripted-diff: net_processing: Use existing chainman (Carl Dong)
021a04a net_processing: Move some static functions to PeerManager (Carl Dong)
91c5b68 node/ifaces: ChainImpl: Use existing NodeContext member (Carl Dong)
8a1d580 node/ifaces: NodeImpl: Use existing NodeContext member (Carl Dong)
4cde4a7 node: Use existing NodeContext (Carl Dong)
106bcd4 node/coinstats: Pass in BlockManager to GetUTXOStats (Carl Dong)
2c3ba00 miner: Pass in blockman to ::RegenerateCommitments (Carl Dong)
2afcf24 miner: Remove old CreateNewBlock w/o chainstate param (Carl Dong)
46b7f29 scripted-diff: Invoke CreateNewBlock with chainstate (Carl Dong)
d0de61b miner: Pass in chainstate to BlockAssembler::CreateNewBlock (Carl Dong)
a04aac4 validation: Remove extraneous LoadGenesisBlock function prototype (Carl Dong)
Pull request description:
Overall PR: #20158 (tree-wide: De-globalize ChainstateManager)
Based on:
- [x] #21055 | [Bundle 3/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`
ACKs for top commit:
laanwj:
Code review ACK a67983c
ryanofsky:
Code review ACK a67983c. Only change since last review new first commit fixing header declaration, and rebase
glozow:
code review ACK a67983c
Tree-SHA512: dce182a18b88be80cbf50978d4ba8fa6ab0f01e861d09bae0ae9364051bb78f9334859d164b185b07f1d70a583e739557fab6d820cac8c37b3855b85c2a6771b
0 commit comments