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

improvement(peerTracker): peerTracker hardening #142

Closed
vgonkivs opened this issue Jan 9, 2024 · 1 comment
Closed

improvement(peerTracker): peerTracker hardening #142

vgonkivs opened this issue Jan 9, 2024 · 1 comment

Comments

@vgonkivs
Copy link
Member

vgonkivs commented Jan 9, 2024

The current implementation of peerTracker has some edge cases that I'd like to bring to your attention. Additionally, I'd like to propose some ideas I have.

  1. As @renaynay mentioned p2p/peer_tracker: peerTracker scoring may be too aggressive #130 our scoring system is too aggressive. I believe, in the scope of this task, we should create an XLS table with different arithmetic methods (like EWMA) and then decide on the approach to adopt.
  2. The second idea relates to collecting a specific number, 'n', of peers, calculating their rate, and building a queue from them. All peers are stored in the PeerStore, and we also have a libp2p component managing connections with these peers. Instead of redundantly collecting peers in the peer tracker, could we retrieve them from the peerStore? Also, rather than storing scores within the peer tracker, could we store them within the connection manager under a specific tag?

The proposed flow for the session would be:

Retrieve peers from the peer store.
Gather peer scores from the connection manager and build the queue.
Update the tag with the new respective value after the request finishes.

The primary advantage here is that by utilizing the connection manager, we can remove our custom gc and can handle garbage collection of slow connections and manage peer trimming.

@vgonkivs
Copy link
Member Author

closed in favour of #160

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

1 participant