keep-ecdsa icon indicating copy to clipboard operation
keep-ecdsa copied to clipboard

Localhost/RFC 1918 addresses not filtered from node announced addresses

Open AJolly opened this issue 4 years ago • 1 comments

Nodes announce RFC1918/localhost addresses to the rest of the network by default.

This causes ecdsa-client to attempt to connect to addresses it can never reach. There are use cases, esp for testing where we want to be able to reach those addresses, but by default for production we should not be advertising those addresses for connection.

This slows down connection attempts to nodes, and a fix would likely speed up the initial node sync process.

2021-01-15T22:35:22.302Z [35mDEBUG[0m swarm2 [limiter] adding a dial job through limiter: /ip4/127.0.0.1/tcp/3920 2021-01-15T22:35:22.302Z [35mDEBUG[0m swarm2 [limiter] taking FD token: peer: 16Uiu2HAm8TJ33rA6rH8iq6Jiocms9M51sQsHgnfp8hduaWpFKxn6; addr: /ip4/127.0.0.1/tcp/3920; prev consuming: 1 2021-01-15T22:35:22.302Z [35mDEBUG[0m swarm2 [limiter] executing dial; peer: 16Uiu2HAm8TJ33rA6rH8iq6Jiocms9M51sQsHgnfp8hduaWpFKxn6; addr: /ip4/127.0.0.1/tcp/3920; FD consuming: 2; waiting: 0

AJolly avatar Jan 16 '21 20:01 AJolly

I don't know that we'll see a significant performance boost during peer resolution, but regardless this seems like a good idea. We should likely introduce this as an optional config flag initially. We can either filter auto-discovered announced addresses or filter connection attempts, if libp2p allows. That said, the team may not be able to pick this up in the immediate future so an outside contribution would be welcome.

Shadowfiend avatar Jan 18 '21 01:01 Shadowfiend