-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Problem
max_parallel_requests is "meaning overloaded" because we compare it against pending_requests.len(). However, pending_requests contains both i) requests that we have received a response and for which we have not yet validated their values (i.e., checking their certificates), and ii) requests for which we have not received a response yet.
This double-meaning causes problems and for this reason, we removed the max_parallels_requests check from request_values_range. Because otherwise a syncing node (with max_parallel_requests = 1) is not able to request the remaining range since it already has pending_requests.len() == 1 for the partial response it just received and it has not yet processed.
Solution
Clearly mark a request on whether it still waits for a response from the network or it has the response but waits to verify it, etc. and perform checks accordingly. Another option (better) would be to introduce a new queue where we insert all the requests to be made and then requests are periodically taken from this queue to be sent to the other peers.