You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The handle_chain_exchange_request function downloads blocks (aka tipsets) from peers. It does this by sending the same request to multiple peers and accepting the first valid response. However, a concurrency bug is triggered if the number of peers is low.
As seen in the code snippet below, the function waits for a valid result OR all the tasks to finish. If all the tasks finish, it assumes no valid responses and returns an error. This logic needs to be corrected: We should only fail when we've received invalid responses from all peers.
Issue summary
The
handle_chain_exchange_request
function downloads blocks (aka tipsets) from peers. It does this by sending the same request to multiple peers and accepting the first valid response. However, a concurrency bug is triggered if the number of peers is low.As seen in the code snippet below, the function waits for a valid result OR all the tasks to finish. If all the tasks finish, it assumes no valid responses and returns an error. This logic needs to be corrected: We should only fail when we've received invalid responses from all peers.
Other information and links
forest/blockchain/chain_sync/src/network_context.rs
Lines 275 to 282 in 2f6025d
The text was updated successfully, but these errors were encountered: