libp2p / libp2p/go-libp2p

Improved Connection Manager

Open
#475 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The current connection manager is keeping our nodes from running out of memory but is breaking everything else pretty badly. Unfortunately, it's rather tricky to correctly use the current interface.

I'd *like* to do the following:

1. Introduce some *constants* to make relative weights clear. That is, predefine `const IMPORTANT = 100` etc.
2. Introduce stream tracking. By default, *any* open stream on a connection would keep the connection open. However, we'd provide a way to deactivate/activate streams. This way, the DHT can demote its streams and user applications won't get their connections cut when they're actually *using* them. Once we get multistream 2.0, we can probably move to a "open a stream if you're going to use it and close it when you're done with it" model but we're not there yet.
3. Introduce some concept of decaying weight. Each time we talk to the peer, we'd "refresh" the weight. Bitswap would likely do this when sending blocks to a peer.

Anyone have bandwidth for this? It'll take a bit of work to get it right but it should help immensely.

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 locating the current connection-manager interface and tracing how DHT streams and Bitswap peer activity use it. Done means the design supports named relative-weight constants, activatable stream tracking, and decaying weights refreshed by peer activity without cutting active user connections.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.