feat(p2p): relay all recently-seen peers for neighbors#782
Merged
Conversation
2a5cd3c to
c2f8dc7
Compare
cf72e8d to
941d9fb
Compare
e253018 to
885ac3f
Compare
msbrogli
commented
Sep 22, 2023
885ac3f to
90c1724
Compare
ce879c5 to
7a0ccab
Compare
99e9f3b to
1caa136
Compare
jansegre
approved these changes
Sep 22, 2023
1caa136 to
52be237
Compare
7a0ccab to
2542e8a
Compare
52be237 to
1543933
Compare
glevco
previously approved these changes
Sep 22, 2023
jansegre
previously approved these changes
Sep 22, 2023
f994480 to
a6ceae7
Compare
617b327 to
6289b36
Compare
The base branch was changed.
bab33f4 to
2e4a962
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #782 +/- ##
==========================================
+ Coverage 84.66% 84.69% +0.03%
==========================================
Files 264 266 +2
Lines 22034 22117 +83
Branches 3369 3378 +9
==========================================
+ Hits 18654 18731 +77
- Misses 2725 2728 +3
- Partials 655 658 +3
☔ View full report in Codecov by Sentry. |
7855318 to
0c2d15d
Compare
jansegre
approved these changes
Oct 17, 2023
0c2d15d to
e305645
Compare
This was referenced Oct 17, 2023
Merged
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.
Motivation
The full node currently relays only connections in the ready state. So, if a connection drops for just a few seconds, we might not relay this peer information to our neighbors.
The current behavior of the full node involves requesting peer information from a neighboring node exclusively during the initial connection establishment phase. Consequently, if the full node attempts to establish a connection with a peer and that peer rejects the connection, there is a risk that the full node will subsequently remove this peer from its peer storage. As a result, there would be no further attempts made to connect to this particular peer in the future.
Acceptance Criteria
ConnectionsManager.peer_storage.PeerId.last_seen: float.protocol.peer.last_seenwhen the connection is ready and when new messages are received.known_peers.last_seento/v1a/statusAPI.time.time()fromhathor.p2p.resources.StatusResource.send_get_peers()every 5 minutes.Checklist
master, confirm this code is production-ready and can be included in future releases as soon as it gets merged