-
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
Track more info for observed addresses #427
Track more info for observed addresses #427
Conversation
edace18
to
cd2f749
Compare
ping @vyzo @Stebalien for review. |
is this actually useful? |
This patch pave the way for #421, so peers would see less addresses that are actually not reachable. |
Very. Without this, we don't know:
|
I believe the we need to map internal to external to observation. This currently records the first observed internal address (and the first observed direction) but that may not be consistent. That is, I believe we'd want something like:
That way, for each internal address, we can list out all the observed external addresses and figure out where from and how they've been observed. |
I think an internal address could be observed as multiple external addresses, not the opposite. Say my node is listening on |
You can get both (technically). These observed addresses include observed addresses from outbound connections. It's possible for two sequential (non-overlapping) connections from different internal ports to end up using the same external port. |
That's possible, but from my experience, is very rare. A reasonable NAT implementation would avoid port reuse in a very short time, so if two internal ports are mapped to the same external port, it's highly possible that the first connection is considered as closed. |
It's also possible for a peer to lie. IMO, that's the real issue here. The only thing we know is the internal address. The external address is just an observation being reported by a peer. |
That's still a |
The latter. Specifically: |
- map internal -> []{external -> { observer -> [time, direction] } } - some cleaning
cd2f749
to
96df62b
Compare
I think I misunderstood your intention, updated now. Another idea occurs to me that |
Any comments? Still invalid implementation? |
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.
Two small nits but this otherwise looks like a great improvement!
p2p/protocol/identify/obsaddr.go
Outdated
} | ||
filteredAddrMap[local] = filteredAddrs |
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.
Any reason not to update oas.addrs
directly?
1b8e752
to
92ec4b2
Compare
Re-run CI, tests passed now. |
Fix #416