conflux-rust
conflux-rust copied to clipboard
Using peer_id to keep track of requests can introduce inconsistent behavior.
When peers are disconnected, its peer_id may be reused by other connections later. Now we memorize the peer_id of in-flight requests in the protocol handler and process them if timeout. Reused peer_id can introduce unexpected behavior in match_request. With issue #35, this bug may be trigger quite commonly now. One solution is to keep track of in-flight requests in every peer's state, and this can be fixed together with cleverer synchronization of headers/blocks because we also need more state there.
This is not going to cause serious problem. Timeout requests of disconnected sessions may cause log with wrong "Unexpected Response" message which has been fixed.