This is a backport of [[https://github.com/bitcoin/bitcoin/pull/19572 | core#19572]] [3/4]
https://github.com/bitcoin/bitcoin/pull/19572/commits/68c3c7e1bdd00bbe7d70592a8eb39520fa3f87f1
The main change from the original PR is the removal of the RBF tests.
Depends on D10304