ipfs / ipfs/kubo

Recover original "swarm connect" behaviour with a flag

Open
#6,313 3 comments 2 reactions 0 assignees View on GitHub
kind/bug
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

#### Version information: master

#### Type: Enhancement

#### Description:

From 0.4.20 `swarm connect` tags connections with a harcoded weight of 100:

https://github.com/ipfs/go-ipfs/blob/master/core/coreapi/swarm.go#L31

This should indicate the ConnManager that those connections should be kept alive (although it may not work #6271 ). That happens around here:

https://github.com/libp2p/go-libp2p-connmgr/blob/master/connmgr.go#L157

where peers are sorted based on the value resulting from the sum of their tags.

There should be a way (an extra flag for example) to just `swarm connect` normally to a peer like it happened before. The idea is tha swarm connect can be used to bootstrap the swarm but does not necessarily mean that the connected peer should have priority over any others when it comes to disposing of connections. Or at least the weight should be selectable by the user.

I was going to do this but it seems to require changes to `coreapi` (to pass tags/weights), so better discuss before.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.