backport of core#15660 and partial backport of core#20799
https://github.com/bitcoin/bitcoin/pull/20799/commits/cba909eaf938a775a9bd2dd994d06aba175e8713
Note that in our codebase test_node, ex_softfork_node and old_node are identical, as we use only version 1 compactblocks and NODE_NETWORK is the default services for TestP2PConn. As a result some tests were duplicated for no good reason. Removing this duplication divides the test time by 2.