Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitswap sessions should rank peers #4396

Closed
Stebalien opened this issue Nov 17, 2017 · 1 comment
Closed

Bitswap sessions should rank peers #4396

Stebalien opened this issue Nov 17, 2017 · 1 comment

Comments

@Stebalien
Copy link
Member

As a "next step" in bitswap sessions, sessions should rank peers and ask progressively more peers for content. There are two parts to this:

Peer Tracking (ConnManager)

We'll probably need to track peer preference similar to how we currently track peer usefulness. Tracking usefulness allows us to decide how much we need the peer, tracking preference would allow us to decide if/when we should use the peer. We'd probably make this some function of:

  • Latency (given a request for a block, how quickly does the peer reply).
  • Cost (in the future, some links may cost more; e.g., relays).
  • Load (we should down weight peers we use a lot).

However, for now, we can probably just track latency (with a rolling average?).

Note: Technically, we don't have to use the ConnManager. We could use something else. However, IMO, the connmanager is the correct place to track this info.

Implementation

There are probably many ways to go about this but personally, I'd add the following functions to ConnManager:

type ConnManager interface {
    // Register a tag as having importance proportional to `weight` in `property`.
    RegisterTag(property, tag string, weight  int32)
    UnregisterTag(property, tag string, weight  int32)
}

Then, I'd use these weights when computing the "usefulness" and "preference" of peers.

Progressive Requests

On the bitswap session side, we'd want to progressively ask more and more peers for content, asking the lowest latency peers first.

@hannahhoward
Copy link
Contributor

superseded by #5723

as well as issues in the Bitswap backlog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants