refactoring(p2p/peerTracker): extend conditions for peers handling#165
Closed
vgonkivs wants to merge 5 commits intocelestiaorg:mainfrom
Closed
refactoring(p2p/peerTracker): extend conditions for peers handling#165vgonkivs wants to merge 5 commits intocelestiaorg:mainfrom
vgonkivs wants to merge 5 commits intocelestiaorg:mainfrom
Conversation
d1f04df to
6c3038a
Compare
8ef32e8 to
4f48548
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #165 +/- ##
=========================================
+ Coverage 0 62.11% +62.11%
=========================================
Files 0 39 +39
Lines 0 3590 +3590
=========================================
+ Hits 0 2230 +2230
- Misses 0 1182 +1182
- Partials 0 178 +178 ☔ View full report in Codecov by Sentry. |
Member
Author
|
moving to draft until libp2p/go-libp2p#2759 is integrated as it brings improvements to the IdentificationEvent that we rely on. |
4f48548 to
7ae6615
Compare
7ae6615 to
c88c554
Compare
Contributor
|
Closing b/c stale. Please reopen if this is still relevant. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR brings a bunch of improvements to the peer tracker:
ConnManager. Libp2p provides us with a good mechanism for tracking peers' scores, so I don't see any reason why we shouldn't use it. Now, instead of keeping all peerStats inside the peer tracker, we will store only peers, and constructing peerStats will beon fly.a. EvtPeerIdentificationCompleted helps to ensure that peer is correct and supports all basic libp2p protocols+ during EvtPeerConnectednessChanged peer store hasn't got information about supported protocols of the incoming peer, so we can't check if the peer supports header-ex protocolID.
b. EvtPeerProtocolsUpdated allows to detect when peer stop/start supporting header-ex protocol.
c. Check if the incoming peer supports a header-ex protocol before storing it.
{err: close called for the closed stream}. This error was received when we were trying to close the stream after the request had been finished(for quic transport). Stream.Close() does stream.CloseRead() + stream.CloseWrite() internally, so I decided to change Close() -> CloseRead(). PS. The issue has gone.Checklist