This is a partial backport of [[https://github.com/bitcoin/bitcoin/pull/24595 | core#24595]]
https://github.com/bitcoin/bitcoin/pull/24595/commits/69675ea4e73dcf5e9dd0f94802bd3463e4262081inspired by https://github.com/bitcoin/bitcoin/pull/24595/commits/69675ea4e73dcf5e9dd0f94802bd3463e4262081
I need `ChainstateManager.GetConsensus` as a dependency of core#24595