Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Add a node-specific ip echo service to remove dependency on ifconfig.co #4137

Merged
merged 1 commit into from
May 3, 2019

Conversation

mvines
Copy link
Contributor

@mvines mvines commented May 3, 2019

Problem

  1. We use ifconfig.co to figure a node's public IP address
  2. The --public-address flag to solana-{fullnode,replicator,gossip} is annoying and error prone. Why does it exist again? Oh, because we use ipconfig.co to figure a node's public IP address.
  3. IPv6 address can sneak into gossip because we use ipconfig.co to figure a node's public IP address (IPv6 address in gossip? #4095)

Summary of Changes

  • Each node now runs an ifconfig.co-like ip echo service on the TCP port corresponding to the node's gossip UDP port.
  • When a node tries to join a cluster it first asks the entrypoint node what its public IP address is. This works for both "private" and "public" clusters

Fixes #936 #4095 #4100

@mvines mvines requested a review from rob-solana May 3, 2019 16:20
@mvines mvines force-pushed the ip branch 2 times, most recently from af1457c to 1ae4bc2 Compare May 3, 2019 16:49
@codecov
Copy link

codecov bot commented May 3, 2019

Codecov Report

Merging #4137 into master will decrease coverage by 0.1%.
The diff coverage is 21.2%.

@@           Coverage Diff            @@
##           master   #4137     +/-   ##
========================================
- Coverage    77.8%   77.6%   -0.2%     
========================================
  Files         164     167      +3     
  Lines       28033   28010     -23     
========================================
- Hits        21816   21758     -58     
- Misses       6217    6252     +35

@rob-solana
Copy link
Contributor

This is a step in the right direction: inter-node routes may have to be sensitive to the infra between them. At some point we may have to bite the bullet and do STUN/TURN/WebRTC something?

What's the strategy for this use case: 2 nodes in a NAT form a network, they each look like 192.168.1. to each other, even though they want to be a public cluster. 3rd node from outside that network can't see any of their ports?

@mvines
Copy link
Contributor Author

mvines commented May 3, 2019

At some point we may have to bite the bullet and do STUN/TURN/WebRTC something?

Yeah I think so, but also not super eager to open up that box. Expanding a node's ContactInfo to support multiple IP addresses seems like a nice future improvement too.

What's the strategy for this use case: 2 nodes in a NAT form a network, they each look like 192.168.1. to each other, even though they want to be a public cluster. 3rd node from outside that network can't see any of their ports?

We use this mainly for max TPS testing when we want to ensure all nodes are staying within the cloud provider's local interconnect to avoid network ingress fees that are incurred when using the public IP address. They don't want to be a public cluster, nobody else should attach to the cluster. I think I failed to describe this well above :)

@rob-solana
Copy link
Contributor

At some point we may have to bite the bullet and do STUN/TURN/WebRTC something?

Yeah I think so, but also not super eager to open up that box. Expanding a node's ContactInfo to support multiple IP addresses seems like a nice future improvement too.

I thought about that possibility, but determining route-ability to a peer might be no fun.

What's the strategy for this use case: 2 nodes in a NAT form a network, they each look like 192.168.1. to each other, even though they want to be a public cluster. 3rd node from outside that network can't see any of their ports?

We use this mainly for max TPS testing when we want to ensure all nodes are staying within the cloud provider's local interconnect to avoid network ingress fees that are incurred when using the public IP address. They don't want to be a public cluster, nobody else should attach to the cluster. I think I failed to describe this well above :)

I think I missed this part: how does the bootstrap leader find himself?

@mvines
Copy link
Contributor Author

mvines commented May 3, 2019

I think I missed this part: how does the bootstrap leader find himself?

It needs to be told.

By default it's 127.0.0.1:

[127, 0, 0, 1],

and in a net/-based deployment, we give the bootstrap leader a private or public cloud address (depending on how the testnet was configured) right here:

--gossip-port "$entrypointIp":8001

brooksprumo pushed a commit to brooksprumo/solana that referenced this pull request Dec 16, 2024
* build(deps): bump thiserror from 2.0.6 to 2.0.7

Bumps [thiserror](https://github.com/dtolnay/thiserror) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](dtolnay/thiserror@2.0.6...2.0.7)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Update all Cargo files

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic when pinging ifconfig.co on the perf testnet
2 participants