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

feat: moving protocol peer management's source of truth into libp2p's metadata #2167

Closed
danisharora099 opened this issue Oct 8, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@danisharora099
Copy link
Collaborator

danisharora099 commented Oct 8, 2024

This is an improvement request

Problem

We currently rely on PeerManager that maintains a copy of peers being used for the protocol, and maintain the copy in-memory in an array.

We might be able to improve this maintenance of the copy of peer list in an array, to the usage of metadata in Libp2p's PeerStore for the same.

Proposed Solution

Experiment with moving the source of truth for which peers to use for protocols as part of the peer's metadata instead of an in-memory variable

Notes

@chair28980 chair28980 added this to Waku Oct 8, 2024
@danisharora099
Copy link
Collaborator Author

WIP efforts: #2172

@weboko weboko added the enhancement New feature or request label Oct 10, 2024
@weboko weboko moved this from Triage to In Progress in Waku Oct 10, 2024
@danisharora099
Copy link
Collaborator Author

danisharora099 commented Oct 10, 2024

some observations so far on this issue:

Pro:

  • streamlined and global access to data on which peers are being used for which protocol
  • in memory array access is performant

Con:

@weboko
Copy link
Collaborator

weboko commented Oct 10, 2024

let's research:

  • impact of await on libp2p.peerStore in ms
  • usage of Connection.metadata field that is a plain dictionary

relevant comment https://github.com/waku-org/js-waku/pull/2137/files#r1795552243

@weboko
Copy link
Collaborator

weboko commented Oct 15, 2024

I think I found an approach to this problem and will tackle it in #2186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

2 participants