When doing refactors around CChainParams, @schancel brought up that this code allows for writing code that could cause configuration changes to trigger hardforks. Investigate to see if we can eliminate or at least reduce the surface for hardforks to activate on configuration changes.
So, my suggestion would be to do the opposite:
- Expand Consensus::Params to include things like hardfork times.
- Add a way to configure hardfork times at the top level function for block validation.
- Strip Config from all the block validation, and instead only accept Consensus::Params.