These changes force outgoing TCP connections to respect the address configured by the --node flag. When not properly bound, peers of multi-home/multi-address hosts are broadcasting incorrect socket addresses, which can increase load on unrelated nodes.
Example scenario (based off of our canary nodes, all 3 nodes running on the same server):
client 1 bound on 6.5.4.100
client 2 bound on 6.5.4.101
client 3 bound on 6.5.4.102
clients 2 and 3 make outgoing connection requests on 6.5.4.100, rather than .101 or .102
other nodes in the network will not connect to clients 1, 2 or 3 at the same time because the is_connected check is based on this "resolved address"
peers connected to clients 2 and 3 broadcast the wrong address and clients 2/3 never get new peers from initiated connections (other than ones configured properly via --peers 6.5.4.101:4130)
increased peering traffic is sent to client 1
Test Plan
We are successfully running this on canary, and this is a minimal change based on tokio's documentation
Motivation
These changes force outgoing TCP connections to respect the address configured by the
--node
flag. When not properly bound, peers of multi-home/multi-address hosts are broadcasting incorrect socket addresses, which can increase load on unrelated nodes.Example scenario (based off of our canary nodes, all 3 nodes running on the same server):
Side-effects of not binding the correct address:
is_connected
check is based on this "resolved address"--peers 6.5.4.101:4130
)Test Plan
We are successfully running this on canary, and this is a minimal change based on tokio's documentation