Handle request timeouts in peer sessions
masterPeer sessions implement dynamic timeout mechanisms for block requests to prevent the download from getting stuck if a peer fails to respond.
- Purpose: If a peer doesn't send a requested block within the window, the session can attempt to request it from a different peer.
- Dynamic Adjustment: Each peer has a unique timeout value derived from a weighted running average of round-trip times (RTT). New samples have a weight of $1/20$ to guard against jitter.
- Minimum Threshold: To prevent premature timeouts during minor network hiccups, the minimum timeout is set to 2 seconds.