• M
    eth/downloader: fix peer idleness tracking when restarting state sync (#21260) · 967d8de7
    Martin Holst Swende 提交于
    This fixes two issues with state sync restarts:
    
    When sync restarts with a new root, some peers can have in-flight requests.
    Since all peers with active requests were marked idle when exiting sync,
    the new sync would schedule more requests for those peers. When the
    response for the earlier request arrived, the new sync would reject it and
    mark the peer idle again, rendering the peer useless until it disconnected.
    
    The other issue was that peers would not be marked idle when they had
    delivered a response, but the response hadn't been processed before
    restarting the state sync. This also made the peer useless because it
    would be permanently marked busy.
    Co-authored-by: NFelix Lange <fjl@twurst.com>
    967d8de7
statesync.go 18.3 KB