I'm trying to clear up some uncertainties around the mempool
A tx comes in, its validated, and no other transactions have currently marked any of its inputs. Tx gets added to mempool.
If a double spend comes in (i.e a tx that uses any marked inputs it is discarded, maybe we mark it as a double spend attempt.
If a block is committed, any txs in the mempool referencing spent inputs are removed from the mempool. If the Tx being removed is not equivalent to the one being added that Tx is marked as an orphan (if you wanted tx orphan tracking)
If a block is rolled back, consumed unspents are restored, tx is added back into mempool as unconfirmed.
Is that roughly correct? I feel like there are some edge cases around mempool and block roll back that this doesn't address.