-
Notifications
You must be signed in to change notification settings - Fork 27
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(p2p): relay all recently-seen peers for neighbors #782
Conversation
2a5cd3c
to
c2f8dc7
Compare
cf72e8d
to
941d9fb
Compare
e253018
to
885ac3f
Compare
885ac3f
to
90c1724
Compare
ce879c5
to
7a0ccab
Compare
99e9f3b
to
1caa136
Compare
1caa136
to
52be237
Compare
7a0ccab
to
2542e8a
Compare
52be237
to
1543933
Compare
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
0c2d15d
to
e305645
Compare
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_seen
when the connection is ready and when new messages are received.known_peers.last_seen
to/v1a/status
API.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