We currently store rejected mempool transactions in the extra pool. This includes (some) policy and consensus rejected transactions.
It seems trivial to attack this pool for free with consensus invalid transactions, or almost free with policy violating transactions that are extremely unlikely to ever get mined. This was known at the time it was introduced: #9499 (review)
At the same time the orphanage already handles some cases that were initially dealt with here.
This commit simplifies things by only putting replaced transactions in the extra pool, as these represent things that at least previously passed our mempool DoS protections.
Later on we could introduce similar DoS protection as #31829 does for the orphan pool, and then expand the list of things we store again. Or even revert to the present behavior.
This extra pool was introduced by #9499. It started with just adding replaced transactions in commit 93380c5247526e2248248a7d539233ec48d11bdd, added orphans in 7f8c8cab1e537809848088d3bfaa13ecca7ac8cc and then all the other rejected things in 863edb45b9841c3058e883015c7576e6f69e3cc6.
TODO:
- restore some lost test coverage
- consider bringing some reject reasons back to this pool