libp2p / libp2p/go-libp2p

don't redial peers at addresses if the handshake failed before

Open
#1,051 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/enhancement
Dominant language
Go
Stars
6.9k
Forks
1.3k
Avg merge
13d 21h
Merged PRs (30d)
1

Description

We're currently re-dailing peers, even if the handshake failed for reasons other than connection timeout. For example, there are a bunch of peers around that present invalid certificates (where the certificate doesn't match the peer ID).

One way to solve this would be to remove the address from the address book. While this would help us prevent redials in the short term, we still might end up re-adding this address back to the address book later.

Another option would be to mark an address as "broken, do not redial" in the address book: This would blacklist this address for future dial attempts from our side. It would also make sure that we don't accidentally re-add this address later.

Depending on exactly how the address is broken, we might also want to not share this address with other peers. If we discover a mismatch between peer ID and the certificate, there's no point for other peers to even attempt a handshake. On the other hand, if our handshake failed e.g. due to an incompatibility of supported stream muxers, we'd still want to share this address. I'm not sure how this will interact with signed peer records though.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the address-book and handshake handling described in the issue, including how signed peer records are processed. Determine which handshake failures should prevent redialing and address sharing, then verify that valid addresses and shareable failures still behave as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.