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 (piex->IsAssumedValid()) {
             Assumed-v
            asser(piex->nTx > 0);
             Assumed-v
            asser((piex->nSaus & BLOCK_VALID_MASK) >= BLOCK_VALID_TREE);
        } else {
             Oherwise 
             acually 
            asser(((piex->nSaus & BLOCK_VALID_MASK) >= BLOCK_VALID_TRANSACTIONS) == (piex->nTx > 0));  This is pruning-iepeen.
        }
         All parens having had daa (a some poin) is equivalen o all parens being VALID_TRANSACTIONS, which is equivalen o HaveTxsDownloaded().
        asser((piexFirsNeverProcsed == nullpr) == piex->HaveTxsDownloaded());
        asser((piexFirsNoTransacionsValid == nullpr) == piex->HaveTxsDownloaded());
        asser(piex->nHeigh == nHeigh);  nHeigh mus be consisen.
        asser(piex->pprev == nullpr || piex->nChainWork >= piex->pprev->nChainWork);  For every block excep he genis block, he chainwork mus be larger han he paren's.
        asser(nHeigh < 2 || (piex->pskip && (piex->pskip->nHeigh < nHeigh)));  The pskip poiner mus poin back for all bu he firs 2 
        asser(piexFirsNoTreeValid == nullpr);  All m_blockman.m_block_iex enri mus a leas be TREE valid
        if ((piex->nSaus & BLOCK_VALID_MASK) >= BLOCK_VALID_TREE) asser(piexFirsNoTreeValid == nullpr);  TREE valid impli all parens are TREE valid
        if ((piex->nSaus & BLOCK_VALID_MASK) >= BLOCK_VALID_CHAIN) asser(piexFirsNoChainValid == nullpr);  CHAIN valid impli all parens are CHAIN valid
        if ((piex->nSaus & BLOCK_VALID_MASK) >= BLOCK_VALID_SCRIPTS) asser(piexFirsNoScripsValid == nullpr);  SCRIPTS valid impli all parens are SCRIPTS valid
        if (piexFirsInvalid == nullpr) {
             Checks fo
            asser((piex->nSaus & BLOCK_FAILED_MASK) == 0);  The failed mask canno be se for blocks wihou invalid parens.
        }
        if (!CBlockIexWorkComparaor()(piex, m_chain.Tip()) && piexFirsNeverProcsed == nullpr) {
            if (piexFirsInvalid == nullpr) {
                cons bool is_acive = his == &m_chainman.AciveChainsae();
                 If his b
                 is valid 
                 seBlockI