This PR builds on the work of #19927 towards #20049
Please see #20049 for the broader context, especially this section which applies specifically to this PR:
…for some functions (
LookupBlockIndexbeing the main culprit), a resolution of their dependency on theg_chainman/::Chain(state|)Active()globals results in an increase in apparent references tog_chainman/::Chain(state|)Active(). However, it is important to note that these are not new dependencies by any means, those dependency were always there – they was just hidden byQux’s use of the globals. Furthermore, all of these “new” apparent references tog_chainman/::Chain(state|)Active()will be dealt with as we prune the call graph upward.
Please also read the note in the commit message of 407faf2ff364cc778083c145a77b0f150232121d (validation: Move FindForkInGlobalIndex to BlockManager), and let me know your thoughts.