Coming from #27652, part of #29183.
The general idea is to keep track of the user requested blocks so, in case of a bad behaving peer or a network disconnection, they can be fetched from another one automatically without any further user interaction.
This was requested by users because the getblockfrompeer
RPC command
lacks the functionality to notify them about block request failures or peer
disconnections (which is expected due to the asynchronous nature of the block
requests).
Currently, this new functionality is limited to blocks requested by the user via the ‘getblockfrompeer’ RPC command.
In the future, this class could expand its scope and be utilized in the regular chain synchronization process. Or, even could be employed in special procedures like a prune node rescan that uses BIP158 block filters, or even into BIP157 itself.