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

p2p: exclude self from GetPeers results #6132

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

algorandskiy
Copy link
Contributor

@algorandskiy algorandskiy commented Sep 16, 2024

Summary

While running DevNet tests I've noticed a node might emit TxSync request to self that does not make any sense.
Fixed by filtering out node's own peerID from peerstore output.

Note, wsnet implementation is not modified because it cannot reliable identify self from DNS (and possible phonebook.json) input.

Test Plan

Added a unit test

Copy link

codecov bot commented Sep 16, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 51.76%. Comparing base (e60d3dd) to head (124124d).

Files with missing lines Patch % Lines
network/p2pNetwork.go 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6132      +/-   ##
==========================================
+ Coverage   49.25%   51.76%   +2.50%     
==========================================
  Files         644      644              
  Lines       86521    86524       +3     
==========================================
+ Hits        42617    44789    +2172     
+ Misses      41040    38862    -2178     
- Partials     2864     2873       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

gmalouf
gmalouf previously approved these changes Oct 17, 2024
cce
cce previously approved these changes Jan 7, 2025
@algorandskiy algorandskiy dismissed stale reviews from cce and gmalouf via 124124d January 30, 2025 18:41
@algorandskiy algorandskiy marked this pull request as ready for review January 30, 2025 18:42
@algorandskiy algorandskiy requested review from gmalouf and cce January 30, 2025 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants