AntelopeIO / spring

C++ implementation of the Antelope protocol with Savanna consensus
Other
9 stars 5 forks source link

P2P: Resolve endpoints on re-connect attempts #525

Closed heifner closed 1 month ago

heifner commented 3 months ago

Currently net_plugin resolves endpoints at startup and then reuses the tcp::resolver::results_type for any re-connection attempt. If resolve fails at startup then the resolve is not attempted again. Also net_plugin reports an unhelpful "Element not found` error.

See https://github.com/AntelopeIO/spring/pull/523#discussion_r1714117611

heifner commented 2 months ago

You do get a warn message on the first resolve, but since it never attempts the resolve again you only get the warn message once.

warn  2024-08-14T13:19:55.590 net-2     net_plugin.cpp:4638           operator()           ] Unable to resolve p2p.spring-beta.jungletestnet.io:9898 Host not found (authoritative)
spoonincode commented 2 months ago

fwiw, (depending on complexity of course) imo a fix for this should go in to stable release. It prevents the ability to do basic failover approaches via low TTL DNS records since clients won't see the updated record.