Skip to content

dash-spv: peers turned away for their ping block every refill #1553

Done

Description

@xdustinface

Candidates turned away at admission for a slow or missing handshake ping (Supervisor::repair_round, dash-spv/src/network/manager.rs) are closed through stash_backups, which records them with PeerDiscoverer::probed. PeerDiscoverer::get then hands out every probed address before any untried one.

A refill for one empty slot asks for 1 + DIAL_MARGIN = 3 candidates. Once three candidates have been turned away, every refill batch is those three. They are never banned, because their dial succeeded, so get removes them and stash_backups puts them straight back. A usable peer that was never tried is never dialed and the client stays below max_peers. Swap rounds also ask for 3 and get stuck the same way.

In a test on dev with 3 slots, two good peers, three peers whose pong takes 2 s and one usable untried peer, the three slow peers were each dialed 32 times in a minute and the usable peer 0 times.

Fix: remember whether a probed peer was turned away, and hand those out only after the untried addresses.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions