-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AutoNAT: return E_DIAL_REFUSED instead of E_DIAL_ERROR of when skipping dial #1482
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should leave a comment here too: https://github.com/libp2p/go-libp2p/blob/master/p2p/host/autonat/client.go#L79 since it's used there by the client.
But there it only checks if there is an error, not what type of error it is. Shouldn't we then rather put that comment on the go-libp2p/p2p/host/autonat/autonat.go Lines 376 to 396 in f383f46
|
I think that makes sense. I’d like to cover the case where someone in the future looks at this code and thinks “Hmm, if I check for dial refused I can do something clever” and doesn’t know that older peers will almost always return dial error. As long as that case is covered, I’m happy :) |
@elenaf9 Are you planning to address @MarcoPolo's comments? Would be great if we could this fix into the next release! |
Yes, will add something later today or tomorrow. Sorry for the delay. |
Replaced by the (rebased and squashed) #1527. |
Discussed in libp2p/specs#411:
When skipping a dial as a server, we should return
E_DIAL_REFUSED
instead ofE_DIAL_ERROR
because we never actually tried to dial the client.