libp2p / libp2p/rust-libp2p

protocols/dcutr: Don't retry when incoming direct connection succeeded

Open
#2,607 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug difficulty:moderate getting-started help wanted
Dominant language
Rust
Stars
5.6k
Forks
1.3k
Avg merge
8h 47m
Merged PRs (30d)
19

Description

As of today we retry the DCUtR process when the outgoing direct connection upgrade failed.

In the case where the incoming direction connection upgraded succeeded, there is no need for retrying the process.

We should check direct_connections to see whether an (incoming) direct connection succeeded in the meantime.

https://github.com/libp2p/rust-libp2p/blob/7a1147877a52c7150190acdef35676cdac370299/protocols/dcutr/src/behaviour.rs#L152-L180

Contributor guide

Open the contributing guide

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 in protocols/dcutr/src/behaviour.rs around lines 152-180 and trace how the DCUtR retry decision uses direct_connections. Verify the incoming direct connection state before retrying after an outgoing upgrade failure. Done means the process does not retry when the incoming direction has already succeeded.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.