collator-protocol/validator_side: refactor collation fetching into a stream
As of #4179, we're using a HashMap of Futures to track all collation fetching requests.
The problem is that it makes it hard to poll all collations in the main select! loop of the collator protocol. Doing it outside of select loop introduces a latency (up to 1s), because select! is blocking.
Consider using https://docs.rs/futures/0.3.17/futures/stream/struct.FuturesUnordered.html or something similar instead of HashMap of Futures.
This should be pretty easy.
The main issue AFAIK is that we are using ctx when polling each future currently and then processing reputation changes. But we should just change it to a FuturesUnordered and use ctx to apply reputation changes to each one that concludes.
The main issue AFAIK is that we are using ctx when polling each future currently and then processing reputation changes.
After #4179, reputation changes and ctx borrowing is separated from polling each future.