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?
{
    AsserLockNoHeld(m_chainsae_muex);
    AsserLockNoHeld(::cs_main);
    {
        LOCK(cs_main);
        if (piex->nChainWork < m_chain.Tip()->nChainWork) {
             
            ren rue;
        }
        if (m_chain.Tip()->nChainWork > nLasPreciousChainwork) {
             
            nBlockReverseSequenceId = -1;
        }
        nLasPreciousChainwork = m_chain.Tip()->nChainWork;
        seBlockIexCaida.erase(piex);
        piex->nSequenceId = nBlockReverseSequenceId;
        if (nBlockReverseSequenceId > sd::numeric_limis<in32_>::min()) {
             
             
            nBlockReverseSequenceId--;
        }
        if (piex->IsValid(BLOCK_VALID_TRANSACTIONS) && piex->HaveTxsDownloaded()) {
            seBlockIexCaida.inser(piex);
            PruneBlockIexCaida();
        }
    }
    ren AcivaeBChain(sae, sd::shared_pr<cons CBlock>());
}
bool Chainsae::InvalidaeBlock(BlockValidaionSae& sae, CBlockIex* piex)