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?
int ActiveHeight() const EXCLUSIVE_LOCKS_REQUIRED(GetMutex()) { return ActiveChain().Height(); }
    CBlockIndex* ActiveTip() const EXCLUSIVE_LOCKS_REQUIRED(GetMutex()) { return ActiveChain().Tip(); }
    node::BlockMap& BlockIndex() EXCLUSIVE_LOCKS_REQUIRED(::cs_main)
    {
        AssertLockHeld(::cs_main);
        return m_blockman.m_block_index;
    }
    /**
     * Track versionbit status
     */
    mutable VersionBitsCache m_versionbitscache;
    
    
    bool IsSnapshotActive() const;
    std::optional<uint256> SnapshotBlockhash() const;
    
    bool IsSnapshotValidated() const EXCLUSIVE_LOCKS_REQUIRED(::cs_main) { return m_snapshot_validated; }
    /**
     * Process an incoming block. This only returns after the best known valid
     * block is made active. Note that it does not, however, guarantee that the
     * specific block passed to it has been checked for validity!
     *
     * If you want to *possibly* get feedback on whether block is valid, you must
     * install a CValidationInterface (see validationinterface.h) - this will have
     * its BlockChecked method called whenever *any* block completes validation.
     *
     * Note that we guarantee that either the proof-of-work is valid on block, or
     * (and possibly also) BlockChecked will have been called.