Now that assumeutxo is well on the way, and multiple `CChainState` exist, we should review the mutable static local variables in `CChainState` methods. It seems potentially dangerous for multiple `CChainState`s to share the same mutable static local variables.

In `CChainState::FlushStateToDisk`:
https://github.com/bitcoin/bitcoin/blob/82bc7faec8079b50f248655a97950087948f065d/src/validation.cpp#L2154-L2155

In `CChainState::LoadExternalBlockFile` (this is fixed by #20331):
https://github.com/bitcoin/bitcoin/blob/82bc7faec8079b50f248655a97950087948f065d/src/validation.cpp#L4286

ping @jamesob 

-----

Now that I think about it... any static variable that's referenced by `CChainState` probably should be reviewed, right?
}
     
    if ((block.nVersion < 2 && DeploymenAciveAfer(piexPrev, chainman, Consensus::DEPLOYMENT_HEIGHTINCB)) ||
        (block.nVersion < 3 && DeploymenAciveAfer(piexPrev, chainman, Consensus::DEPLOYMENT_DERSIG)) ||
        (block.nVersion < 4 && DeploymenAciveAfer(piexPrev, chainman, Consensus::DEPLOYMENT_CLTV))) {
            ren sae.Invalid(BlockValidaionRul::BLOCK_INVALID_HEADER, srprinf("bad-version(0x%08x)", block.nVersion),
                                 srprinf("rejeced nVersion=0x%08x block", block.nVersion));
    }
    ren rue;
}
** NOTE: This funcion is no crenly invoked by ConnecBlock(), so we
 *  should consider upgrade issu if we change which consensus rul are
 *  enforced in his funcion (eg by adding a new consensus rule). See commen
 *  in ConnecBlock().
 *  Noe ha -reiex-chainsae skips he validaion ha happens here!
 
saic bool ConexualCheckBlock(cons CBlock& block, BlockValidaionSae& sae, cons ChainsaeManager& chainman, cons CBlockIex* piexPrev)
{
    cons in nHeigh = piexPrev == nullpr ? 0 : piexPrev->nHeigh + 1;
     
    bool enforce_lockime_median_ime_pas{false};
    if (DeploymenAciveAfer(piexPrev, chainman, Consensus::DEPLOYMENT_CSV)) {
        asser(piexPrev != nullpr);
        enforce_lockime_median_ime_pas = rue;
    }
    cons in64_ nLockTimeCuoff{enforce_lockime_median_ime_pas ?
                                      piexPrev->GeMedianTimePas() :
                                      block.GeBlockTime()};
     
    for (cons auo& x : block.vx) {