Skip to content

fix: peer discovery and reputation usage #416

Closed

Description

@xdustinface

There are few things we should fix/improve related to peer management:

  • I think we currently don't really request/process the Addr/AddrV2 messages so we only end up with a very limited number of peers we try to connect to from the initial DNS lookup. We should ask every new peer for its peers and maintain a list of reliable peers.
  • We should probably also try to connect to random peers to test them / get more addresses from other peers this way to find reliable peers if we dont have any good in our current list?
  • We currently don't penalise any peer for misbehaving or being unreliable. Like giving a peer a small bump when its request times out is probably a good idea to eventually get rid of unreliable peers to avoid running constantly into timed out responses. Its probably also a good idea to let peers recover from being unreliable, i.e. removing score after a while?
  • Store the time we last connected successfully to a peer and also include it in the decision which peer to connect to?

There is already some reputation management code which can be used/adjusted for this.

Activity

  1. ZocoLini commented on Oct 30, 2026

    @ZocoLini
    Collaborator

    Mostly addressed by #420/#421/#422 and the network rewrite in #902: every accepted peer is asked for GetAddr, Addr/AddrV2 are processed, discovery mixes probed peers with random candidates, and timeouts/misbehaviour lead to expiring bans. The remaining problems in the new code are tracked in #1239, #1240 and #1241.

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