-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(libp2p): filter out dnsaddrs for different peers (#1954)
Some multiaddrs like `/dnsaddr/bootstrap.ipfs.io` resolve to multiple PeerIds. E.g: ```console % dig _dnsaddr.bootstrap.libp2p.io TXT ; <<>> DiG 9.10.6 <<>> _dnsaddr.bootstrap.libp2p.io TXT ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53473 ;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 1232 ;; QUESTION SECTION: ;_dnsaddr.bootstrap.libp2p.io. IN TXT ;; ANSWER SECTION: _dnsaddr.bootstrap.libp2p.io. 261 IN TXT "dnsaddr=/dnsaddr/am6.bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb" _dnsaddr.bootstrap.libp2p.io. 261 IN TXT "dnsaddr=/dnsaddr/ny5.bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa" _dnsaddr.bootstrap.libp2p.io. 261 IN TXT "dnsaddr=/dnsaddr/sg1.bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt" _dnsaddr.bootstrap.libp2p.io. 261 IN TXT "dnsaddr=/dnsaddr/sv15.bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN" ``` This can cause problems when dialing those addresses with a PeerId since resolving the dnsaddr returns addresses with embedded PeerIds that aren't for the node you are trying to dial so filter those out. The errors these cause are non-fatal but do consume resources dialing nodes we aren't going to be able to connect to.
- Loading branch information
1 parent
4c1a33b
commit a31b420
Showing
3 changed files
with
66 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters