filecoin-project / lotus

Reference implementation of the Filecoin protocol, written in Go
https://lotus.filecoin.io/
Other
2.83k stars 1.26k forks source link

DNS support on lotus-workers have been dropped #11465

Open piknikSteven2021 opened 10 months ago

piknikSteven2021 commented 10 months ago

Checklist

Lotus component

Lotus Version

root@sp-71c3:/home/lotus# lotus-worker --version
lotus-worker version 1.25.0+mainnet+git.7e6b20cd9

Repro Steps

  1. Export or set environmental variable as miner admin api-info with dns4/<dns name> rather than IPv4.
  2. Start the worker.

Describe the Bug

It appears that DNS support for miner API on the lotus-worker has been removed (though I don't think it appears DNS support was intended). On several of my workers after upgrading to v1.25.0 - I noticed the following error:

2023-11-29T02:33:39.966Z        INFO    main    lotus-worker/main.go:556        Opening local storage; connecting to master
2023-11-29T02:33:39.971Z        WARN    main    lotus-worker/main.go:116        dial tcp :2345: connect: connection refused

Host nslookup of the DNS names resolved with zero issues - the issues were prevalent only on the lotus-worker itself. It appears to me that the changes made to support IPv6 has ended up dropping DNS unintentionally. In this commit, at line 750-751 you can see that lotus-worker would just parse the miner API to get the address and port. But they were removed in favor of 765-774 and 779-786.

Logging Information

2023-11-29T02:33:39.966Z        INFO    main    lotus-worker/main.go:556        Opening local storage; connecting to master
2023-11-29T02:33:39.971Z        WARN    main    lotus-worker/main.go:116        dial tcp :2345: connect: connection refused
piknikSteven2021 commented 10 months ago

While I don't pretend to know Go and how to fix this, I can point to this line as to why DNS is not working anymore.

johansealstorage commented 8 months ago

I'm experiencing the same issue where this change broke my docker compose and kubernetes deployments where I was using DNS to automatically resolve and connect form workers to the miner.