Notes:
- CBlockIndexWorkComparator is not part of the node namespace for Bitcoin ABC because it is defined in its own header file rather than src/node/blockstorage.h
- some fuzzers and minisketchwrapper.* changes are not applicable due to missing backports (see core#23114).
This is a partial backport of core#23497
https://github.com/bitcoin/bitcoin/pull/23497/commits/90fc8b089d591cabff60ee829a33f96c37fd27ba