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

network: pick STUN server to match node_addr IP version #11628

Merged
merged 3 commits into from
Jun 20, 2024

Conversation

saketh-are
Copy link
Collaborator

When nodes query an address such as stun.l.google.com:19302 for which there exist both IPv4 and IPv6 records, tokio::net::UdpSocket::connect chooses one arbitrarily.

We should make sure to query the appropriate server based on the IP version of the node's TCP listener address.

Copy link

codecov bot commented Jun 20, 2024

Codecov Report

Attention: Patch coverage is 80.55556% with 7 lines in your changes missing coverage. Please review.

Project coverage is 71.46%. Comparing base (cd7526d) to head (ab16c51).
Report is 4 commits behind head on master.

Files Patch % Lines
chain/network/src/stun/tests.rs 75.00% 0 Missing and 5 partials ⚠️
...in/network/src/peer_manager/network_state/tier1.rs 50.00% 0 Missing and 1 partial ⚠️
chain/network/src/stun/mod.rs 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11628      +/-   ##
==========================================
- Coverage   71.46%   71.46%   -0.01%     
==========================================
  Files         788      788              
  Lines      160854   160867      +13     
  Branches   160854   160867      +13     
==========================================
+ Hits       114958   114964       +6     
- Misses      40876    40877       +1     
- Partials     5020     5026       +6     
Flag Coverage Δ
backward-compatibility 0.23% <0.00%> (+<0.01%) ⬆️
db-migration 0.23% <0.00%> (+<0.01%) ⬆️
genesis-check 1.35% <7.14%> (+<0.01%) ⬆️
integration-tests 37.60% <30.55%> (-0.10%) ⬇️
linux 68.90% <77.77%> (+0.01%) ⬆️
linux-nightly 70.94% <77.77%> (-0.03%) ⬇️
macos 52.57% <71.42%> (+0.26%) ⬆️
pytests 1.59% <7.14%> (+<0.01%) ⬆️
sanity-checks 1.38% <7.14%> (+<0.01%) ⬆️
unittests 66.12% <80.55%> (-0.01%) ⬇️
upgradability 0.28% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@saketh-are saketh-are marked this pull request as ready for review June 20, 2024 02:55
@saketh-are saketh-are requested a review from a team as a code owner June 20, 2024 02:55
@saketh-are saketh-are added this pull request to the merge queue Jun 20, 2024
Merged via the queue into near:master with commit 8459f68 Jun 20, 2024
30 checks passed
@saketh-are saketh-are deleted the stun-dns-ip-version branch June 20, 2024 16:34
saketh-are added a commit that referenced this pull request Jun 25, 2024
When nodes query an address such as `stun.l.google.com:19302` for which
there exist both IPv4 and IPv6 records, `tokio::net::UdpSocket::connect`
chooses one arbitrarily.

We should make sure to query the appropriate server based on the IP
version of the node's TCP listener address.
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

Successfully merging this pull request may close these issues.

None yet

2 participants